Checked in jasmin tests.
[cacao.git] / tests / regression / jasmin / test_load_store_conflict_by_exception.j
1 .class public test_load_store_conflict_by_exception
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         ldc 777
34         istore 2
35
36         aload 0
37         ifnull force_basic_block_boundary
38
39         ; --------------------------------------------------
40
41 test_start:
42         ldc 42
43         aload 0
44         ldc 1
45         aaload     ; may throw
46         pop
47         istore 1
48 test_end:
49
50         ; --------------------------------------------------
51
52 force_basic_block_boundary:
53
54         iload 1
55         invokestatic test_load_store_conflict_by_exception/checkI(I)V
56
57         iload 2
58         invokestatic test_load_store_conflict_by_exception/checkI(I)V
59         
60         return
61
62 handler:
63         pop
64
65         ; output magic number to show we reached the handler
66         ldc 88888
67         invokestatic test_load_store_conflict_by_exception/checkI(I)V
68         ; OUTPUT: 88888
69
70         iload 1
71         invokestatic test_load_store_conflict_by_exception/checkI(I)V
72         ; OUTPUT: 35
73
74         iload 2
75         invokestatic test_load_store_conflict_by_exception/checkI(I)V
76         ; OUTPUT: 777
77
78         return
79 .end method
80