test.c stuff
[nestedvm.git] / src / tests / Test.c
index 0e49b45..2c70026 100644 (file)
@@ -188,12 +188,37 @@ int main(int argc, char **argv) {
         memcpy(buf,"Hello, World",sizeof("Hello, World"));
         printf("%s\n",buf);
     }
-    printf("cwd: %s\n",getcwd(NULL,0));
-    printf("isatty(0): %d\n",isatty(0));
-    printf("exiting\n");
+    
+    {
+        
+#define HOST_BITS_PER_WIDE_INT 64
+#define HOST_WIDE_INT long long
+        
+        extern int ri(int n);
+        int precision = ri(8);
+        long long l;
+        
+        l = (precision - HOST_BITS_PER_WIDE_INT > 0
+             ? -1 : ((HOST_WIDE_INT) 1 << (precision - 1)) - 1),
+            (precision - HOST_BITS_PER_WIDE_INT - 1 > 0
+             ? (((HOST_WIDE_INT) 1
+                 << (precision - HOST_BITS_PER_WIDE_INT - 1))) - 1
+             : 0);
+        
+        printf("%llX\n",l);
+    }
+    
+    //printf("cwd: %s\n",getcwd(NULL,0));
+    //printf("isatty(0): %d\n",isatty(0));
+    //printf("exiting\n");
     return 0;
 }
 
+long long zero = 0;
+int izero = 0;
+long long rl(long long n) { return n + zero; }
+int ri(int n) { return n + izero; }
+
 void suckram() {
     int total = 0;
     fprintf(stderr,"Eating up all available memory\n");