OSDN Git Service

* lib/target-supports.exp (check_effective_target_double64): New.
authordj <dj@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 27 Apr 2009 23:27:21 +0000 (23:27 +0000)
committerdj <dj@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 27 Apr 2009 23:27:21 +0000 (23:27 +0000)
(check_effective_target_double64plus): New.
(check_effective_target_large_double): New.
* gcc.dg/Wconversion-real-integer.c: Require double64plus.
* gcc.dg/div-double-1.c: Likewise.
* gcc.dg/Wconversion-real.c: Require large_double.
* gcc.dg/cdce1.c: Require large_double instead of checking targets.

* gcc.c-torture/execute/ieee/unsafe-fp-assoc-1.c: Skip if doubles are too small.

* gcc.c-torture/execute/ieee/20010226-1.c: Mark all floating point
constants as long.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@146863 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/execute/ieee/20010226-1.c
gcc/testsuite/gcc.c-torture/execute/ieee/unsafe-fp-assoc-1.c
gcc/testsuite/gcc.dg/Wconversion-real-integer.c
gcc/testsuite/gcc.dg/Wconversion-real.c
gcc/testsuite/gcc.dg/cdce1.c
gcc/testsuite/gcc.dg/div-double-1.c
gcc/testsuite/lib/target-supports.exp

index aa164b2..d7668c4 100644 (file)
@@ -1,3 +1,18 @@
+2009-04-23  DJ Delorie  <dj@redhat.com>
+
+       * lib/target-supports.exp (check_effective_target_double64): New.
+       (check_effective_target_double64plus): New.
+       (check_effective_target_large_double): New.
+       * gcc.dg/Wconversion-real-integer.c: Require double64plus.
+       * gcc.dg/div-double-1.c: Likewise.
+       * gcc.dg/Wconversion-real.c: Require large_double.
+       * gcc.dg/cdce1.c: Require large_double instead of checking targets.
+
+       * gcc.c-torture/execute/ieee/unsafe-fp-assoc-1.c: Skip if doubles are too small.
+
+       * gcc.c-torture/execute/ieee/20010226-1.c: Mark all floating point
+       constants as long.
+
 2009-04-27  Ian Lance Taylor  <iant@google.com>
 
        * gcc.dg/Wcxx-compat-5.c: New testcase.
index daa2745..ec292ac 100644 (file)
@@ -1,6 +1,6 @@
 #include <float.h>
 
-long double dfrom = 1.1;
+long double dfrom = 1.1L;
 long double m1;
 long double m2;
 unsigned long mant_long;
@@ -13,8 +13,8 @@ int main()
   if (LDBL_EPSILON > 0x1p-31L)
     return 0;
 
-  m1 = dfrom / 2.0;
-  m2 = m1 * 4294967296.0;
+  m1 = dfrom / 2.0L;
+  m2 = m1 * 4294967296.0L;
   mant_long = ((unsigned long) m2) & 0xffffffff;
 
   if (mant_long == 0x8ccccccc)
index c15653c..7021b99 100644 (file)
@@ -32,6 +32,8 @@ void func ( double x )
 
 int main()
 {
+       if (sizeof (double) == 4)
+               return 0;
        func((double)1.00);
        return 0;
 }
index 1625fc0..c61ea70 100644 (file)
@@ -5,6 +5,7 @@
 /* { dg-skip-if "doubles are floats,ints are 16bits" { "avr-*-*" } { "*" } { "" } } */
 /* { dg-options "-std=c99 -Wconversion" } */
 /* { dg-require-effective-target int32plus } */
+/* { dg-require-effective-target double64plus } */
 #include <limits.h>
 
 void fsi (signed int x);
index 06396fb..ed7371b 100644 (file)
@@ -3,6 +3,7 @@
 /* { dg-do compile } */
 /* { dg-skip-if "doubles are floats" { "avr-*-*" } { "*" } { "" } } */
 /* { dg-options "-std=c99 -Wconversion" } */
+/* { dg-require-effective-target large_double } */
 
 float  vfloat;
 double vdouble;
index dda5020..3bd35ec 100644 (file)
@@ -1,8 +1,8 @@
 /* { dg-do  run  } */
-/* { dg-skip-if "doubles are floats" { "avr-*-*" "m32c-*-*" } { "*" } { "" } } */
 /* { dg-options "-O2 -fmath-errno -fdump-tree-cdce-details  -lm" } */
 /* { dg-final { scan-tree-dump  "cdce1.c:16: note: function call is shrink-wrapped into error conditions\."  "cdce" } } */
 /* { dg-final { cleanup-tree-dump "cdce" } } */
+/* { dg-require-effective-target large_double } */
 
 #include <stdlib.h>
 #include <math.h>
index 0cb8268..f290ab0 100644 (file)
@@ -1,5 +1,6 @@
 /* { dg-do run } */
 /* { dg-options "-O2 -ffinite-math-only" } */
+/* { dg-require-effective-target double64plus } */
 
 extern void abort (void);
 
index 884e743..cf1ed86 100644 (file)
@@ -1194,6 +1194,33 @@ proc check_effective_target_large_long_double { } {
     }]
 }
 
+# Return 1 if the target supports double larger than float,
+# 0 otherwise.
+
+proc check_effective_target_large_double { } {
+    return [check_no_compiler_messages large_double object {
+       int dummy[sizeof(double) > sizeof(float) ? 1 : -1];
+    }]
+}
+
+# Return 1 if the target supports double of 64 bits,
+# 0 otherwise.
+
+proc check_effective_target_double64 { } {
+    return [check_no_compiler_messages double64 object {
+       int dummy[sizeof(double) == 8 ? 1 : -1];
+    }]
+}
+
+# Return 1 if the target supports double of at least 64 bits,
+# 0 otherwise.
+
+proc check_effective_target_double64plus { } {
+    return [check_no_compiler_messages double64plus object {
+       int dummy[sizeof(double) >= 8 ? 1 : -1];
+    }]
+}
+
 # Return 1 if the target supports compiling fixed-point,
 # 0 otherwise.