summaryrefslogtreecommitdiff
path: root/test/builtins/Unit/floattixf_test.c
diff options
context:
space:
mode:
authorReid Kleckner <rnk@google.com>2018-11-01 00:00:03 +0000
committerReid Kleckner <rnk@google.com>2018-11-01 00:00:03 +0000
commit8a584bb7f235aee99609e3496a7c80104be775d6 (patch)
treec7e8fb7cf6b93bc6d193310adf035618a3581252 /test/builtins/Unit/floattixf_test.c
parentfea925bcc3c67abf4b5831d6ab93531b2ffdf770 (diff)
downloadcompiler-rt-8a584bb7f235aee99609e3496a7c80104be775d6.tar.gz
Compile and test i128 math builtins for Win64
Summary: Windows has always been LLP64, not LP64, so the macros were incorrect. Check for _WIN64, since AArch64 sets that too. The tests have to be fixed up in two main ways: 1. Use 'ULL' suffixes to avoid sign extension when passing hex literals with the sign bit set to signed 128 arguments. Clang -fms-compatibility makes such hex literals signed, not unsigned. 2. Disable various tests for 80-bit long double interoperation with i128 values. Reviewers: joerg, mstorsjo Subscribers: javed.absar, kristof.beyls, hiraditya, aheejin, llvm-commits Differential Revision: https://reviews.llvm.org/D53918 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@345796 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/builtins/Unit/floattixf_test.c')
-rw-r--r--test/builtins/Unit/floattixf_test.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/builtins/Unit/floattixf_test.c b/test/builtins/Unit/floattixf_test.c
index 77a6f7dbf..501a8dc6c 100644
--- a/test/builtins/Unit/floattixf_test.c
+++ b/test/builtins/Unit/floattixf_test.c
@@ -18,7 +18,7 @@
#include <float.h>
#include <stdio.h>
-#ifdef CRT_HAS_128BIT
+#if defined(CRT_HAS_128BIT) && HAS_80_BIT_LONG_DOUBLE
// Returns: convert a to a long double, rounding toward even.
@@ -43,15 +43,15 @@ int test__floattixf(ti_int a, long double expected)
return x != expected;
}
-char assumption_1[sizeof(ti_int) == 2*sizeof(di_int)] = {0};
-char assumption_2[sizeof(ti_int)*CHAR_BIT == 128] = {0};
-char assumption_3[sizeof(long double)*CHAR_BIT == 128] = {0};
+COMPILE_TIME_ASSERT(sizeof(ti_int) == 2*sizeof(di_int));
+COMPILE_TIME_ASSERT(sizeof(ti_int)*CHAR_BIT == 128);
+COMPILE_TIME_ASSERT(sizeof(long double)*CHAR_BIT == 128);
#endif
int main()
{
-#ifdef CRT_HAS_128BIT
+#if defined(CRT_HAS_128BIT) && HAS_80_BIT_LONG_DOUBLE
if (test__floattixf(0, 0.0))
return 1;