summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorNick Kledzik <kledzik@apple.com>2009-09-11 19:09:36 +0000
committerNick Kledzik <kledzik@apple.com>2009-09-11 19:09:36 +0000
commit3ea8287d4f270edfa965d4defd824f4d6a117e6d (patch)
treeeac18e377368479043668930d25126ff972d16e0 /test
parent01f9de572f21908fa63856cf294523f2ac1f1965 (diff)
downloadcompiler-rt-3ea8287d4f270edfa965d4defd824f4d6a117e6d.tar.gz
compiler-rt-3ea8287d4f270edfa965d4defd824f4d6a117e6d.tar.bz2
compiler-rt-3ea8287d4f270edfa965d4defd824f4d6a117e6d.tar.xz
use HAS_80_BIT_LONG_DOUBLE so some tests work properly on arm
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@81552 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/Unit/fixunsxfdi_test.c8
-rw-r--r--test/Unit/fixunsxfsi_test.c6
-rw-r--r--test/Unit/fixxfdi_test.c7
-rw-r--r--test/Unit/floatdixf_test.c6
-rw-r--r--test/Unit/floatundixf_test.c7
-rw-r--r--test/Unit/int_lib.h7
6 files changed, 21 insertions, 20 deletions
diff --git a/test/Unit/fixunsxfdi_test.c b/test/Unit/fixunsxfdi_test.c
index c839a361..f8c89451 100644
--- a/test/Unit/fixunsxfdi_test.c
+++ b/test/Unit/fixunsxfdi_test.c
@@ -11,11 +11,12 @@
//
//===----------------------------------------------------------------------===//
-#if !_ARCH_PPC
-
#include "int_lib.h"
#include <stdio.h>
+#include <limits.h>
+
+#if HAS_80_BIT_LONG_DOUBLE
// Returns: convert a to a unsigned long long, rounding toward zero.
// Negative values all become zero.
@@ -41,12 +42,11 @@ int test__fixunsxfdi(long double a, du_int expected)
char assumption_1[sizeof(du_int) == 2*sizeof(su_int)] = {0};
char assumption_2[sizeof(du_int)*CHAR_BIT == 64] = {0};
char assumption_3[sizeof(long double)*CHAR_BIT == 128] = {0};
-
#endif
int main()
{
-#if !_ARCH_PPC
+#if HAS_80_BIT_LONG_DOUBLE
if (test__fixunsxfdi(0.0, 0))
return 1;
diff --git a/test/Unit/fixunsxfsi_test.c b/test/Unit/fixunsxfsi_test.c
index 2b516d5b..0353b6bf 100644
--- a/test/Unit/fixunsxfsi_test.c
+++ b/test/Unit/fixunsxfsi_test.c
@@ -11,11 +11,10 @@
//
//===----------------------------------------------------------------------===//
-#if !_ARCH_PPC
-
#include "int_lib.h"
#include <stdio.h>
+#if HAS_80_BIT_LONG_DOUBLE
// Returns: convert a to a unsigned int, rounding toward zero.
// Negative values all become zero.
@@ -39,12 +38,11 @@ int test__fixunsxfsi(long double a, su_int expected)
char assumption_2[sizeof(su_int)*CHAR_BIT == 32] = {0};
char assumption_3[sizeof(long double)*CHAR_BIT == 128] = {0};
-
#endif
int main()
{
-#if !_ARCH_PPC
+#if HAS_80_BIT_LONG_DOUBLE
if (test__fixunsxfsi(0.0, 0))
return 1;
diff --git a/test/Unit/fixxfdi_test.c b/test/Unit/fixxfdi_test.c
index 9fe4e0a7..47820c35 100644
--- a/test/Unit/fixxfdi_test.c
+++ b/test/Unit/fixxfdi_test.c
@@ -11,11 +11,11 @@
//
//===----------------------------------------------------------------------===//
-#if !_ARCH_PPC
-
#include "int_lib.h"
#include <stdio.h>
+
+#if HAS_80_BIT_LONG_DOUBLE
// Returns: convert a to a signed long long, rounding toward zero.
// Assumption: long double is an intel 80 bit floating point type padded with 6 bytes
@@ -39,12 +39,11 @@ int test__fixxfdi(long double a, di_int expected)
char assumption_1[sizeof(di_int) == 2*sizeof(si_int)] = {0};
char assumption_2[sizeof(su_int)*CHAR_BIT == 32] = {0};
char assumption_3[sizeof(long double)*CHAR_BIT == 128] = {0};
-
#endif
int main()
{
-#if !_ARCH_PPC
+#if HAS_80_BIT_LONG_DOUBLE
if (test__fixxfdi(0.0, 0))
return 1;
diff --git a/test/Unit/floatdixf_test.c b/test/Unit/floatdixf_test.c
index cb3f5e0a..d96c7e8e 100644
--- a/test/Unit/floatdixf_test.c
+++ b/test/Unit/floatdixf_test.c
@@ -11,11 +11,10 @@
//
//===----------------------------------------------------------------------===//
-#if !_ARCH_PPC
-
#include "int_lib.h"
#include <stdio.h>
+#if HAS_80_BIT_LONG_DOUBLE
// Returns: convert a to a long double, rounding toward even.
// Assumption: long double is a IEEE 80 bit floating point type padded to 128 bits
@@ -38,12 +37,11 @@ int test__floatdixf(di_int a, long double expected)
char assumption_1[sizeof(di_int) == 2*sizeof(si_int)] = {0};
char assumption_2[sizeof(di_int)*CHAR_BIT == 64] = {0};
char assumption_3[sizeof(long double)*CHAR_BIT == 128] = {0};
-
#endif
int main()
{
-#if !_ARCH_PPC
+#if HAS_80_BIT_LONG_DOUBLE
if (test__floatdixf(0, 0.0))
return 1;
diff --git a/test/Unit/floatundixf_test.c b/test/Unit/floatundixf_test.c
index 11263482..40e1d720 100644
--- a/test/Unit/floatundixf_test.c
+++ b/test/Unit/floatundixf_test.c
@@ -11,11 +11,11 @@
//
//===----------------------------------------------------------------------===//
-#if !_ARCH_PPC
-
#include "int_lib.h"
#include <stdio.h>
+
+#if HAS_80_BIT_LONG_DOUBLE
// Returns: convert a to a long double, rounding toward even.
// Assumption: long double is a IEEE 80 bit floating point type padded to 128 bits
@@ -38,12 +38,11 @@ int test__floatundixf(du_int a, long double expected)
char assumption_1[sizeof(du_int) == 2*sizeof(si_int)] = {0};
char assumption_2[sizeof(du_int)*CHAR_BIT == 64] = {0};
char assumption_3[sizeof(long double)*CHAR_BIT == 128] = {0};
-
#endif
int main()
{
-#if !_ARCH_PPC
+#if HAS_80_BIT_LONG_DOUBLE
if (test__floatundixf(0, 0.0))
return 1;
diff --git a/test/Unit/int_lib.h b/test/Unit/int_lib.h
index bc8c98e7..e5bfd663 100644
--- a/test/Unit/int_lib.h
+++ b/test/Unit/int_lib.h
@@ -149,4 +149,11 @@ typedef union
long double f;
} long_double_bits;
+
+/* for test cases that are only applicable to */
+/* architectures with 80-bit long doubles */
+#if __i386__ || __x86_64__
+ #define HAS_80_BIT_LONG_DOUBLE 1
+#endif
+
#endif /* INT_LIB_H */