target-supports.exp (check_effective_target_double64): New.

* 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.

From-SVN: r146863
This commit is contained in:
DJ Delorie 2009-04-27 19:27:21 -04:00 committed by DJ Delorie
parent 1883802f28
commit fb4fc71466
8 changed files with 51 additions and 4 deletions

View 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.

View 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)

View file

@ -32,6 +32,8 @@ void func ( double x )
int main()
{
if (sizeof (double) == 4)
return 0;
func((double)1.00);
return 0;
}

View 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);

View 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;

View 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>

View file

@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-options "-O2 -ffinite-math-only" } */
/* { dg-require-effective-target double64plus } */
extern void abort (void);

View 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.