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-18 12:21:45 +0200
commitdcade51d751b389fb5137040f7e1006b4bc633c6 (patch)
treef569bc4f3f57279fbcb68e67f72110c3fffb7af0 /test/files/run/t8601d.scala
parent70b912a87433c9589af33e4f8b33dca39abb66e5 (diff)
downloadscala-dcade51d751b389fb5137040f7e1006b4bc633c6.tar.gz
scala-dcade51d751b389fb5137040f7e1006b4bc633c6.tar.bz2
scala-dcade51d751b389fb5137040f7e1006b4bc633c6.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))
+ }
+}