tests: don't use `pop' hack anymore, but System.out.printf \o/
authorBernhard Urban <lewurm@gmail.com>
Thu, 26 Apr 2012 15:42:34 +0000 (17:42 +0200)
committerBernhard Urban <lewurm@gmail.com>
Thu, 26 Apr 2012 15:44:12 +0000 (17:44 +0200)
31 files changed:
Makefile
Mate/X86CodeGen.hs
tests/AbsurdlyHuge.java
tests/ArgumentPassing1.java
tests/Array1.java
tests/CallConv1.java
tests/CallConv2.java
tests/CallConv3.java
tests/DifferentClass1.java
tests/Fac.java
tests/Fib.java
tests/Instance1.java
tests/Instance2.java
tests/Instance3.java
tests/Instance4.java [deleted file]
tests/Instance5.java [deleted file]
tests/Integer1.java
tests/Native1.java [deleted file]
tests/Native2.java
tests/Native3.java
tests/Static1.java
tests/Static2.java
tests/Static3.java
tests/Static4.java
tests/Static5.java
tests/Static6.java
tests/Static7.java
tests/Static8.java
tests/Strings1.java
tests/Test.java [deleted file]
tests/While.java

index 87aca3b6201941f6e8a9ae1ab9ffec5fbac91138..0f3f55c7df4193d64417f839729c38f919371df0 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -18,57 +18,55 @@ GHC_LD := -optl-Xlinker -optl-x
 all: mate $(CLASS_FILES)
 
 test: mate $(CLASS_FILES)
-       ./$< tests/Fib | grep mainresult
+       ./$< tests/While | grep -e "^result"
+       @printf "should be:  0x%08x 0x%08x\n" 0x19 0x19
+       ./$< tests/Fib | grep -e "^result"
        @printf "should be:  0x%08x\n" 0x2ac2
-       ./$< tests/Fac | grep mainresult
+       ./$< tests/Fac | grep -e "^result"
        @printf "should be:  0x%08x\n" 0x63e1a
-       ./$< tests/ArgumentPassing1 | grep mainresult
+       ./$< tests/ArgumentPassing1 | grep -e "^result"
        @printf "should be:  0x%08x 0x%08x\n" 0x92 $$(((0 - 0x1337) & 0xffffffff))
-       ./$< tests/DifferentClass1 | grep mainresult
+       ./$< tests/DifferentClass1 | grep -e "^result"
        @printf "should be:  0x%08x 0x%08x\n" 8 13
-       ./$< tests/Native1 | egrep -i -e '^printsomething: '
-       @printf "should be:  woot 0x%08x 0x%08x woot 0x%08x\n" 0x1337 0x1338 0x15a5
-       ./$< tests/Static1 | grep mainresult
+       ./$< tests/Static1 | grep -e "^result"
        @printf "should be:  0x%08x\n" 0x33
-       ./$< tests/Static2 | grep mainresult
+       ./$< tests/Static2 | grep -e "^result"
        @printf "should be:  0x%08x\n" 0x55
-       ./$< tests/Static3 | grep mainresult
+       ./$< tests/Static3 | grep -e "^result"
        @printf "should be:  0x%08x\n" 0x6dd
-       ./$< tests/Static4 | grep mainresult
+       ./$< tests/Static4 | grep -e "^result"
        @printf "should be:  0x%08x 0x%08x\n" 0x33 0x77
-       ./$< tests/Static5 | grep mainresult
+       ./$< tests/Static5 | grep -e "^result"
        @printf "should be:  0x%08x 0x%08x\n" 0x33 0x33
-       ./$< tests/Static6 | grep mainresult
+       ./$< tests/Static6 | grep -e "^result"
        @printf "should be:  0x%08x\n" 0x33
-       ./$< tests/Static7 | grep mainresult
+       ./$< tests/Static7 | grep -e "^result"
        @printf "should be:  0x%08x\n" $$((0x1337 + 0x555))
-       ./$< tests/Static8 | grep mainresult
+       ./$< tests/Static8 | grep -e "^result"
        @printf "should be:  0x%08x 0x%08x\n" 0x33 $$((0x1337 + 0x555))
-       ./$< tests/CallConv1 | grep mainresult
+       ./$< tests/CallConv1 | grep -e "^result"
        @printf "should be:  0x%08x\n" 0x1337
