X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Ftests%2FTest.c;h=659254bc410cf6cf5bffcc85972985ca18e6bde3;hb=6cf1ec7685f99f9a2f46e9ad6d29ae52d3125579;hp=0e49b450c9cc1aaf1de7e86aff2f7baca7d410d6;hpb=98f786ce8ee1fcd9568d1c367160851d32e1c786;p=nestedvm.git diff --git a/src/tests/Test.c b/src/tests/Test.c index 0e49b45..659254b 100644 --- a/src/tests/Test.c +++ b/src/tests/Test.c @@ -188,12 +188,44 @@ 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); + } + + { + double d = -2.34; + //d = abs(d); + printf("abs(-2.24) = %g\n",d); + } + + + //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");