* src/vm/jit/cfg.c (cfg_build): Fixed a bug causing infinite loops.
[cacao.git] / tests / regression / jasmin / test_verify_fail_jsr_exceptions.j
1 .class public test_verify_fail_jsr_exceptions
2 .super java/lang/Object
3
4 ; ======================================================================
5
6 .method public <init>()V
7    aload_0
8    invokenonvirtual java/lang/Object/<init>()V
9    return
10 .end method
11
12 ; ======================================================================
13
14 .method public static checkI(I)V
15         .limit locals 1
16         .limit stack 10
17         getstatic java/lang/System/out Ljava/io/PrintStream;
18         iload_0
19         invokevirtual java/io/PrintStream/println(I)V
20         return
21 .end method
22
23 ; ======================================================================
24
25 .method public static main([Ljava/lang/String;)V
26         .limit stack 3
27         .limit locals 3
28
29         .catch java/lang/Exception from test_start to test_end using handler
30
31         ldc 35
32         istore 1
33
34         aload 0
35         ifnull force_basic_block_boundary
36
37         ; --------------------------------------------------
38         jsr sbr_1
39         ldc 111
40         invokestatic test_verify_fail_jsr_exceptions/checkI(I)V
41         return
42
43 continue_1:
44         jsr sbr_2
45         ldc 222
46         invokestatic test_verify_fail_jsr_exceptions/checkI(I)V
47         return
48
49 test_start:
50 continue_2:
51
52 ; ERROR: VerifyError
53 ; This fails, because the "astore 1" is _after_ the exception range boundary
54
55         astore 1
56         ldc 2
57         ldc 0
58         idiv
59         pop
60
61         astore 1
62         ldc 2
63         ldc 0
64         idiv
65         pop
66         return
67
68 test_end:
69         ; --------------------------------------------------
70
71 force_basic_block_boundary:
72
73         return
74         
75 sbr_1:
76         goto continue_1
77
78 sbr_2:
79         goto continue_2
80
81 handler:
82         pop
83         ret 1
84
85 .end method
86