2015-01-14 Richard Biener <rguenther@suse.de>
[official-gcc.git] / libjava / testsuite / libjava.lang / inline.java
blob66585293491c5807b6e0f386588c619ec0ada9e5
1 public class inline
3 static int factorial_1 (int n)
5 if (n > 0)
6 return n * factorial_1(n-1);
7 return 1;
10 static int factorial_2 (int n)
12 if (n > 0)
13 return n * factorial_3(n-1);
14 return 1;
17 static int factorial_3 (int n)
19 if (n > 0)
20 return n * factorial_2(n-1);
21 return 1;
24 public static void main(String args[])
26 if (factorial_1 (5) != 120)
27 System.out.println("This should not happen");
28 else
29 System.out.println("OK");
30 if (factorial_2 (5) != 120)
31 System.out.println("This should not happen");
32 else
33 System.out.println("OK");