summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorLukas Rytz <lukas.rytz@typesafe.com>2016-08-15 10:42:31 +0200
committerGitHub <noreply@github.com>2016-08-15 10:42:31 +0200
commit91346c541474adb605050aa672ddc6007ef971e3 (patch)
treea9eeb78c293dc4e3e09aca906d9de4945652464e /test
parent99f8b285e5533c95b7e80bdf670f594b01328f70 (diff)
parent40f7fce0af1da614d99048b024e1ff579635f0f2 (diff)
downloadscala-91346c541474adb605050aa672ddc6007ef971e3.tar.gz
scala-91346c541474adb605050aa672ddc6007ef971e3.tar.bz2
scala-91346c541474adb605050aa672ddc6007ef971e3.zip
Merge pull request #5317 from retronym/ticket/SD-192
SD-192 Change scheme for trait super accessors
Diffstat (limited to 'test')
-rw-r--r--test/junit/scala/collection/mutable/OpenHashMapTest.scala2
-rw-r--r--test/junit/scala/tools/nsc/backend/jvm/BytecodeTest.scala6
-rw-r--r--test/junit/scala/tools/nsc/backend/jvm/opt/InlinerSeparateCompilationTest.scala4
-rw-r--r--test/junit/scala/tools/nsc/backend/jvm/opt/InlinerTest.scala14
4 files changed, 13 insertions, 13 deletions
diff --git a/test/junit/scala/collection/mutable/OpenHashMapTest.scala b/test/junit/scala/collection/mutable/OpenHashMapTest.scala
index b6cddf2101..90f6be6ee5 100644
--- a/test/junit/scala/collection/mutable/OpenHashMapTest.scala
+++ b/test/junit/scala/collection/mutable/OpenHashMapTest.scala
@@ -1,6 +1,6 @@
package scala.collection.mutable
-import org.junit.Test
+import org.junit.{Ignore, Test}
import org.junit.Assert._
import org.junit.runner.RunWith
import org.junit.runners.JUnit4
diff --git a/test/junit/scala/tools/nsc/backend/jvm/BytecodeTest.scala b/test/junit/scala/tools/nsc/backend/jvm/BytecodeTest.scala
index 5904cb2441..b09a41969e 100644
--- a/test/junit/scala/tools/nsc/backend/jvm/BytecodeTest.scala
+++ b/test/junit/scala/tools/nsc/backend/jvm/BytecodeTest.scala
@@ -169,7 +169,7 @@ class BytecodeTest extends BytecodeTesting {
assertEquals(x.end, labels(7))
}
- @Test // wrong line numbers for rewritten `this` references in trait static methods
+ @Test
def sd186_traitLineNumber(): Unit = {
val code =
"""trait T {
@@ -182,9 +182,9 @@ class BytecodeTest extends BytecodeTesting {
val t = compileClass(code)
val tMethod = getMethod(t, "t$")
val invoke = Invoke(INVOKEVIRTUAL, "java/lang/Object", "toString", "()Ljava/lang/String;", false)
+ // ths static accessor is positioned at the line number of the accessed method.
assertSameCode(tMethod.instructions,
- List(Label(0), LineNumber(3, Label(0)), VarOp(ALOAD, 0), invoke, Op(POP),
- Label(5), LineNumber(4, Label(5)), VarOp(ALOAD, 0), invoke, Op(POP), Op(RETURN), Label(11))
+ List(Label(0), LineNumber(2, Label(0)), VarOp(ALOAD, 0), Invoke(INVOKESPECIAL, "T", "t", "()V", true), Op(RETURN), Label(4))
)
}
}
diff --git a/test/junit/scala/tools/nsc/backend/jvm/opt/InlinerSeparateCompilationTest.scala b/test/junit/scala/tools/nsc/backend/jvm/opt/InlinerSeparateCompilationTest.scala
index 85df42e069..a2513cacdc 100644
--- a/test/junit/scala/tools/nsc/backend/jvm/opt/InlinerSeparateCompilationTest.scala
+++ b/test/junit/scala/tools/nsc/backend/jvm/opt/InlinerSeparateCompilationTest.scala
@@ -97,7 +97,7 @@ class InlinerSeparateCompilationTest {
""".stripMargin
val List(a, t) = compileClassesSeparately(List(codeA, assembly), args)
- assertNoInvoke(getMethod(t, "f$"))
- assertNoInvoke(getMethod(a, "n$"))
+ assertNoInvoke(getMethod(t, "f"))
+ assertNoInvoke(getMethod(a, "n"))
}
}
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 539c66a0d5..29a23df784 100644
--- a/test/junit/scala/tools/nsc/backend/jvm/opt/InlinerTest.scala
+++ b/test/junit/scala/tools/nsc/backend/jvm/opt/InlinerTest.scala
@@ -518,7 +518,7 @@ class InlinerTest extends BytecodeTesting {
val List(c, oMirror, oModule, t) = compile(code, allowMessage = i => {count += 1; i.msg contains warn})
assert(count == 1, count)
- assertNoInvoke(getMethod(t, "f$"))
+ assertNoInvoke(getMethod(t, "f"))
assertNoInvoke(getMethod(c, "t1"))
assertNoInvoke(getMethod(c, "t2"))
@@ -544,9 +544,9 @@ class InlinerTest extends BytecodeTesting {
val List(assembly, c, t) = compile(code)
- assertNoInvoke(getMethod(t, "f$"))
+ assertNoInvoke(getMethod(t, "f"))
- assertNoInvoke(getMethod(assembly, "n$"))
+ assertNoInvoke(getMethod(assembly, "n"))
assertNoInvoke(getMethod(c, "t1"))
assertNoInvoke(getMethod(c, "t2"))
@@ -622,8 +622,8 @@ class InlinerTest extends BytecodeTesting {
val List(ca, cb, t1, t2a, t2b) = compile(code, allowMessage = i => {count += 1; i.msg contains warning})
assert(count == 4, count) // see comments, f is not inlined 4 times
- assertNoInvoke(getMethod(t2a, "g2a$"))
- assertInvoke(getMethod(t2b, "g2b$"), "T1", "f")
+ assertNoInvoke(getMethod(t2a, "g2a"))
+ assertInvoke(getMethod(t2b, "g2b"), "T1", "f")
assertInvoke(getMethod(ca, "m1a"), "T1", "f")
assertNoInvoke(getMethod(ca, "m2a")) // no invoke, see comment on def g2a
@@ -682,8 +682,8 @@ class InlinerTest extends BytecodeTesting {
|}
""".stripMargin
val List(c, t) = compile(code)
- val t1 = getMethod(t, "t1$")
- val t2 = getMethod(t, "t2$")
+ val t1 = getMethod(t, "t1")
+ val t2 = getMethod(t, "t2")
val cast = TypeOp(CHECKCAST, "C")
Set(t1, t2).foreach(m => assert(m.instructions.contains(cast), m.instructions))
}