* tests/regression/jasmin/test_load_store_conflict_different_types.j:
authorEdwin Steiner <edwin.steiner@gmx.net>
Sat, 29 Mar 2008 15:09:30 +0000 (16:09 +0100)
committerEdwin Steiner <edwin.steiner@gmx.net>
Sat, 29 Mar 2008 15:09:30 +0000 (16:09 +0100)
New test exposing the bug in conflict checking for local variables
([Bug 49] VerifyError with obfuscated classes).

* tests/regression/jasmin/Makefile.am: Added new test.

tests/regression/jasmin/Makefile.am
tests/regression/jasmin/test_load_store_conflict_different_types.j [new file with mode: 0644]

index 24daa08f72d2d366e3014abf3538940745013870..5672843bef00c7dc55625806748d0a9dd13cd48b 100644 (file)
@@ -40,6 +40,7 @@ JASMIN_TESTS = \
        $(srcdir)/test_iinc.j \
        $(srcdir)/test_load_store_conflict_by_exception.j \
        $(srcdir)/test_load_store_conflict_by_exception_not_thrown.j \
+       $(srcdir)/test_load_store_conflict_different_types.j \
        $(srcdir)/test_load_store_conflict.j \
        $(srcdir)/test_load_store_conflict_via_dup.j \
        $(srcdir)/test_load_store_conflict_via_swap.j \
diff --git a/tests/regression/jasmin/test_load_store_conflict_different_types.j b/tests/regression/jasmin/test_load_store_conflict_different_types.j
new file mode 100644 (file)
index 0000000..57a04ff
--- /dev/null
@@ -0,0 +1,66 @@
+.class public test_load_store_conflict_different_types
+.super java/lang/Object
+
+; ======================================================================
+
+.method public <init>()V
+   aload_0
+   invokenonvirtual java/lang/Object/<init>()V
+   return
+.end method
+
+; ======================================================================
+
+.method public static checkI(I)V
+       .limit locals 1
+       .limit stack 10
+       getstatic java/lang/System/out Ljava/io/PrintStream;
+       iload_0
+       invokevirtual java/io/PrintStream/println(I)V
+       return
+.end method
+
+.method public static checkString(Ljava/lang/String;)V
+       .limit locals 1
+       .limit stack 10
+       getstatic java/lang/System/out Ljava/io/PrintStream;
+       aload_0
+       invokevirtual java/io/PrintStream/println(Ljava/lang/String;)V
+       return
+.end method
+
+; ======================================================================
+
+.method public static main([Ljava/lang/String;)V
+       .limit stack 3
+       .limit locals 3
+
+       ldc 35
+       istore 1
+    ldc 42
+    istore 2
+
+       aload 0
+       ifnull force_basic_block_boundary
+
+       ; --------------------------------------------------
+
+       iload 1  ; loads 35
+       ldc "Sepp"
+       astore 1
+       istore 2 ; stores 35
+
+       ; --------------------------------------------------
+
+       aload 1
+       invokestatic test_load_store_conflict_different_types/checkString(Ljava/lang/String;)V
+       ; OUTPUT: Sepp
+
+       iload 2
+       invokestatic test_load_store_conflict_different_types/checkI(I)V
+       ; OUTPUT: 35
+
+force_basic_block_boundary:
+
+       return
+.end method