summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorLukas Rytz <lukas.rytz@gmail.com>2015-03-30 14:09:17 +0200
committerLukas Rytz <lukas.rytz@gmail.com>2015-04-01 08:35:31 +0200
commiteb43d62b4e0665b6b509a04d4ec2edae53c9256b (patch)
tree82fe27c673a81797489046bbf9afc98b7c971341 /test
parentfa110edd473ac5bbdb66fbd5a51fa2685c0dcf21 (diff)
downloadscala-eb43d62b4e0665b6b509a04d4ec2edae53c9256b.tar.gz
scala-eb43d62b4e0665b6b509a04d4ec2edae53c9256b.tar.bz2
scala-eb43d62b4e0665b6b509a04d4ec2edae53c9256b.zip
Don't try to inline native methods
Because you can't, really.
Diffstat (limited to 'test')
-rw-r--r--test/junit/scala/tools/nsc/backend/jvm/opt/InlinerTest.scala11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/junit/scala/tools/nsc/backend/jvm/opt/InlinerTest.scala b/test/junit/scala/tools/nsc/backend/jvm/opt/InlinerTest.scala
index 9d23d92c2a..d113598ce5 100644
--- a/test/junit/scala/tools/nsc/backend/jvm/opt/InlinerTest.scala
+++ b/test/junit/scala/tools/nsc/backend/jvm/opt/InlinerTest.scala
@@ -952,6 +952,17 @@ class InlinerTest extends ClearAfterClass {
}
@Test
+ def dontInlineNative(): Unit = {
+ val code =
+ """class C {
+ | def t = System.arraycopy(null, 0, null, 0, 0)
+ |}
+ """.stripMargin
+ val List(c) = compileClasses(newCompiler(extraArgs = InlinerTest.args + " -Yopt-inline-heuristics:everything"))(code)
+ assertInvoke(getSingleMethod(c, "t"), "java/lang/System", "arraycopy")
+ }
+
+ @Test
def inlineMayRenderCodeDead(): Unit = {
val code =
"""class C {