* configure.ac: New switch for disabling -O2 (--disable-optimizations).
[cacao.git] / tests / regression / jasmin / test_verify_unspecced_ok_new_in_local_within_try.j
1 .class public test_verify_unspecced_ok_new_in_local_within_try
2 .super java/lang/Object
3
4 ; The check against uninitialized objects in locals within try blocks is
5 ; unnecessary.
6 ; Reference:
7 ;     Alessandro Coglio
8 ;     Improving the official specification of Java bytecode verification
9 ;     Proceedings of the 3rd ECOOP Workshop on Formal Techniques for Java Programs
10 ;     June 2001
11 ;     citeseer.ist.psu.edu/article/coglio03improving.html
12
13 ; ======================================================================
14
15 .method public <init>()V
16    aload_0
17    invokenonvirtual java/lang/Object/<init>()V
18    return
19 .end method
20
21 ; ======================================================================
22
23 .method public toString()Ljava/lang/String;
24         .limit stack 1
25         .limit locals 1
26
27         ldc "it's me"
28         areturn
29
30 .end method
31
32 ; ======================================================================
33
34 .method public static main([Ljava/lang/String;)V
35         .limit stack 2
36         .limit locals 3
37
38         .catch java/lang/Throwable from start_try to end_try using handler
39
40         ldc 1
41         istore 1
42
43         new test_verify_unspecced_ok_new_in_local_within_try
44 start_try:
45         astore 2
46         ; this is ok
47
48         aload 2
49         dup
50         invokespecial test_verify_unspecced_ok_new_in_local_within_try/<init>()V
51 end_try:
52
53         getstatic java/lang/System/out Ljava/io/PrintStream;
54         swap
55         invokevirtual java/io/PrintStream/println(Ljava/lang/Object;)V
56         ; OUTPUT: it's me
57
58         return
59
60 handler:
61         return
62 .end method
63