codegen: handle exceptions of a method
[mate.git] / tests / ObjectCreation.java
1 package tests;
2
3 public class ObjectCreation {
4         public static int checkMe;
5         public static ObjectCreation obj;
6
7         public int stuff;
8
9         public static void main(String []args) {
10                 CreateMe obj = new CreateMe();
11                 obj.executeMe();
12                 obj.objcOnly();
13                 CreateMe.woot();
14                 System.out.printf("result: 0x%08x\n", CreateMe.checkMe);
15         }
16
17         public ObjectCreation() {
18                 this.stuff = 0x1300;
19         }
20
21         public void objcOnly() {
22                 ObjectCreation.checkMe += 0x3;
23         }
24         
25         public void executeMe() {
26                 ObjectCreation.checkMe = 0xdead;
27         }
28
29         public static void woot() {
30                 checkMe++;
31         }
32 }
33
34 class CreateMe extends ObjectCreation {
35         public int var1;
36         public int var2;
37
38         public CreateMe() {
39                 this.var1 = 0x11;
40                 this.var2 = 0x22;
41         }
42
43         public void executeMe() {
44                 ObjectCreation.checkMe = this.var1 + this.var2 + this.stuff;
45         }
46 }