diff options
Diffstat (limited to 'test/files/run/optimizer-array-load.scala')
-rw-r--r-- | test/files/run/optimizer-array-load.scala | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/files/run/optimizer-array-load.scala b/test/files/run/optimizer-array-load.scala new file mode 100644 index 0000000000..a4d76f7385 --- /dev/null +++ b/test/files/run/optimizer-array-load.scala @@ -0,0 +1,16 @@ +object Test { + def f() = { + val ar = Array.ofDim[Int](5) + var x = 0 + + while (x<=5) { + println(x) + val a = ar(x) + x+=1 + } + } + def main(args: Array[String]): Unit = { + try { f() ; assert(false, "should have thrown exception") } + catch { case _: ArrayIndexOutOfBoundsException => () } + } +} |