aboutsummaryrefslogtreecommitdiffstats
path: root/runtime/test/test_int64.c
diff options
context:
space:
mode:
authorBernhard Schommer <bernhardschommer@gmail.com>2015-02-19 10:41:21 +0100
committerBernhard Schommer <bernhardschommer@gmail.com>2015-02-19 10:41:21 +0100
commitd58ae381a0ba929e993c21a6ae65428071f84d3e (patch)
tree947b9446bfd9a8ea89caf4519e3d9804244f014c /runtime/test/test_int64.c
parent1772a8118fae5152439965b2f9c9887c60a57c37 (diff)
parentd4389977e95d3569ff0abb53e1b1fba20254b21e (diff)
downloadcompcert-d58ae381a0ba929e993c21a6ae65428071f84d3e.tar.gz
compcert-d58ae381a0ba929e993c21a6ae65428071f84d3e.zip
Merge github.com:AbsInt/CompCert
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);