* configure.ac: New switch for disabling -O2 (--disable-optimizations).
[cacao.git] / tests / cond2.java
1 /* Copyright (C) 2005, Joseph Wenninger <jowenn@kde.org> 
2 GNU General Public License
3 */
4
5
6 public class cond2 {
7
8         private static int test(int i) {
9                 return i==0 ? 0: 1;
10         }
11
12         private static int test2(int i) {
13                 i= i==0 ? 0: 1;
14                 i=i+10;
15                 return i;
16         }
17
18
19         private static int test3(int i) {
20                 i= i==0 ? 0: 1;
21                 try {
22                         i=i+10;
23                 } catch (Exception e) {}
24                 return i;
25
26         }
27
28         private static int test4(int i) {
29                 return test5(
30                         (i==0) ? 0: 1
31                 );
32         }
33
34         private static int test5(int i) {
35                 return i;
36         }
37
38         private static int test6(int i) {
39                 i= i==0 ? 0:1+test5(i);
40                 return i;
41         }
42
43         public static void main (String [] args) {
44                 test(20);
45                 test2(20);
46                 test3(20);
47                 test4(20);
48                 test6(20);
49         }
50
51 }