diff options
author | Lukas Rytz <lukas.rytz@gmail.com> | 2015-03-31 20:02:28 +0200 |
---|---|---|
committer | Lukas Rytz <lukas.rytz@gmail.com> | 2015-04-01 08:35:33 +0200 |
commit | 6becefe90690ae025308b00e0fd7e46646b4f961 (patch) | |
tree | ab8b46bd1354d8a8fbe2616bc29c837dfe804196 /test/junit | |
parent | a5dc9b7913c113ffd15b1f23cba2a4a710546cd8 (diff) | |
download | scala-6becefe90690ae025308b00e0fd7e46646b4f961.tar.gz scala-6becefe90690ae025308b00e0fd7e46646b4f961.tar.bz2 scala-6becefe90690ae025308b00e0fd7e46646b4f961.zip |
SI-9139 don't inline across @strictfp modes
Cannot inline if one of the methods is @strictfp, but not the other.
Diffstat (limited to 'test/junit')
-rw-r--r-- | test/junit/scala/tools/nsc/backend/jvm/opt/InlineWarningTest.scala | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/junit/scala/tools/nsc/backend/jvm/opt/InlineWarningTest.scala b/test/junit/scala/tools/nsc/backend/jvm/opt/InlineWarningTest.scala index 5b47475863..029caa995c 100644 --- a/test/junit/scala/tools/nsc/backend/jvm/opt/InlineWarningTest.scala +++ b/test/junit/scala/tools/nsc/backend/jvm/opt/InlineWarningTest.scala @@ -170,4 +170,25 @@ class InlineWarningTest extends ClearAfterClass { compile(code, allowMessage = i => { c += 1; i.msg contains warn }) assert(c == 1, c) } + + @Test + def cannotMixStrictfp(): Unit = { + val code = + """import annotation.strictfp + |class C { + | @strictfp @inline final def f = 0 + | @strictfp def t1 = f + | def t2 = f + |} + """.stripMargin + + val warn = + """C::f()I is annotated @inline but could not be inlined: + |The callsite method C::t2()I + |does not have the same strictfp mode as the callee C::f()I.""".stripMargin + + var c = 0 + compile(code, allowMessage = i => { c += 1; i.msg contains warn }) + assert(c == 1, c) + } } |