diff options
Diffstat (limited to 'test/pending/run')
-rw-r--r-- | test/pending/run/private-inline.check | 13 | ||||
-rw-r--r-- | test/pending/run/private-inline.flags | 1 | ||||
-rw-r--r-- | test/pending/run/private-inline.scala | 52 | ||||
-rw-r--r-- | test/pending/run/t5698/client.scala | 9 | ||||
-rw-r--r-- | test/pending/run/t5698/server.scala | 22 | ||||
-rw-r--r-- | test/pending/run/t5698/testmsg.scala | 5 |
6 files changed, 66 insertions, 36 deletions
diff --git a/test/pending/run/private-inline.check b/test/pending/run/private-inline.check new file mode 100644 index 0000000000..e71aec2fcf --- /dev/null +++ b/test/pending/run/private-inline.check @@ -0,0 +1,13 @@ +private-inline.scala:24: warning: Could not inline required method wrapper1 because callee contains exception handlers / finally clause, and is invoked with non-empty operand stack. + def f1b() = identity(wrapper1(5)) + ^ +private-inline.scala:24: warning: At the end of the day, could not inline @inline-marked method wrapper1 + def f1b() = identity(wrapper1(5)) + ^ +private-inline.scala:29: warning: Could not inline required method wrapper2 because callee contains exception handlers / finally clause, and is invoked with non-empty operand stack. + def f2b() = identity(wrapper2(5)) + ^ +private-inline.scala:29: warning: At the end of the day, could not inline @inline-marked method wrapper2 + def f2b() = identity(wrapper2(5)) + ^ +20 diff --git a/test/pending/run/private-inline.flags b/test/pending/run/private-inline.flags new file mode 100644 index 0000000000..c550fdce16 --- /dev/null +++ b/test/pending/run/private-inline.flags @@ -0,0 +1 @@ +-optimise -Yinline-warnings -Ybackend:GenASM diff --git a/test/pending/run/private-inline.scala b/test/pending/run/private-inline.scala new file mode 100644 index 0000000000..60fef9efca --- /dev/null +++ b/test/pending/run/private-inline.scala @@ -0,0 +1,52 @@ + +final class A { + private var x1 = false + var x2 = false + + // manipulates private var + @inline private def wrapper1[T](body: => T): T = { + val saved = x1 + x1 = true + try body + finally x1 = saved + } + // manipulates public var + @inline private def wrapper2[T](body: => T): T = { + val saved = x2 + x2 = true + try body + finally x2 = saved + } + + // not inlined + def f1a() = wrapper1(5) + // inlined! + def f1b() = identity(wrapper1(5)) + + // not inlined + def f2a() = wrapper2(5) + // inlined! + def f2b() = identity(wrapper2(5)) +} + +object Test { + def methodClasses = List("f1a", "f2a") map ("A$$anonfun$" + _ + "$1") + + def main(args: Array[String]): Unit = { + val a = new A + import a._ + println(f1a() + f1b() + f2a() + f2b()) + + // Don't know how else to test this: all these should have been + // inlined, so all should fail. + methodClasses foreach { clazz => + + val foundClass = ( + try Class.forName(clazz) + catch { case _: Throwable => null } + ) + + assert(foundClass == null, foundClass) + } + } +} diff --git a/test/pending/run/t5698/client.scala b/test/pending/run/t5698/client.scala deleted file mode 100644 index de672c1809..0000000000 --- a/test/pending/run/t5698/client.scala +++ /dev/null @@ -1,9 +0,0 @@ -package client - - - -object Client extends App { - val peer = actors.remote.Node("localhost", 23456) - val a = actors.remote.RemoteActor.select(peer, 'test) - a ! server.TestMsg -} diff --git a/test/pending/run/t5698/server.scala b/test/pending/run/t5698/server.scala deleted file mode 100644 index e8f3cea225..0000000000 --- a/test/pending/run/t5698/server.scala +++ /dev/null @@ -1,22 +0,0 @@ -package server - - - -object Server extends App { - - class ServerActor extends actors.Actor { - def act() { - actors.remote.RemoteActor.alive(23456) - actors.remote.RemoteActor.register('test, actors.Actor.self) - loop { - react { - case TestMsg => println("Yay!") - } - } - } - } - - val a = new ServerActor - a.start() - -} diff --git a/test/pending/run/t5698/testmsg.scala b/test/pending/run/t5698/testmsg.scala deleted file mode 100644 index 004ff0b8c7..0000000000 --- a/test/pending/run/t5698/testmsg.scala +++ /dev/null @@ -1,5 +0,0 @@ -package server - - - -case object TestMsg |