diff options
author | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2013-05-05 16:29:20 +0000 |
---|---|---|
committer | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2013-05-05 16:29:20 +0000 |
commit | b257a6d283f6f5784cb351856b5dbe8c645a1f6f (patch) | |
tree | 3e134e46c53a5e75a3b6c78878d07a554b396367 /runtime/test | |
parent | bc24cf49659f91245d8f42ca06fbe7d21a5c06cd (diff) | |
download | compcert-b257a6d283f6f5784cb351856b5dbe8c645a1f6f.tar.gz compcert-b257a6d283f6f5784cb351856b5dbe8c645a1f6f.zip |
ia32/i64_dtou: wrong play on rounding mode
arm, powerpc: expand shifts inline in dtos and dtou
arm: branchless code for shl and shr
test: more tests for double -> long long conversions.
git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@2234 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
Diffstat (limited to 'runtime/test')
-rw-r--r-- | runtime/test/test_int64.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/runtime/test/test_int64.c b/runtime/test/test_int64.c index 0a7dfc45..4dbad707 100644 --- a/runtime/test/test_int64.c +++ b/runtime/test/test_int64.c @@ -147,6 +147,16 @@ static void test1(u64 x, u64 y) if (f != g) error++, printf("(double) %lld (s) = %a, expected %a\n", x, f, g); + f = (double) x; + z = __i64_dtou(f); + if (z != (u64) (double) f) + error++, printf("(u64) %a = %llu, expected %llu\n", f, z, (u64) f); + + f = (double) ((s64) x); + t = __i64_dtos(f); + if (t != (s64) (double) f) + error++, printf("(s64) %a = %lld, expected %lld\n", f, z, (s64) f); + f = ((double) x) * 0.0001; z = __i64_dtou(f); if (z != (u64) f) |