Fixes PR80.
[cacao.git] / tests / regression / jasmin / test_verify_ok_jsr_subroutine_loops_to_start.j
1 .class public test_verify_ok_jsr_subroutine_loops_to_start
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 check(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 2
27         .limit locals 3
28
29         iconst_0
30         istore 1
31
32         aload 0
33         ifnull force_basic_block_boundary
34
35         ; --------------------------------------------------
36
37         jsr sbr_1
38         ; OUTPUT: 111
39         ; OUTPUT: 222
40
41         ; --------------------------------------------------
42
43 force_basic_block_boundary:
44
45         iload 1
46         invokestatic test_verify_ok_jsr_subroutine_loops_to_start/check(I)V
47         ; OUTPUT: 1
48
49         return
50
51 sbr_1:
52         dup
53         astore 2
54
55         iload 1
56         ifeq first_time
57
58 second_time:
59         pop
60         ldc 222
61         invokestatic test_verify_ok_jsr_subroutine_loops_to_start/check(I)V
62         ret 2
63
64 first_time:
65         ldc 111
66         invokestatic test_verify_ok_jsr_subroutine_loops_to_start/check(I)V
67         iinc 1 1
68         goto sbr_1
69
70 .end method
71