* configure.ac: New switch for disabling -O2 (--disable-optimizations).
[cacao.git] / tests / regression / jasmin / test_load_store_conflict_by_exception_not_thrown.j
1 .class public test_load_store_conflict_by_exception_not_thrown
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         arraylength    ; may throw, but does not in this case
45         pop
46         istore 1
47 test_end:
48
49         ; --------------------------------------------------
50
51 force_basic_block_boundary:
52
53         iload 1
54         invokestatic test_load_store_conflict_by_exception_not_thrown/checkI(I)V
55         ; OUTPUT: 42
56
57         iload 2
58         invokestatic test_load_store_conflict_by_exception_not_thrown/checkI(I)V
59         ; OUTPUT: 777
60         
61         return
62
63 handler:
64         pop
65
66         ; output magic number to show we reached the handler
67         ldc 88888
68         invokestatic test_load_store_conflict_by_exception_not_thrown/checkI(I)V
69
70         iload 1
71         invokestatic test_load_store_conflict_by_exception_not_thrown/checkI(I)V
72
73         iload 2
74         invokestatic test_load_store_conflict_by_exception_not_thrown/checkI(I)V
75
76         return
77 .end method
78