summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/files/run/t7852.check30
-rw-r--r--test/files/run/t7852.flags1
-rw-r--r--test/files/run/t7852.scala20
3 files changed, 51 insertions, 0 deletions
diff --git a/test/files/run/t7852.check b/test/files/run/t7852.check
new file mode 100644
index 0000000000..fdced88fa8
--- /dev/null
+++ b/test/files/run/t7852.check
@@ -0,0 +1,30 @@
+class scala.tools.asm.tree.MethodNode
+ LDC ""
+ ALOAD 0
+ INVOKEVIRTUAL java/lang/Object.toString ()Ljava/lang/String;
+ ASTORE 1
+ DUP
+ IFNONNULL L0
+ POP
+ ALOAD 1
+ IFNULL L1
+ GOTO L2
+ L0
+ FRAME FULL [Lean java/lang/String] [java/lang/String]
+ ALOAD 1
+ INVOKEVIRTUAL java/lang/Object.equals (Ljava/lang/Object;)Z
+ IFEQ L2
+ L1
+ FRAME SAME
+ ICONST_1
+ GOTO L3
+ L2
+ FRAME SAME
+ ICONST_0
+ L3
+ FRAME SAME1 I
+ POP
+ RETURN
+ MAXSTACK = 2
+ MAXLOCALS = 2
+
diff --git a/test/files/run/t7852.flags b/test/files/run/t7852.flags
new file mode 100644
index 0000000000..f6262fd3e0
--- /dev/null
+++ b/test/files/run/t7852.flags
@@ -0,0 +1 @@
+-Ynooptimise
diff --git a/test/files/run/t7852.scala b/test/files/run/t7852.scala
new file mode 100644
index 0000000000..eed211c7bc
--- /dev/null
+++ b/test/files/run/t7852.scala
@@ -0,0 +1,20 @@
+import scala.tools.partest.BytecodeTest
+import scala.tools.asm.util._
+import scala.tools.nsc.util.stringFromWriter
+
+object Test extends BytecodeTest {
+ def show {
+ val classNode = loadClassNode("Lean")
+ val meth = getMethod(classNode, "foo")
+ println(meth.getClass)
+ val textifier = new Textifier()
+ meth.accept(new TraceMethodVisitor(textifier))
+ println(stringFromWriter(w => textifier.print(w)))
+ }
+}
+
+class Lean {
+ def foo {
+ "" == toString
+ }
+}