From 42aff37076747c5b63a8cae073deb9c4930d8f7a Mon Sep 17 00:00:00 2001 From: Lukas Rytz Date: Mon, 20 Oct 2014 15:38:25 +0200 Subject: SI-8925, SI-7407 test cases, fixed in new backend Given that the issues are old (2.10) and we move to the new backend in 2.12, I don't plan to fix them in GenASM. The test case for 7407 existed already, this commit just adds `-Yopt:l:none` to the flags to make no dead code is eliminated. --- test/files/run/t7407.flags | 2 +- test/files/run/t8925.check | 2 ++ test/files/run/t8925.flags | 1 + test/files/run/t8925.scala | 31 +++++++++++++++++++++++++++++++ 4 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 test/files/run/t8925.check create mode 100644 test/files/run/t8925.flags create mode 100644 test/files/run/t8925.scala (limited to 'test/files') diff --git a/test/files/run/t7407.flags b/test/files/run/t7407.flags index c8547a27dc..be4ef0798a 100644 --- a/test/files/run/t7407.flags +++ b/test/files/run/t7407.flags @@ -1 +1 @@ --Ynooptimise -Ybackend:GenBCode +-Ynooptimise -Yopt:l:none -Ybackend:GenBCode diff --git a/test/files/run/t8925.check b/test/files/run/t8925.check new file mode 100644 index 0000000000..112e7005df --- /dev/null +++ b/test/files/run/t8925.check @@ -0,0 +1,2 @@ +bar +abcd diff --git a/test/files/run/t8925.flags b/test/files/run/t8925.flags new file mode 100644 index 0000000000..be4ef0798a --- /dev/null +++ b/test/files/run/t8925.flags @@ -0,0 +1 @@ +-Ynooptimise -Yopt:l:none -Ybackend:GenBCode diff --git a/test/files/run/t8925.scala b/test/files/run/t8925.scala new file mode 100644 index 0000000000..33f4505f03 --- /dev/null +++ b/test/files/run/t8925.scala @@ -0,0 +1,31 @@ +object Ex { + def unapply(t: Throwable): Option[Throwable] = Some(t) +} + +class A { + var x = "" + + def bar = + try { + "bar" + } finally { + try { + x += "a" + } finally { + x += "b" + try { + x += "c" + throw null + } catch { + case Ex(_) => + x += "d" + } + } + } +} + +object Test extends App { + val a = new A + println(a.bar) + println(a.x) +} -- cgit v1.2.3