From: Edwin Steiner Date: Sat, 29 Mar 2008 15:09:30 +0000 (+0100) Subject: * tests/regression/jasmin/test_load_store_conflict_different_types.j: X-Git-Url: http://wien.tomnetworks.com/gitweb/?p=cacao.git;a=commitdiff_plain;h=278cf7d9bacdbc2cfd97b8fd48f497450d2141cc * tests/regression/jasmin/test_load_store_conflict_different_types.j: 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. --- diff --git a/tests/regression/jasmin/Makefile.am b/tests/regression/jasmin/Makefile.am index 24daa08f7..5672843be 100644 --- a/tests/regression/jasmin/Makefile.am +++ b/tests/regression/jasmin/Makefile.am @@ -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 index 000000000..57a04ff0b --- /dev/null +++ b/tests/regression/jasmin/test_load_store_conflict_different_types.j @@ -0,0 +1,66 @@ +.class public test_load_store_conflict_different_types +.super java/lang/Object + +; ====================================================================== + +.method public ()V + aload_0 + invokenonvirtual java/lang/Object/()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