From 2a659cf0edb897e0e18c1604c1ec5950b623827a Mon Sep 17 00:00:00 2001 From: Miguel Garcia Date: Wed, 21 Aug 2013 17:11:21 +0200 Subject: SI-7407 fixed in GenBCode but beware, it remains a bug in GenASM GenBCode runs only under a flag, and moreover only if -optimise is not present (see ScalaSettings for details). Therefore during a nightly, when tests are run under -optimise, we need -Ynooptimise to deactivate the optimizer. With that, GenBCode can run and tackle the test case successfuly. --- test/files/run/t7407.check | 1 + test/files/run/t7407.flags | 1 + test/files/run/t7407.scala | 11 +++++++++++ test/files/run/t7407b.check | 2 ++ test/files/run/t7407b.flags | 1 + test/files/run/t7407b.scala | 20 ++++++++++++++++++++ 6 files changed, 36 insertions(+) create mode 100644 test/files/run/t7407.check create mode 100644 test/files/run/t7407.flags create mode 100644 test/files/run/t7407.scala create mode 100644 test/files/run/t7407b.check create mode 100644 test/files/run/t7407b.flags create mode 100644 test/files/run/t7407b.scala (limited to 'test') diff --git a/test/files/run/t7407.check b/test/files/run/t7407.check new file mode 100644 index 0000000000..e965047ad7 --- /dev/null +++ b/test/files/run/t7407.check @@ -0,0 +1 @@ +Hello diff --git a/test/files/run/t7407.flags b/test/files/run/t7407.flags new file mode 100644 index 0000000000..c8547a27dc --- /dev/null +++ b/test/files/run/t7407.flags @@ -0,0 +1 @@ +-Ynooptimise -Ybackend:GenBCode diff --git a/test/files/run/t7407.scala b/test/files/run/t7407.scala new file mode 100644 index 0000000000..cf67602126 --- /dev/null +++ b/test/files/run/t7407.scala @@ -0,0 +1,11 @@ +// SI-7407 +object Test { + + def main(args: Array[String]) { println(foo) } + + def foo: String = { + try return "Hello" finally 10 match {case x => ()} + } + +} + diff --git a/test/files/run/t7407b.check b/test/files/run/t7407b.check new file mode 100644 index 0000000000..f30294447b --- /dev/null +++ b/test/files/run/t7407b.check @@ -0,0 +1,2 @@ +Hello +abc diff --git a/test/files/run/t7407b.flags b/test/files/run/t7407b.flags new file mode 100644 index 0000000000..c8547a27dc --- /dev/null +++ b/test/files/run/t7407b.flags @@ -0,0 +1 @@ +-Ynooptimise -Ybackend:GenBCode diff --git a/test/files/run/t7407b.scala b/test/files/run/t7407b.scala new file mode 100644 index 0000000000..b0c00878b5 --- /dev/null +++ b/test/files/run/t7407b.scala @@ -0,0 +1,20 @@ +object Test { + + def main(args: Array[String]) { + println(foo(true)) + println(foo(false)) + } + + def foo(b: Boolean): String = { + try { + if(b) + return "Hello" + else + "abc" + } finally { + 10 match {case x => ()} + } + } + +} + -- cgit v1.2.3