diff options
author | Lukas Rytz <lukas.rytz@gmail.com> | 2014-10-20 15:38:25 +0200 |
---|---|---|
committer | Lukas Rytz <lukas.rytz@gmail.com> | 2014-11-04 13:13:25 +0100 |
commit | 42aff37076747c5b63a8cae073deb9c4930d8f7a (patch) | |
tree | 07a6e0fa6194ad13437fb351a6de1408f8da532c | |
parent | b556b2fdcc7198bffe0ee90c5adc8c9eb3c29e36 (diff) | |
download | scala-42aff37076747c5b63a8cae073deb9c4930d8f7a.tar.gz scala-42aff37076747c5b63a8cae073deb9c4930d8f7a.tar.bz2 scala-42aff37076747c5b63a8cae073deb9c4930d8f7a.zip |
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.
-rw-r--r-- | test/files/run/t7407.flags | 2 | ||||
-rw-r--r-- | test/files/run/t8925.check | 2 | ||||
-rw-r--r-- | test/files/run/t8925.flags | 1 | ||||
-rw-r--r-- | test/files/run/t8925.scala | 31 |
4 files changed, 35 insertions, 1 deletions
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) +} |