aboutsummaryrefslogtreecommitdiffstats
path: root/runtime/test
diff options
context:
space:
mode:
authorBernhard Schommer <bernhardschommer@gmail.com>2015-02-19 17:24:01 +0100
committerBernhard Schommer <bernhardschommer@gmail.com>2015-02-19 17:24:01 +0100
commit959542e4cf126c4f46f00c764b5365804de637c6 (patch)
tree58eb44d941b65d15537a5c53bccd8257030aadf2 /runtime/test
parentb0c09b32f3e559ca22afc4dc40fdd60964cb3292 (diff)
parentb0eb1dfc9fd7b15c556c49101390d882b0f00f8a (diff)
downloadcompcert-959542e4cf126c4f46f00c764b5365804de637c6.tar.gz
compcert-959542e4cf126c4f46f00c764b5365804de637c6.zip
Merge github.com:AbsInt/CompCert into compcert_windows
Diffstat (limited to 'runtime/test')
-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);