-       ./$< tests/CallConv2 | grep mainresult
+       ./$< tests/CallConv2 | grep -e "^result"
        @printf "should be:  0x%08x\n" 0x1337
-       ./$< tests/CallConv3 | grep mainresult
+       ./$< tests/CallConv3 | grep -e "^result"
        @printf "should be:  0x%08x 0x%08x 0x%08x 0x%08x\n" 0x1000 0x300 0x30 0x7
-       ./$< tests/Instance1 | grep mainresult
+       ./$< tests/Instance1 | grep -e "^result"
        @printf "should be:  0x%08x 0x%08x\n" 0x55 0x11
-       ./$< tests/Instance2 | grep mainresult
+       ./$< tests/Instance2 | grep -e "^result"
        @printf "should be:  0x%08x 0x%08x\n" 0x198 0x22
-       ./$< tests/Instance3 | grep mainresult
+       ./$< tests/Instance3 | grep -e "^result"
        @printf "should be:  0x%08x 0x%08x\n" 0x33 0x44
-       ./$< tests/Instance4 | grep mainresult
-       @printf "should be:  0x%08x 0x%08x\n" 0x1337 0x1337
-       ./$< tests/Native2 | grep "printstream"
+       ./$< tests/Native2 | grep -e "^result"
        @printf "should be:   0x%08x\n" 0x1337
-       ./$< tests/Native3 | egrep -e "^Hello World"
+       ./$< tests/Native3 | egrep -e "^result"
        @printf "should be: %s\n" "Hello World"
-       ./$< tests/Strings1 | egrep -c -e "^okay :-\)"
+       ./$< tests/Strings1 | egrep -c -e "^result"
        @printf "should be: %d\n" 3
-       ./$< tests/Array1 | grep "printstream"
+       ./$< tests/Array1 | grep -e "^result"
        @printf "should be:   0x%08x 0x%08x\n" 0x264 0x8
-       ./$< tests/Integer1 | grep mainresult
+       ./$< tests/Integer1 | grep -e "^result"
        @printf "should be:  0x%08x\n" 0x1337
-       ./$< tests/VarArgs1 | grep mainresult
+       ./$< tests/VarArgs1 | grep -e "^result"
 
 %.class: %.java
        $(JAVAC) $<
index 1eb9057f7eb1dd559f67a6631b90841dd26ced1b..00e93032827e46d5acf2c65c80468f48d93aff60 100644 (file)
@@ -226,12 +226,7 @@ emitFromBB method cls hmap =  do
     emit' insn = emit insn >> return Nothing
 
     emit :: J.Instruction -> CodeGen e s ()
