* Removed all Id tags.
[cacao.git] / tests / regression / jctest.java
index bbb5f1390afb8cbaaf029f4b679d1701de32e5d8..fecc9f4ec291f2781e9057cc215e5c68c267a204 100644 (file)
@@ -1,6 +1,6 @@
 /* tests/jctest.java - checks most of the JVM instructions
 
-   Copyright (C) 1996-2005, 2006 R. Grafl, A. Krall, C. Kruegel,
+   Copyright (C) 1996-2005, 2006, 2007 R. Grafl, A. Krall, C. Kruegel,
    C. Oates, R. Obermaisser, M. Platter, M. Probst, S. Ring,
    E. Steiner, C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich,
    TU Wien
    Contact: cacao@cacaojvm.org
 
    Authors: Reinhard Grafl
-
-   Changes: Christian Thalinger
-
-   $Id: jctest.java 4357 2006-01-22 23:33:38Z twisti $
+            Christian Thalinger
 
 */
 
@@ -1188,6 +1185,7 @@ public class jctest implements jcinterface {
     }
 
     static public void testdivremconst(int a) {
+        p("IDIVPOW2 (" + a + " / 0x00000001):  ", a / 0x00000001);
         p("IDIVPOW2 (" + a + " / 0x00000002):  ", a / 0x00000002);
         p("IDIVPOW2 (" + a + " / 0x00000004):  ", a / 0x00000004);
         p("IDIVPOW2 (" + a + " / 0x00000008):  ", a / 0x00000008);
@@ -1220,6 +1218,7 @@ public class jctest implements jcinterface {
         p("IDIVPOW2 (" + a + " / 0x40000000):  ", a / 0x40000000);
         p("IDIVPOW2 (" + a + " / 0x80000000):  ", a / 0x80000000);
 
+        p("IREMPOW2 (" + a + " % 0x00000001):  ", a % 0x00000001);
         p("IREMPOW2 (" + a + " % 0x00000002):  ", a % 0x00000002);
         p("IREMPOW2 (" + a + " % 0x00000004):  ", a % 0x00000004);
         p("IREMPOW2 (" + a + " % 0x00000008):  ", a % 0x00000008);
@@ -1254,6 +1253,7 @@ public class jctest implements jcinterface {
     }
 
     static public void testdivremconst(long a) {
+        p("LDIVPOW2 (" + a + " / 0x00000001):  ", a / 0x00000001);
         p("LDIVPOW2 (" + a + " / 0x00000002):  ", a / 0x00000002);
         p("LDIVPOW2 (" + a + " / 0x00000004):  ", a / 0x00000004);
         p("LDIVPOW2 (" + a + " / 0x00000008):  ", a / 0x00000008);
@@ -1286,6 +1286,7 @@ public class jctest implements jcinterface {
         p("LDIVPOW2 (" + a + " / 0x40000000):  ", a / 0x40000000);
         p("LDIVPOW2 (" + a + " / 0x80000000):  ", a / 0x80000000);
 
+        p("LREMPOW2 (" + a + " % 0x00000001):  ", a % 0x00000001L);
         p("LREMPOW2 (" + a + " % 0x00000002):  ", a % 0x00000002L);
         p("LREMPOW2 (" + a + " % 0x00000004):  ", a % 0x00000004L);
         p("LREMPOW2 (" + a + " % 0x00000008):  ", a % 0x00000008L);
@@ -1490,29 +1491,76 @@ public class jctest implements jcinterface {
     }
 
     public static void p(String a) { System.out.print(a); pnl(); }
-    public static void p(boolean a) {System.out.print(a); 
-    pnl();  }
-    public static void p(int a) { System.out.print ("int: ");
-    System.out.print(a); 
-    pnl();  }
-    public static void p(long a) { System.out.print ("long: ");
-    System.out.print(a); 
-    pnl(); }
-    public static void p(short a) { System.out.print ("short: ");
-    System.out.print(a); 
-    pnl(); }
-    public static void p(byte a) { System.out.print ("byte: ");
-    System.out.print(a); 
-    pnl(); }
-    public static void p(char a) { System.out.print ("char: ");
-    System.out.print((int) a); 
-    pnl(); }
-    public static void p(float a) { System.out.print ("float: ");
-    System.out.print ( java.lang.Float.floatToIntBits(a) ); 
-    pnl(); }
-    public static void p(double a) { System.out.print ("double: ");
-    System.out.print( java.lang.Double.doubleToLongBits(a) ); 
-    pnl(); }
+
+    public static void p(boolean a) {
+        System.out.print(a);
+        pnl();
+    }
+
+    public static void p(byte a) {
+        System.out.print("byte: ");
+        System.out.print(a);
+        System.out.print(" (0x");
+        System.out.print(Integer.toHexString(a));
+        System.out.print(")");
+        pnl();
+    }
+
+    public static void p(char a) {
+        System.out.print("char: ");
+        System.out.print((int) a);
+        System.out.print(" (0x");
+        System.out.print(Integer.toHexString((int) a));
+        System.out.print(")");
+        pnl();
+    }
+
+    public static void p(short a) {
+        System.out.print("short: ");
+        System.out.print(a);
+        System.out.print(" (0x");
+        System.out.print(Integer.toHexString(a));
+        System.out.print(")");
+        pnl();
+    }
+
+    public static void p(int a) {
+        System.out.print ("int: ");
+        System.out.print(a);
+        System.out.print(" (0x");
+        System.out.print(Integer.toHexString(a));
+        System.out.print(")");
+        pnl();
+    }
+
+    public static void p(long a) {
+        System.out.print ("long: ");
+        System.out.print(a);
+        System.out.print(" (0x");
+        System.out.print(Long.toHexString(a));
+        System.out.print(")");
+        pnl();
+    }
+
+    public static void p(float a) {
+        int i = Float.floatToIntBits(a);
+        System.out.print("float: ");
+        System.out.print(i);
+        System.out.print(" (0x");
+        System.out.print(Integer.toHexString(i));
+        System.out.print(")");
+        pnl();
+    }
+
+    public static void p(double a) {
+        long l = Double.doubleToLongBits(a);
+        System.out.print("double: ");
+        System.out.print(l);
+        System.out.print(" (0x");
+        System.out.print(Long.toHexString(l));
+        System.out.print(")");
+        pnl();
+    }
 
     public static void p(String s,boolean i) { 
         System.out.print(s); p(i);