summaryrefslogtreecommitdiff
path: root/test/files/run/t8601d.scala
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2014-05-18 12:21:45 +0200
committerJason Zaugg <jzaugg@gmail.com>2014-05-19 22:28:11 +0200
commit51c60a93009c4470343888e424f58229ecf52ec6 (patch)
tree6c898e733e6e2cf0616c637e15e302ac927a07da /test/files/run/t8601d.scala
parentae0fe9e507b12dc07f9cac2d6774a7bb270e9998 (diff)
downloadscala-51c60a93009c4470343888e424f58229ecf52ec6.tar.gz
scala-51c60a93009c4470343888e424f58229ecf52ec6.tar.bz2
scala-51c60a93009c4470343888e424f58229ecf52ec6.zip
SI-8601 Test that `null.synchronized` NPEs under -optimize
As part of my sweep through the side-effecting byte code instructions.
Diffstat (limited to 'test/files/run/t8601d.scala')
-rw-r--r--test/files/run/t8601d.scala8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/files/run/t8601d.scala b/test/files/run/t8601d.scala
new file mode 100644
index 0000000000..ac89963d67
--- /dev/null
+++ b/test/files/run/t8601d.scala
@@ -0,0 +1,8 @@
+object Test {
+ def monitor(x: AnyRef): Unit = {x.synchronized(()); ()}
+ def check(x: => Any) = try { x; sys.error("failed to throw NPE") } catch { case _: NullPointerException => }
+
+ def main(args: Array[String]) {
+ check(monitor(null))
+ }
+}