* tests/regression/jasmin/test_dup_x1_interface_slots.j: New test.
authoredwin <none@none>
Fri, 15 Sep 2006 16:39:34 +0000 (16:39 +0000)
committeredwin <none@none>
Fri, 15 Sep 2006 16:39:34 +0000 (16:39 +0000)
* tests/regression/jasmin/test_dup2_x1.j: Added dup2_x1 with
interface slots.
* tests/regression/jasmin/Makefile.am: Added new test.

--HG--
branch : unified_variables

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

index 02541c74c3fb58565dc8ce3bce9b198d5cbc4c52..c5eff33e50b9948cd521b2e15d5699b35fdfb605 100644 (file)
@@ -42,6 +42,7 @@ JASMIN_TESTS = \
        $(srcdir)/test_dup2_x2.j \
        $(srcdir)/test_dup.j \
        $(srcdir)/test_dup_x1.j \
+       $(srcdir)/test_dup_x1_interface_slots.j \
        $(srcdir)/test_dup_x2.j \
        $(srcdir)/test_dup_x2_to_dup_x1.j \
        $(srcdir)/test.j \
index a6f178ef8b210441575626cceb2e3430bcea7225..b1a30e4a4c1a252be26dc3eefc6ee5e5e622c12b 100644 (file)
 ; ======================================================================
 
 .method public static main([Ljava/lang/String;)V
-       .limit stack 5
+       .limit stack 6
        .limit locals 2
 
        ldc 35
        istore 1
 
+       ldc 1032
+       ldc 1091
+       ldc 1047
+
        aload 0
        ifnull force_basic_block_boundary
 
        ; --------------------------------------------------
 
+       dup2_x1 ; 1091 1047 1032 1091 1047
+
+       aload 0
+       ifnull force_basic_block_boundary2
+
+       ; --------------------------------------------------
+
+       isub
+       invokestatic test_dup2_x1/checkI(I)V
+       ; OUTPUT: 44
+       isub
+       invokestatic test_dup2_x1/checkI(I)V
+       ; OUTPUT:  15
+       invokestatic test_dup2_x1/checkI(I)V
+       ; OUTPUT:  1091
+
        ldc 32
        ldc 91
        ldc 47
        invokestatic test_dup2_x1/checkI(I)V
        ; OUTPUT:  91
 
+       return
+
        ; --------------------------------------------------
 
 force_basic_block_boundary:
+       return
 
+force_basic_block_boundary2:
        return
+
 .end method
diff --git a/tests/regression/jasmin/test_dup_x1_interface_slots.j b/tests/regression/jasmin/test_dup_x1_interface_slots.j
new file mode 100644 (file)
index 0000000..7c62428
--- /dev/null
@@ -0,0 +1,73 @@
+.class public test_dup_x1_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 3
+       .limit locals 2
+
+       ldc 4
+       istore 1
+
+       ldc 18
+       ldc 100
+
+       ; --------------------------------------------------
+
+loop:
+       dup_x1
+       iinc 1 -1
+       pop
+       iload 1
+       ifge loop
+
+       ; --------------------------------------------------
+
+       invokestatic test_dup_x1_interface_slots/checkI(I)V
+       ; OUTPUT: 18
+       invokestatic test_dup_x1_interface_slots/checkI(I)V
+       ; OUTPUT: 100
+
+       ldc 7
+       istore 1
+
+       ldc 28
+       ldc 200
+
+       ; --------------------------------------------------
+
+loop2:
+       iinc 1 -1
+       swap
+       iload 1
+       ifge loop2
+
+       ; --------------------------------------------------
+
+       invokestatic test_dup_x1_interface_slots/checkI(I)V
+       ; OUTPUT: 200
+       invokestatic test_dup_x1_interface_slots/checkI(I)V
+       ; OUTPUT: 28
+
+       return
+.end method