diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2013-09-17 15:52:45 +0200 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2013-09-17 16:03:57 +0200 |
commit | 4faaa82910940ffd5eaf0b853ec041176ec7fd0d (patch) | |
tree | f83b084f98c1d24d0b5fde000f39b6967daa1c6a /test | |
parent | 9fee7b6a2ac8663b0608b85001259320e1409a04 (diff) | |
download | scala-4faaa82910940ffd5eaf0b853ec041176ec7fd0d.tar.gz scala-4faaa82910940ffd5eaf0b853ec041176ec7fd0d.tar.bz2 scala-4faaa82910940ffd5eaf0b853ec041176ec7fd0d.zip |
SI-7852 Test to show status quo of for SomeModule.==
For which we can also elide the null check, and will in the
next commit.
Diffstat (limited to 'test')
-rw-r--r-- | test/files/run/t7852.check | 34 | ||||
-rw-r--r-- | test/files/run/t7852.scala | 21 |
2 files changed, 48 insertions, 7 deletions
diff --git a/test/files/run/t7852.check b/test/files/run/t7852.check index 008639075a..648f464aa2 100644 --- a/test/files/run/t7852.check +++ b/test/files/run/t7852.check @@ -1,4 +1,4 @@ -class scala.tools.asm.tree.MethodNode +string LDC "" ALOAD 0 INVOKEVIRTUAL java/lang/Object.toString ()Ljava/lang/String; @@ -16,3 +16,35 @@ class scala.tools.asm.tree.MethodNode MAXSTACK = 2 MAXLOCALS = 1 + +module + GETSTATIC scala/collection/immutable/Nil$.MODULE$ : Lscala/collection/immutable/Nil$; + 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] [scala/collection/immutable/Nil$] + 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.scala b/test/files/run/t7852.scala index eed211c7bc..3c930fbbc1 100644 --- a/test/files/run/t7852.scala +++ b/test/files/run/t7852.scala @@ -5,16 +5,25 @@ 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))) + def showMethod(name: String) { + val meth = getMethod(classNode, name) + println(name) + val textifier = new Textifier() + meth.accept(new TraceMethodVisitor(textifier)) + println(stringFromWriter(w => textifier.print(w))) + println() + } + showMethod("string") + showMethod("module") } } class Lean { - def foo { + def string { "" == toString } + + def module { + Nil == (toString: Any) + } } |