aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/testsuite/ChangeLog15
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/ieee/20010226-1.c6
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/ieee/unsafe-fp-assoc-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/Wconversion-real-integer.c1
-rw-r--r--gcc/testsuite/gcc.dg/Wconversion-real.c1
-rw-r--r--gcc/testsuite/gcc.dg/cdce1.c2
-rw-r--r--gcc/testsuite/gcc.dg/div-double-1.c1
-rw-r--r--gcc/testsuite/lib/target-supports.exp27
8 files changed, 51 insertions, 4 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index aa164b2..d7668c4 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -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.
diff --git a/gcc/testsuite/gcc.c-torture/execute/ieee/20010226-1.c b/gcc/testsuite/gcc.c-torture/execute/ieee/20010226-1.c
index daa2745..ec292ac 100644
--- a/gcc/testsuite/gcc.c-torture/execute/ieee/20010226-1.c
+++ b/gcc/testsuite/gcc.c-torture/execute/ieee/20010226-1.c
@@ -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)
diff --git a/gcc/testsuite/gcc.c-torture/execute/ieee/unsafe-fp-assoc-1.c b/gcc/testsuite/gcc.c-torture/execute/ieee/unsafe-fp-assoc-1.c
index c15653c..7021b99 100644
--- a/gcc/testsuite/gcc.c-torture/execute/ieee/unsafe-fp-assoc-1.c
+++ b/gcc/testsuite/gcc.c-torture/execute/ieee/unsafe-fp-assoc-1.c
@@ -32,6 +32,8 @@ void func ( double x )
int main()
{
+ if (sizeof (double) == 4)
+ return 0;
func((double)1.00);
return 0;
}
diff --git a/gcc/testsuite/gcc.dg/Wconversion-real-integer.c b/gcc/testsuite/gcc.dg/Wconversion-real-integer.c
index 1625fc0..c61ea70 100644
--- a/gcc/testsuite/gcc.dg/Wconversion-real-integer.c
+++ b/gcc/testsuite/gcc.dg/Wconversion-real-integer.c
@@ -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);
diff --git a/gcc/testsuite/gcc.dg/Wconversion-real.c b/gcc/testsuite/gcc.dg/Wconversion-real.c
index 06396fb..ed7371b 100644
--- a/gcc/testsuite/gcc.dg/Wconversion-real.c
+++ b/gcc/testsuite/gcc.dg/Wconversion-real.c
@@ -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;
diff --git a/gcc/testsuite/gcc.dg/cdce1.c b/gcc/testsuite/gcc.dg/cdce1.c
index dda5020..3bd35ec 100644
--- a/gcc/testsuite/gcc.dg/cdce1.c
+++ b/gcc/testsuite/gcc.dg/cdce1.c
@@ -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>
diff --git a/gcc/testsuite/gcc.dg/div-double-1.c b/gcc/testsuite/gcc.dg/div-double-1.c
index 0cb8268..f290ab0 100644
--- a/gcc/testsuite/gcc.dg/div-double-1.c
+++ b/gcc/testsuite/gcc.dg/div-double-1.c
@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-options "-O2 -ffinite-math-only" } */
+/* { dg-require-effective-target double64plus } */
extern void abort (void);
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index 884e743d..cf1ed86 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -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.