(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
+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.
#include <float.h>
-long double dfrom = 1.1;
+long double dfrom = 1.1L;
long double m1;
long double m2;
unsigned long mant_long;
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)
int main()
{
+ if (sizeof (double) == 4)
+ return 0;
func((double)1.00);
return 0;
}
/* { 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);
/* { 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;
/* { 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>
/* { dg-do run } */
/* { dg-options "-O2 -ffinite-math-only" } */
+/* { dg-require-effective-target double64plus } */
extern void abort (void);
}]
}
+# 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.