codegen: handle exceptions of a method
[mate.git] / tests / FacOld.java
1 package tests;
2
3 public class FacOld {
4         public static void main(String args[]) {
5                 for (int i = 0; i < 10; i++) {
6                         fac(i);
7                         System.out.printf("fac(%d): 0x%08x\n", i, fac(i));
8                 }
9         }
10
11         public static int fac(int a) {
12                 int b = 1;
13                 while (a > 0) {
14                         b *= a;
15                         a--;
16                 }
17                 return b;
18         }
19 }