* tests/regression/jasmin/test_verify_ok_jsr_handler_in_sub.j:
authoredwin <none@none>
Mon, 11 Sep 2006 14:59:52 +0000 (14:59 +0000)
committeredwin <none@none>
Mon, 11 Sep 2006 14:59:52 +0000 (14:59 +0000)
New test.
* tests/regression/jasmin/test_verify_ok_jsr_exceptions.j: Likewise.
* tests/regression/jasmin/test_verify_ok_jsr_through_variable.j:
Likewise.
* tests/regression/jasmin/test_verify_ok_jsr_handler_in_sub2.j:
Likewise.
* tests/regression/jasmin/test_verify_ok_jsr_swap.j: Likewise.

--HG--
branch : unified_variables

tests/regression/jasmin/test_verify_ok_jsr_exceptions.j [new file with mode: 0644]
tests/regression/jasmin/test_verify_ok_jsr_handler_in_sub.j [new file with mode: 0644]
tests/regression/jasmin/test_verify_ok_jsr_handler_in_sub2.j [new file with mode: 0644]
tests/regression/jasmin/test_verify_ok_jsr_swap.j [new file with mode: 0644]
tests/regression/jasmin/test_verify_ok_jsr_through_variable.j [new file with mode: 0644]

diff --git a/tests/regression/jasmin/test_verify_ok_jsr_exceptions.j b/tests/regression/jasmin/test_verify_ok_jsr_exceptions.j
new file mode 100644 (file)
index 0000000..d5f1429
--- /dev/null
@@ -0,0 +1,82 @@
+.class public test_verify_ok_jsr_exceptions
+.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 3
+
+       .catch java/lang/Exception from test_start to test_end using handler
+
+       ldc 35
+       istore 1
+
+       aload 0
+       ifnull force_basic_block_boundary
+
+       ; --------------------------------------------------
+       jsr sbr_1
+       ldc 111
+       invokestatic test_verify_ok_jsr_exceptions/checkI(I)V
+       return
+
+continue_1:
+       jsr sbr_2
+       ldc 222
+       invokestatic test_verify_ok_jsr_exceptions/checkI(I)V
+       return
+
+test_start:
+continue_2:
+       astore 1
+       ldc 2
+       ldc 0
+       idiv
+       pop
+
+       astore 1
+       ldc 2
+       ldc 0
+       idiv
+       pop
+       return
+
+test_end:
+       ; --------------------------------------------------
+
+force_basic_block_boundary:
+
+       return
+       
+sbr_1:
+       goto continue_1
+
+sbr_2:
+       goto continue_2
+
+handler:
+       pop
+       ret 1
+
+.end method
+
diff --git a/tests/regression/jasmin/test_verify_ok_jsr_handler_in_sub.j b/tests/regression/jasmin/test_verify_ok_jsr_handler_in_sub.j
new file mode 100644 (file)
index 0000000..48de7b5
--- /dev/null
@@ -0,0 +1,69 @@
+.class public test_verify_ok_jsr_handler_in_sub
+.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 2
+       .limit locals 3
+
+       .catch java/lang/Exception from test_start to test_end using handler
+
+       ldc 35
+       istore 1
+
+       aload 0
+       ifnull force_basic_block_boundary
+
+       ; --------------------------------------------------
+
+       jsr sbr_1
+       ; OUTPUT: 48
+       iload 1
+       invokestatic test_verify_ok_jsr_handler_in_sub/checkI(I)V
+       ; OUTPUT: 35
+
+       ; --------------------------------------------------
+
+force_basic_block_boundary:
+
+       return
+       
+sbr_1:
+test_start:
+       astore 2
+       ldc 2
+       ldc 0
+       idiv
+       pop
+       ldc 666
+       invokestatic test_verify_ok_jsr_handler_in_sub/checkI(I)V
+       return
+test_end:
+
+handler:
+       pop
+       ldc 48
+       invokestatic test_verify_ok_jsr_handler_in_sub/checkI(I)V
+       ret 2
+
+.end method
diff --git a/tests/regression/jasmin/test_verify_ok_jsr_handler_in_sub2.j b/tests/regression/jasmin/test_verify_ok_jsr_handler_in_sub2.j
new file mode 100644 (file)
index 0000000..d21107f
--- /dev/null
@@ -0,0 +1,69 @@
+.class public test_verify_ok_jsr_handler_in_sub2
+.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 2
+       .limit locals 3
+
+       .catch java/lang/Exception from test_start to test_end using handler
+
+       ldc 35
+       istore 1
+
+       aload 0
+       ifnull force_basic_block_boundary
+
+       ; --------------------------------------------------
+
+       jsr sbr_1
+       ; OUTPUT: 48
+       iload 1
+       invokestatic test_verify_ok_jsr_handler_in_sub2/checkI(I)V
+       ; OUTPUT: 35
+
+       ; --------------------------------------------------
+
+force_basic_block_boundary:
+
+       return
+       
+sbr_1:
+       astore 2
+       ldc 2
+       ldc 0
+test_start:
+       idiv
+test_end:
+       pop
+       ldc 666
+       invokestatic test_verify_ok_jsr_handler_in_sub2/checkI(I)V
+       return
+
+handler:
+       pop
+       ldc 48
+       invokestatic test_verify_ok_jsr_handler_in_sub2/checkI(I)V
+       ret 2
+
+.end method
diff --git a/tests/regression/jasmin/test_verify_ok_jsr_swap.j b/tests/regression/jasmin/test_verify_ok_jsr_swap.j
new file mode 100644 (file)
index 0000000..0d1b574
--- /dev/null
@@ -0,0 +1,55 @@
+.class public test_verify_ok_jsr_swap
+.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 2
+       .limit locals 3
+
+       ldc 35
+       istore 1
+
+       aload 0
+       ifnull force_basic_block_boundary
+
+       ; --------------------------------------------------
+
+       ldc 796
+       jsr sbr_1
+       iload 1
+       invokestatic test_verify_ok_jsr_swap/checkI(I)V
+       ; OUTPUT: 796
+
+       ; --------------------------------------------------
+
+force_basic_block_boundary:
+
+       return
+       
+sbr_1:
+       swap
+       istore 1
+       astore 2
+       ret 2
+
+.end method
diff --git a/tests/regression/jasmin/test_verify_ok_jsr_through_variable.j b/tests/regression/jasmin/test_verify_ok_jsr_through_variable.j
new file mode 100644 (file)
index 0000000..26d773c
--- /dev/null
@@ -0,0 +1,74 @@
+.class public test_verify_ok_jsr_through_variable
+.super java/lang/Object
+
+; ======================================================================
+
+.method public <init>()V
+   aload_0
+   invokenonvirtual java/lang/Object/<init>()V
+   return
+.end method
+
+; ======================================================================
+
+.method public static check(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 check(J)V
+       .limit locals 2
+       .limit stack 10
+       getstatic java/lang/System/out Ljava/io/PrintStream;
+       lload_0
+       invokevirtual java/io/PrintStream/println(J)V
+       return
+.end method
+
+; ======================================================================
+
+.method public static main([Ljava/lang/String;)V
+       .limit stack 2
+       .limit locals 6
+
+       ldc 35
+       istore 1
+
+       aload 0
+       ifnull force_basic_block_boundary
+
+       ; --------------------------------------------------
+
+       ldc 56
+       istore 3
+       jsr sbr_1
+       ; OUTPUT: 35
+       iload 3
+       invokestatic test_verify_ok_jsr_through_variable/check(I)V
+       ; OUTPUT: 56
+
+       ldc2_w 123456789123456789
+       lstore 2
+       jsr sbr_1
+       ; OUTPUT: 35
+       lload 2
+       invokestatic test_verify_ok_jsr_through_variable/check(J)V
+       ; OUTPUT: 123456789123456789
+
+       ; --------------------------------------------------
+
+force_basic_block_boundary:
+
+       return
+       
+sbr_1:
+       astore 5
+       iload 1
+       invokestatic test_verify_ok_jsr_through_variable/check(I)V
+       ret 5
+
+.end method