-    emit POP = do -- print dropped value
-        calladdr <- getCurrentOffset
-        -- '5' is the size of the `call' instruction ( + immediate)
-        let w32_calladdr = 5 + calladdr
-        let trapaddr = (fromIntegral getaddr :: Word32)
-        call (trapaddr - w32_calladdr)
+    emit POP = do -- dropp value
         add esp (4 :: Word32)
     emit DUP = push (Disp 0, esp)
     emit AASTORE = emit IASTORE
index ba1707da8bc3a5678d80f53d94540fd2bd45ed2b..78cb7a3ea3e7b82f8596311dcbad1e6619962349 100644 (file)
@@ -1,41 +1,30 @@
-public class AbsurdlyHuge
-{
-public static int absurdlyHuge(int x)
-{
-for(int i=0;i<x;i++)
-{
-for(int u=0;u<x;u++)
-{
-for(int k=0;k<x;k++)
-{
-for(int v=0;v<x;v++)
-{
-for(int w=0;w<x;w++)
-{
-for(int z=0;z<x;z++)
-{
-for(int g=0;w<x;w++)
-{
-if(i+u+k+v+w+z<x)
-{
-return absurdlyHuge(k+v);
-}
-else
-{
-return absurdlyHuge(w+z);
-}
-}
-}
-}
-}
-}
-}
-}
-return 0;
-}
+package tests;
+
+public class AbsurdlyHuge {
+       public static int absurdlyHuge(int x) {
+               for(int i=0;i<x;i++) {
+                       for(int u=0;u<x;u++) {
+                               for(int k=0;k<x;k++) {
+                                       for(int v=0;v<x;v++) {
+                                               for(int w=0;w<x;w++) {
+                                                       for(int z=0;z<x;z++) {
+                                                               for(int g=0;w<x;w++) {
+                                                                       if(i+u+k+v+w+z<x) {
+                                                                               return absurdlyHuge(k+v);
+                                                                       } else {
+                                                                               return absurdlyHuge(w+z);
+                                                                       }
+                                                               }
+                                                       }
+                                               }
+                                       }
+                               }
+                       }
+               }
+               return 0;
+       }
 
-   public static void main(String[] args)
-   {
-      absurdlyHuge(1);
-   }
+       public static void main(String[] args) {
+               System.out.printf("result: 0x%08x\n", absurdlyHuge(1));
+       }
 }
index 7867cfdb6666da1dbad5027aad7fd7c0196f0dfe..29b6fdc6f702e76be5299046f32ec0d238c3afe2 100644 (file)
@@ -2,9 +2,9 @@ package tests;
 
 public class ArgumentPassing1 {
        public static void main(String []args) {
-               myadder(23, 4, 0x77); // 0x92
+               System.out.printf("result: 0x%08x\n", myadder(23, 4, 0x77)); // 0x92
                noreturn(23, 4, 0x77); // nothing
-               noargs(); // 0x1337
+               System.out.printf("result: 0x%08x\n", noargs()); // 0x1337
        }
 
        public static int myadder(int a, int b, int c) {
index 074477ae4ef773367c2748c65f28f54169528f4c..1f6e6bb851ff95cd8277b4d65d240d0bd4d45536 100644 (file)
@@ -10,7 +10,7 @@ public class Array1 {
                for (int i = 0; i < 0x8; i++) {
                        sum += arr[i];
                }
-               System.out.printf(sum); // 0x264
-               System.out.printf(arr.length); // 0x8
+               System.out.printf("result: 0x%08x\n", sum); // 0x264
+               System.out.printf("result: 0x%08x\n", arr.length); // 0x8
        }
 }
index acb6a565c39d23eb5c15591caaf56e3f4f3f0e0d..a341936c928ce240907e94b074f0a38d5f69f370 100644 (file)
@@ -4,11 +4,7 @@ public class CallConv1 {
        public static void main(String []args) {
                int sum = 0;
                sum += manyVars(0x1348);
-               id(sum); // 0x1337
-       }
-
-       public static int id(int a) {
-               return a;
+               System.out.printf("result: 0x%08x\n", sum);
        }
 
        public static int manyVars(int a) {
index ef8e3f886bda846c598d6e4dff68e732cf95069b..3fb2c488267556af0152cc004eaa926af8455c0d 100644 (file)
@@ -4,11 +4,7 @@ public class CallConv2 {
        public static void main(String []args) {
                int sum = 0;
                sum += manyVars(0x125A, 0x11, 0x33, 0x44);
-               id(sum); // 0x1337
-       }
-
-       public static int id(int a) {
-               return a;
+               System.out.printf("result: 0x%08x\n", sum);
        }
 
        public static int manyVars(int a, int b, int c, int d) {
index d5fa6da5ead746c8e286bf344ce004160931e913..1df0d024f753325f0d926ff865bc6f62bad6482f 100644 (file)
@@ -2,10 +2,10 @@ package tests;
 
 public class CallConv3 {
        public static void main(String []args) {
-               manyVars_A(0x1000, 0x300, 0x30, 0x7);
-               manyVars_B(0x1000, 0x300, 0x30, 0x7);
-               manyVars_C(0x1000, 0x300, 0x30, 0x7);
-               manyVars_D(0x1000, 0x300, 0x30, 0x7);
+               System.out.printf("result: 0x%08x\n", manyVars_A(0x1000, 0x300, 0x30, 0x7));
+               System.out.printf("result: 0x%08x\n", manyVars_B(0x1000, 0x300, 0x30, 0x7));
+               System.out.printf("result: 0x%08x\n", manyVars_C(0x1000, 0x300, 0x30, 0x7));
+               System.out.printf("result: 0x%08x\n", manyVars_D(0x1000, 0x300, 0x30, 0x7));
        }
 
        public static int manyVars_A(int a, int b, int c, int d) {
index ec397f1f99c87944a9c78734d654078f234b0040..dbe95d899b486b1717c9497c3710ef002ed8cf08 100644 (file)
@@ -2,7 +2,7 @@ package tests;
 
 public class DifferentClass1 {
        public static void main(String[] args) {
-               Fib.fib(5);
-               Fib.fib(6);
+               System.out.printf("result: 0x%08x\n", Fib.fib(5));
+               System.out.printf("result: 0x%08x\n", Fib.fib(6));
        }
 }
index 9929dcbbbff3a0dcc5c317bdd4d9d8437170a60a..381a7cb027aa680d3c85622681aa6e033e348456 100644 (file)
@@ -4,15 +4,10 @@ public class Fac {
        public static void main(String args[]) {
                int sum = 0;
                for (int i = 0; i < 10; i++) {
-                       // fac(i);
                        sum += fac(i);
                }
-               id(sum);
-               // System.out.printf("fac: 0x%08x\n", sum);
-       }
-
-       public static int id(int i) {
-               return i;
+               System.out.printf("result: 0x%08x\n", sum);
+               // System.out.printf("result: 0x%08x\n", facFor(0x10));
        }
 
        public static int fac(int a) {
@@ -24,11 +19,10 @@ public class Fac {
                return b;
        }
 
-       public static int facFor(int n){
-               int p = 1;
-               for(int i=1;i<=n;i++)
-               {
-                       p = p * i;
+       public static int facFor(int n) {
+               int p = 1;
+               for(int i = 1; i <= n; i++) {
+                       p *= i;
                }
                return p;
        }
index 11522e7057ab2bd3b1c6ec625b2a92081cc8c9ad..871b03f32592e8fb665a98eda5e7c307b3f16776 100644 (file)
@@ -2,12 +2,13 @@ package tests;
 
 public class Fib {
        public static int fib(int n) {
-               if(n<=1) return 1;
-               else return fib(n-1) + fib(n-2);
+               if (n <= 1)
+                       return 1;
+               else
+                       return fib(n - 1) + fib(n - 2);
        }
 
        public static void main(String[] args) {
-               fib(20);
-               // System.out.printf("%x\n", fib(20));
+               System.out.printf("result: 0x%08x\n", fib(20));
        }
 }
index e15505e1c554c9687d2cf8115e30ff73c585dcbf..fb24f7adc78bf084c00c91f8a0894d4cfe6e7824 100644 (file)
@@ -14,8 +14,7 @@ public class Instance1 {
                id(a.x); // 0x11
        }
 
-       public static int id(int a) {
-               // System.out.printf("0x%08x\n", a);
-               return a;
+       public static void id(int a) {
+               System.out.printf("result: 0x%08x\n", a);
        }
 }
index 687d7f93c5d4e77e4715ec617a94bb8dd2965a66..b336aefcfdeff3e84f74af121b1fa631fd23aedd 100644 (file)
@@ -19,7 +19,7 @@ public class Instance2 extends Instance1 {
                b.x = 0x22; sum += b.x; // 0x22
                b.y = 0x33; sum += b.y; // 0x33
                Instance1.id(sum); // 0x198
-               b.getX(); // 0x22
+               System.out.printf("0x%08x\n", b.getX()); // 0x22
        }
 
        public int getX() {
index f5ca160b6c1ba0889fb3d3bba545481fa6128449..af30d3637d8c389c8139130c61848fe946d75d2e 100644 (file)
@@ -5,8 +5,8 @@ public class Instance3 extends Instance2 {
                int sum = 0;
                Instance3 a = new Instance3();
                a.setX(0x33);
-               a.getX(); // 0x33
+               System.out.printf("result: 0x%08x\n", a.getX()); // 0x33
                a.setX(0x44);
-               a.getX(); // 0x44
+               System.out.printf("result: 0x%08x\n", a.getX()); // 0x44
        }
 }
diff --git a/tests/Instance4.java b/tests/Instance4.java
deleted file mode 100644 (file)
index 0ecd257..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-package tests;
-
-public class Instance4 extends Instance2 {
-       public Instance4() {
-               x = 0x11;
-               y = 0x22;
-       }
-
-       public static void main(String []args) {
-               Instance2 a = new Instance4();
-               a.getX(); // 0x1337
-               Instance4 b = (Instance4) a;
-               b.getX(); // 0x1337;
-       }
-
-       public int getX() {
-               return 0x1337;
-       }
-}
diff --git a/tests/Instance5.java b/tests/Instance5.java
deleted file mode 100644 (file)
index 8c8ff84..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-package tests;
-
-public class Instance5 {
-       public int x;
-       public Instance5() {
-               x = 0x11;
-       }
-
-       public static void main(String []args) {
-               Instance5 a = new Instance5();
-
-               a.setX(0x1337);
-               a.printX(a.x);
-       }
-
-       public void setX(int a) {
-               this.x = a;
-       }
-
-       public native void printX(int x);
-}
index 2220aca5ccbde512b7ee2cbd11ac5f8a42fdf1ed..7ca6d5c0a2c2a030d859f0894f0fa901f6f357d0 100644 (file)
@@ -3,6 +3,6 @@ package tests;
 public class Integer1 {
        public static void main(String []args) {
                Integer a = new Integer(0x1337);
-               a.intValue(); // 0x1337
+               System.out.printf("result: 0x%08x\n", a.intValue()); // 0x1337
        }
 }
diff --git a/tests/Native1.java b/tests/Native1.java
deleted file mode 100644 (file)
index d35c1a0..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-package tests;
-
-public class Native1 {
-       public static void main(String []args) {
-               printSomething();
-               for (int i = 0; i < 2; i++)
-                       printNumber(0x1337 + i);
-               printSomething();
-               printNumber(0x15a5);
-       }
-
-       public static void printNumber(int a) {
-               printSomething(a);
-       }
-
-       public static native void printSomething();
-       public static native void printSomething(int a);
-}
index 0c3c701b4dc2da8e0fce8e793d25d2dc591ee1ff..7da841e65907e298bde3da7b799f61d8f42f9c1d 100644 (file)
@@ -2,6 +2,6 @@ package tests;
 
 public class Native2 {
        public static void main(String []args) {
-               System.out.printf(0x1337);
+               System.out.printf("result: 0x%08x\n", 0x1337);
        }
 }
index 60916e64ee3c4bb7488e24b02d49949fb3e66cb3..f26ea5553b09857862b87190ac4524e2403d2e38 100644 (file)
@@ -2,6 +2,6 @@ package tests;
 
 public class Native3 {
        public static void main(String []args) {
-               System.out.println("Hello World");
+               System.out.println("result: Hello World");
        }
 }
index 74ca4fdd90f15b0772dc6f9a9b7b0967ea4bc330..45e03d2a74e5e0a58d69cde7a4f3ab71b037bc58 100644 (file)
@@ -6,7 +6,7 @@ public class Static1 {
 
        public static void main(String []args) {
                setNumbers();
-               addNumbers(); // 0x33
+               System.out.printf("result: 0x%08x\n", addNumbers()); // 0x33
        }
 
        public static void setNumbers() {
index cfc85dc902ec8d19e73bd84a444cbd9977b1c90b..50dddc2027e3672075af0bedd3b7316e11632203 100644 (file)
@@ -11,6 +11,6 @@ public class Static2 {
                // in Static2 as in Static1
                Static1.x = 0x33;
                Static1.y = 0x22;
-               Static1.addNumbers();
+               System.out.printf("result: 0x%08x\n", Static1.addNumbers());
        }
 }
index a5a732c1025ad7adc4435c4d47045156e25e8664..43145811cf5d69c4a12460bd6ceb8df3251534b9 100644 (file)
@@ -12,8 +12,7 @@ public class Static3 extends Static1 {
                sum += Static1.addNumbers(); // 0x33
                Static3.z = 0x11;
                sum += Static3.addNumbers(); // 0x44
-               getSum(); // 0x666 + 0x33 + 0x44 = 0x6dd
-               // System.out.printf("%x\n", getSum());
+               System.out.printf("result: 0x%08x\n", getSum()); // 0x666 + 0x33 + 0x44 = 0x6dd
        }
 
        public static int getSum() {
index 7f17bf9714970f0007569f44e1ff322d5b4a39dc..fbf29b55037dd280ffe00a35111a18256834a175 100644 (file)
@@ -7,10 +7,8 @@ public class Static4 extends Static1 {
        public static void main(String []args) {
                Static1.setNumbers();
                Static4.setNumbers();
-               Static1.addNumbers(); // 0x33
-               // System.out.printf("%x\n", Static1.addNumbers());
-               Static4.addNumbers(); // 0x77
-               // System.out.printf("%x\n", Static4.addNumbers());
+               System.out.printf("result: 0x%08x\n", Static1.addNumbers()); // 0x33
+               System.out.printf("result: 0x%08x\n", Static4.addNumbers()); // 0x77
        }
 
        public static void setNumbers() {
index 14c41d4f57de6bc603a7f6cfeb8e0044a56dc861..d49a45c921b3f87f5c70be414156878f0b77c078 100644 (file)
@@ -6,8 +6,7 @@ public class Static5 extends Static1 {
 
        public static void main(String []args) {
                Static5.setNumbers();
-               Static5.addNumbers(); // 0x33
-               Static1.addNumbers(); // 0x33
-               // System.out.printf("%x\n", Static5.addNumbers());
+               System.out.printf("result: 0x%08x\n", Static5.addNumbers()); // 0x33
+               System.out.printf("result: 0x%08x\n", Static1.addNumbers()); // 0x33
        }
 }
index 49913ad8d684806c527dc331bb54872041b3ff5d..97748c1b2f1549266bccaa156b9f38b2138a3873 100644 (file)
@@ -10,7 +10,7 @@ public class Static6 {
        }
 
        public static void main(String []args) {
-               addNumbers(); // 0x33
+               System.out.printf("result: 0x%08x\n", addNumbers()); // 0x33
        }
 
        public static int addNumbers() {
index d587e081d9d77569ef05b43e03c0d272bfc98a94..640fc755fa33db6c2d33bce7333d3afdfb14f820 100644 (file)
@@ -10,7 +10,6 @@ public class Static7 extends Static6 {
        }
 
        public static void main(String []args) {
-               addNumbers(); // 0x188c
-               // System.out.printf("%x\n", addNumbers());
+               System.out.printf("result: 0x%08x\n", addNumbers()); // 0x188c
        }
 }
index 13596427a5beaa55c5d3af14150cfbcb5f3054cd..c908a1e0bd157d4f7c557b845f267bb41f8a09be 100644 (file)
@@ -10,8 +10,7 @@ public class Static8 extends Static8_local {
        }
 
        public static void main(String []args) {
-               Static8.addNumbers(); // 0x188c
-               // System.out.printf("%x\n", Static8.addNumbers());
+               System.out.printf("result: 0x%08x\n", Static8.addNumbers()); // 0x188c
        }
 }
 
@@ -22,8 +21,7 @@ class Static8_local {
        static {
                Static8_local.x = 0x11;
                Static8_local.y = 0x22;
-               Static8_local.addNumbers(); // 0x33
-               // System.out.printf("%x\n", addNumbers());
+               System.out.printf("result: 0x%08x\n", addNumbers()); // 0x33
        }
 
        public static int addNumbers() {
index 9a6a9bae2110dace31e01da4bd6a59d411c4906d..5fa12cfdce68b5f7fa038651797fa75c8fd7bc04 100644 (file)
@@ -7,21 +7,21 @@ public class Strings1 {
                String c = "wtf";
 
                if (a == b) {
-                       System.out.println("okay :-)");
+                       System.out.println("result: okay :-)");
                } else {
-                       System.out.println("bad :-(");
+                       System.out.println("result: bad :-(");
                }
 
                if (a != c) {
-                       System.out.println("okay :-)");
+                       System.out.println("result: okay :-)");
                } else {
-                       System.out.println("bad :-(");
+                       System.out.println("result: bad :-(");
                }
 
                if (a == c) {
-                       System.out.println("bad :-(");
+                       System.out.println("result: bad :-(");
                } else {
-                       System.out.println("okay :-)");
+                       System.out.println("result: okay :-)");
                }
        }
 }
diff --git a/tests/Test.java b/tests/Test.java
deleted file mode 100644 (file)
index 4c08a1b..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-package tests;
-
-public class Test {
-    private static int foo;
-    private static int bar;
-
-    public static void main(String [] args) {
-      foo = 0x42;
-      bar = 2 * foo;
-    }
-}
index 929b56b14c22d3e68bc4351fdac06cde2096df05..d34f959f6e495a8e86a62bc8734ec21d635e74c6 100644 (file)
@@ -1,6 +1,11 @@
 package tests;
 
 public class While {
+       public static void main(String []args) {
+               System.out.printf("result: f: 0x%08x\n", f(4, 6));
+               System.out.printf("result: g: 0x%08x\n", g(4, 6));
+       }
+
        public static int f(int a, int b) {
                do {
                        a += b;