* tests/regression/jasmin/Makefile.am: Added new test.
authoredwin <none@none>
Fri, 15 Sep 2006 16:55:46 +0000 (16:55 +0000)
committeredwin <none@none>
Fri, 15 Sep 2006 16:55:46 +0000 (16:55 +0000)
* tests/regression/jasmin/test_dup_x2_interface_slots.j: New test.
* tests/regression/jasmin/test_dup_x1_interface_slots.j: Changed
second loop to also use DUP_X1.

--HG--
branch : unified_variables

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

index c5eff33e50b9948cd521b2e15d5699b35fdfb605..bf4006908291056ce17ae847974b56c5f9668a44 100644 (file)
@@ -44,6 +44,7 @@ JASMIN_TESTS = \
        $(srcdir)/test_dup_x1.j \
        $(srcdir)/test_dup_x1_interface_slots.j \
        $(srcdir)/test_dup_x2.j \
+       $(srcdir)/test_dup_x2_interface_slots.j \
        $(srcdir)/test_dup_x2_to_dup_x1.j \
        $(srcdir)/test.j \
        $(srcdir)/test_load_store_conflict_by_exception.j \
index 7c624280f278906b36636a60a3d83839127d5879..cb170dd69357c3a150545860747b3d890999f1c7 100644 (file)
@@ -58,7 +58,8 @@ loop:
 
 loop2:
        iinc 1 -1
-       swap
+       dup_x1
+       pop
        iload 1
        ifge loop2
 
diff --git a/tests/regression/jasmin/test_dup_x2_interface_slots.j b/tests/regression/jasmin/test_dup_x2_interface_slots.j
new file mode 100644 (file)
index 0000000..78d770f
--- /dev/null
@@ -0,0 +1,91 @@
+.class public test_dup_x2_interface_slots
+.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 main([Ljava/lang/String;)V
+       .limit stack 4
+       .limit locals 2
+
+       ldc 4
+       istore 1
+
+       ldc 18
+       ldc 100
+       ldc 91
+
+       ; stack is 18 100 91 (top)
+
+       ; --------------------------------------------------
+
+       ; "ROT3" performed 5 times
+loop:
+       dup_x2
+       iinc 1 -1
+       pop
+       iload 1
+       ifge loop
+
+       ; --------------------------------------------------
+
+       ; stack should be 100 91 18 (top)
+
+       invokestatic test_dup_x2_interface_slots/checkI(I)V
+       ; OUTPUT: 18
+       invokestatic test_dup_x2_interface_slots/checkI(I)V
+       ; OUTPUT: 91
+       invokestatic test_dup_x2_interface_slots/checkI(I)V
+       ; OUTPUT: 100
+
+       ldc 6
+       istore 1
+
+       ldc 28
+       ldc 200
+       ldc 291
+
+       ; stack is 28 200 291 (top)
+
+       ; --------------------------------------------------
+
+       ; "ROT3" performed 7 times
+loop2:
+       iinc 1 -1
+       dup_x2
+       pop
+       iload 1
+       ifge loop2
+
+       ; --------------------------------------------------
+
+       ; stack should be 291 28 200
+
+       invokestatic test_dup_x2_interface_slots/checkI(I)V
+       ; OUTPUT: 200
+       invokestatic test_dup_x2_interface_slots/checkI(I)V
+       ; OUTPUT: 28
+       invokestatic test_dup_x2_interface_slots/checkI(I)V
+       ; OUTPUT: 291
+
+       return
+.end method
+