aboutsummaryrefslogtreecommitdiffstats
path: root/runtime/test/test_int64.c
diff options
context:
space:
mode:
authorBernhard Schommer <bernhardschommer@gmail.com>2015-03-10 10:30:16 +0100
committerBernhard Schommer <bernhardschommer@gmail.com>2015-03-10 10:30:16 +0100
commite37e366c826a0dc422e449b9ad0afa70be204e12 (patch)
tree3bcc0c14099862614d19c95fee0edc7b388720b3 /runtime/test/test_int64.c
parent8aae10b50b321cfcbde86582cdd7ce1df8960628 (diff)
parent3e01154d693e1c457e1e974f5e9ebaa4601050aa (diff)
downloadcompcert-e37e366c826a0dc422e449b9ad0afa70be204e12.tar.gz
compcert-e37e366c826a0dc422e449b9ad0afa70be204e12.zip
Merge branch 'master' into dwarf
Diffstat (limited to 'runtime/test/test_int64.c')
-rw-r--r--runtime/test/test_int64.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/runtime/test/test_int64.c b/runtime/test/test_int64.c
index ab7a231d..58a129b6 100644
--- a/runtime/test/test_int64.c
+++ b/runtime/test/test_int64.c
@@ -158,17 +158,21 @@ static void test1(u64 x, u64 y)
u = __i64_stof(x);
v = (float) (s64) x;
if (u != v)
- error++, printf("(double) %lld (s) = %a, expected %a\n", x, u, v);
+ error++, printf("(float) %lld (s) = %a, expected %a\n", x, u, v);
f = (double) x;
- z = __i64_dtou(f);
- if (z != (u64) f)
- error++, printf("(u64) %a = %llu, expected %llu\n", f, z, (u64) f);
+ if (f >= 0 && f < 0x1p+64) {
+ z = __i64_dtou(f);
+ if (z != (u64) f)
+ error++, printf("(u64) %a = %llu, expected %llu\n", f, z, (u64) f);
+ }
f = (double) (s64) x;
- t = __i64_dtos(f);
- if (t != (s64) f)
- error++, printf("(s64) %a = %lld, expected %lld\n", f, z, (s64) f);
+ if (f >= -0x1p+63 && f < 0x1p+63) {
+ t = __i64_dtos(f);
+ if (t != (s64) f)
+ error++, printf("(s64) %a = %lld, expected %lld\n", f, z, (s64) f);
+ }
f = ((double) x) * 0.0001;
z = __i64_dtou(f);