[llvm-commits] [compiler-rt] r81552 - in /compiler-rt/trunk/test/Unit: fixunsxfdi_test.c fixunsxfsi_test.c fixxfdi_test.c floatdixf_test.c floatundixf_test.c int_lib.h

Nick Kledzik kledzik at apple.com
Fri Sep 11 12:09:37 PDT 2009


Author: kledzik
Date: Fri Sep 11 14:09:36 2009
New Revision: 81552

URL: http://llvm.org/viewvc/llvm-project?rev=81552&view=rev
Log:
use HAS_80_BIT_LONG_DOUBLE so some tests work properly on arm

Modified:
    compiler-rt/trunk/test/Unit/fixunsxfdi_test.c
    compiler-rt/trunk/test/Unit/fixunsxfsi_test.c
    compiler-rt/trunk/test/Unit/fixxfdi_test.c
    compiler-rt/trunk/test/Unit/floatdixf_test.c
    compiler-rt/trunk/test/Unit/floatundixf_test.c
    compiler-rt/trunk/test/Unit/int_lib.h

Modified: compiler-rt/trunk/test/Unit/fixunsxfdi_test.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/Unit/fixunsxfdi_test.c?rev=81552&r1=81551&r2=81552&view=diff

==============================================================================
--- compiler-rt/trunk/test/Unit/fixunsxfdi_test.c (original)
+++ compiler-rt/trunk/test/Unit/fixunsxfdi_test.c Fri Sep 11 14:09:36 2009
@@ -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 @@
 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;
 

Modified: compiler-rt/trunk/test/Unit/fixunsxfsi_test.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/Unit/fixunsxfsi_test.c?rev=81552&r1=81551&r2=81552&view=diff

==============================================================================
--- compiler-rt/trunk/test/Unit/fixunsxfsi_test.c (original)
+++ compiler-rt/trunk/test/Unit/fixunsxfsi_test.c Fri Sep 11 14:09:36 2009
@@ -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 @@
 
 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;
 

Modified: compiler-rt/trunk/test/Unit/fixxfdi_test.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/Unit/fixxfdi_test.c?rev=81552&r1=81551&r2=81552&view=diff

==============================================================================
--- compiler-rt/trunk/test/Unit/fixxfdi_test.c (original)
+++ compiler-rt/trunk/test/Unit/fixxfdi_test.c Fri Sep 11 14:09:36 2009
@@ -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 @@
 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;
 

Modified: compiler-rt/trunk/test/Unit/floatdixf_test.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/Unit/floatdixf_test.c?rev=81552&r1=81551&r2=81552&view=diff

==============================================================================
--- compiler-rt/trunk/test/Unit/floatdixf_test.c (original)
+++ compiler-rt/trunk/test/Unit/floatdixf_test.c Fri Sep 11 14:09:36 2009
@@ -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 @@
 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;
 

Modified: compiler-rt/trunk/test/Unit/floatundixf_test.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/Unit/floatundixf_test.c?rev=81552&r1=81551&r2=81552&view=diff

==============================================================================
--- compiler-rt/trunk/test/Unit/floatundixf_test.c (original)
+++ compiler-rt/trunk/test/Unit/floatundixf_test.c Fri Sep 11 14:09:36 2009
@@ -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 @@
 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;
 

Modified: compiler-rt/trunk/test/Unit/int_lib.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/Unit/int_lib.h?rev=81552&r1=81551&r2=81552&view=diff

==============================================================================
--- compiler-rt/trunk/test/Unit/int_lib.h (original)
+++ compiler-rt/trunk/test/Unit/int_lib.h Fri Sep 11 14:09:36 2009
@@ -149,4 +149,11 @@
     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 */





More information about the llvm-commits mailing list