diff options
120 files changed, 529 insertions, 860 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 5730da14617..7b240a8c65a 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,126 @@ +2009-09-16 Janis Johnson <janis187@us.ibm.com> + + * gcc.dg/dfp/dfp.exp: Use appropriate default options. + * gcc.dg/dfp/dfp-dbg.h: New; define FAILURE, FINISH. + * gcc.dg/dfp/cast-bad.c: Use default options. + * gcc.dg/dfp/compare-rel-const.c: Ditto. + * gcc.dg/dfp/composite-type.c: Ditto. + * gcc.dg/dfp/constants.c: Ditto. + * gcc.dg/dfp/constants-hex.c: Ditto. + * gcc.dg/dfp/constants-pedantic.c: Ditto. + * gcc.dg/dfp/convert-bfp-fold.c: Ditto. + * gcc.dg/dfp/convert-dfp-fold.c: Ditto. + * gcc.dg/dfp/convert-int-max-fold.c: Ditto. + * gcc.dg/dfp/ctypes.c: Ditto. + * gcc.dg/dfp/ddmode-ice.c: Ditto. + * gcc.dg/dfp/dec-eval-method-2.c: Ditto. + * gcc.dg/dfp/float-constant-double.c: Ditto. + * gcc.dg/dfp/keywords-pedantic.c: Ditto. + * gcc.dg/dfp/keywords-reserved.c: Ditto. + * gcc.dg/dfp/modes.c: Ditto. + * gcc.dg/dfp/operator-bitwise.c: Ditto. + * gcc.dg/dfp/pr31344.c: Ditto. + * gcc.dg/dfp/pr31385.c: Ditto. + * gcc.dg/dfp/pr33466.c: Ditto. + * gcc.dg/dfp/pr35620.c: Ditto. + * gcc.dg/dfp/pr37435.c: Ditto. + * gcc.dg/dfp/pr39986.c: Ditto. + * gcc.dg/dfp/pragma-float-const-decimal64-1.c: Ditto. + * gcc.dg/dfp/pragma-float-const-decimal64-2.c: Ditto. + * gcc.dg/dfp/pragma-float-const-decimal64-3.c: Ditto. + * gcc.dg/dfp/pragma-float-const-decimal64-4.c: Ditto. + * gcc.dg/dfp/pragma-float-const-decimal64-7.c: Ditto. + * gcc.dg/dfp/pragma-float-const-decimal64-8.c: Ditto. + * gcc.dg/dfp/typespec.c: Ditto. + * gcc.dg/dfp/usual-arith-conv-bad.c: Ditto. + * gcc.dg/dfp/usual-arith-conv-bad-2.c: Ditto. + * gcc.dg/dfp/usual-arith-conv-const.c: Ditto. + * gcc.dg/dfp/Wbad-function-cast-1.c: Ditto. + * gcc.dg/dfp/Wtraditional-conversion-2.c: Ditto. + * gcc.dg/dfp/wtr-conversion-1.c: Ditto. + * gcc.dg/dfp/compare-eq.h: Define custom debug macros. + * gcc.dg/dfp/compare-rel.h: Ditto. + * gcc.dg/dfp/compare-special.h: Ditto. + * gcc.dg/dfp/convert.h: Ditto. + * gcc.dg/dfp/fe-check.h: Ditto. + * gcc.dg/dfp/call-by-value.c: Use default options and + debug macros. + * gcc.dg/dfp/cast.c: Ditto. + * gcc.dg/dfp/compare-eq-const.c: Ditto. + * gcc.dg/dfp/compare-eq-d32.c: Ditto. + * gcc.dg/dfp/compare-eq-d64.c: Ditto. + * gcc.dg/dfp/compare-eq-d128.c: Ditto. + * gcc.dg/dfp/compare-eq-dfp.c: Ditto. + * gcc.dg/dfp/compare-rel-d32.c: Ditto. + * gcc.dg/dfp/compare-rel-d64.c: Ditto. + * gcc.dg/dfp/compare-rel-d128.c: Ditto. + * gcc.dg/dfp/compare-rel-dfp.c: Ditto. + * gcc.dg/dfp/compare-special-d32.c: Ditto. + * gcc.dg/dfp/compare-special-d64.c: Ditto. + * gcc.dg/dfp/compare-special-d128.c: Ditto. + * gcc.dg/dfp/constants-zero.c: Ditto. + * gcc.dg/dfp/convert-bfp-2.c: Ditto. + * gcc.dg/dfp/convert-bfp-3.c: Ditto. + * gcc.dg/dfp/convert-bfp-4.c: Ditto. + * gcc.dg/dfp/convert-bfp-5.c: Ditto. + * gcc.dg/dfp/convert-bfp-6.c: Ditto. + * gcc.dg/dfp/convert-bfp-7.c: Ditto. + * gcc.dg/dfp/convert-bfp-8.c: Ditto. + * gcc.dg/dfp/convert-bfp-9.c: Ditto. + * gcc.dg/dfp/convert-bfp-10.c: Ditto. + * gcc.dg/dfp/convert-bfp-11.c: Ditto. + * gcc.dg/dfp/convert-bfp-12.c: Ditto. + * gcc.dg/dfp/convert-bfp-13.c: Ditto. + * gcc.dg/dfp/convert-bfp-14.c: Ditto. + * gcc.dg/dfp/convert-bfp.c: Ditto. + * gcc.dg/dfp/convert-complex.c: Ditto. + * gcc.dg/dfp/convert-dfp.c: Ditto. + * gcc.dg/dfp/convert-dfp-fold-2.c: Ditto. + * gcc.dg/dfp/convert-dfp-round.c: Ditto. + * gcc.dg/dfp/convert-int.c: Ditto. + * gcc.dg/dfp/convert-int-fold.c: Ditto. + * gcc.dg/dfp/convert-int-max.c: Ditto. + * gcc.dg/dfp/convert-int-saturate.c: Ditto. + * gcc.dg/dfp/decfloat-constants.c: Ditto. + * gcc.dg/dfp/fe-binop.c: Ditto. + * gcc.dg/dfp/fe-convert-1.c: Ditto. + * gcc.dg/dfp/fe-convert-2.c: Ditto. + * gcc.dg/dfp/fe-convert-3.c: Ditto. + * gcc.dg/dfp/func-array.c: Ditto. + * gcc.dg/dfp/func-deref.c: Ditto. + * gcc.dg/dfp/func-mixed.c: Ditto. + * gcc.dg/dfp/func-pointer.c: Ditto. + * gcc.dg/dfp/func-scalar.c: Ditto. + * gcc.dg/dfp/func-struct.c: Ditto. + * gcc.dg/dfp/func-vararg-alternate.h: Ditto. + * gcc.dg/dfp/func-vararg-alternate-d32.c: Ditto. + * gcc.dg/dfp/func-vararg-alternate-d64.c: Ditto. + * gcc.dg/dfp/func-vararg-alternate-d128.c: Ditto. + * gcc.dg/dfp/func-vararg-alternate-d128-2.c: Ditto. + * gcc.dg/dfp/func-vararg-dfp.c: Ditto. + * gcc.dg/dfp/func-vararg-mixed.c: Ditto. + * gcc.dg/dfp/func-vararg-mixed-2.c: Ditto. + * gcc.dg/dfp/func-vararg-size0.c: Ditto. + * gcc.dg/dfp/inf-1.c: Ditto. + * gcc.dg/dfp/loop-index.c: Ditto. + * gcc.dg/dfp/nan-1.c: Ditto. + * gcc.dg/dfp/nan-2.c: Ditto. + * gcc.dg/dfp/operator-arith-fold.c: Ditto. + * gcc.dg/dfp/operator-assignment.c: Ditto. + * gcc.dg/dfp/operator-comma.c: Ditto. + * gcc.dg/dfp/operator-cond.c: Ditto. + * gcc.dg/dfp/operator-logical.c: Ditto. + * gcc.dg/dfp/operator-unary.c: Ditto. + * gcc.dg/dfp/pr36800.c: Ditto. + * gcc.dg/dfp/pr39034.c: Ditto. + * gcc.dg/dfp/pr39035.c: Ditto. + * gcc.dg/dfp/pr39902.c: Ditto. + * gcc.dg/dfp/signbit-1.c: Ditto. + * gcc.dg/dfp/signbit-2.c: Ditto. + * gcc.dg/dfp/struct-layout-1.c: Ditto. + * gcc.dg/dfp/union-init.c: Ditto. + * gcc.dg/dfp/usual-arith-conv.c: Ditto. + 2009-09-16 Michael Matz <matz@suse.de> PR fortran/41212 diff --git a/gcc/testsuite/gcc.dg/dfp/Wbad-function-cast-1.c b/gcc/testsuite/gcc.dg/dfp/Wbad-function-cast-1.c index 95e8ce19810..99d8f0655d7 100644 --- a/gcc/testsuite/gcc.dg/dfp/Wbad-function-cast-1.c +++ b/gcc/testsuite/gcc.dg/dfp/Wbad-function-cast-1.c @@ -2,7 +2,7 @@ /* Based on gcc.dg/Wbad-function-cast-1.c. */ /* { dg-do compile } */ -/* { dg-options "-std=gnu99 -Wbad-function-cast" } */ +/* { dg-options "-Wbad-function-cast" } */ int if1(void); char if2(void); diff --git a/gcc/testsuite/gcc.dg/dfp/Wtraditional-conversion-2.c b/gcc/testsuite/gcc.dg/dfp/Wtraditional-conversion-2.c index 7e0d3ad994c..2436afc8ae5 100644 --- a/gcc/testsuite/gcc.dg/dfp/Wtraditional-conversion-2.c +++ b/gcc/testsuite/gcc.dg/dfp/Wtraditional-conversion-2.c @@ -2,7 +2,7 @@ (based on gcc.dg/Wtraditional-conversion-2.c). */ /* { dg-do compile } */ -/* { dg-options "-std=gnu99 -Wtraditional-conversion" } */ +/* { dg-options "-Wtraditional-conversion" } */ void fsi(signed int); void fd32(_Decimal32); diff --git a/gcc/testsuite/gcc.dg/dfp/call-by-value.c b/gcc/testsuite/gcc.dg/dfp/call-by-value.c index 4232a30186c..74aec53aefb 100644 --- a/gcc/testsuite/gcc.dg/dfp/call-by-value.c +++ b/gcc/testsuite/gcc.dg/dfp/call-by-value.c @@ -1,11 +1,9 @@ -/* { dg-options "-std=gnu99" } */ - /* C99 6.9.1(9) Function definitions; parameter has automatic storage. Test that actual parameters are passed by value and that modifications made within functions are lost on function return. */ -extern void abort (void); +#include "dfp-dbg.h" int foo32 (_Decimal32 z) { @@ -31,15 +29,15 @@ main () foo32 (d32); if (d32 != 1.1df) - abort (); + FAILURE foo64 (d64); if (d64 != 1.2dd) - abort (); + FAILURE foo128 (d128); if (d128 != 1.3dl) - abort (); + FAILURE - return 0; + FINISH } diff --git a/gcc/testsuite/gcc.dg/dfp/cast-bad.c b/gcc/testsuite/gcc.dg/dfp/cast-bad.c index e99180824fe..e9e31ff3067 100644 --- a/gcc/testsuite/gcc.dg/dfp/cast-bad.c +++ b/gcc/testsuite/gcc.dg/dfp/cast-bad.c @@ -1,5 +1,4 @@ /* { dg-do compile } */ -/* { dg-options "-std=gnu99" } */ /* C99 6.5.4 Cast operators. Test invalid casts involving decimal float. */ diff --git a/gcc/testsuite/gcc.dg/dfp/cast.c b/gcc/testsuite/gcc.dg/dfp/cast.c index 1e88bee7c8e..b6585d70c8b 100644 --- a/gcc/testsuite/gcc.dg/dfp/cast.c +++ b/gcc/testsuite/gcc.dg/dfp/cast.c @@ -1,17 +1,7 @@ -/* { dg-options "-std=gnu99" } */ - /* C99 6.5.4 Cast operators. Test valid casts involving decimal float. */ -extern void abort (void); -int failcnt; - -#ifdef DBG -extern int printf (const char *, ...); -#define FAILURE { printf ("failed at line %d\n", __LINE__); failcnt++; } -#else -#define FAILURE abort (); -#endif +#include "dfp-dbg.h" _Decimal32 d32; _Decimal64 d64; @@ -81,8 +71,5 @@ main (void) if (d128 != (_Decimal128) d) FAILURE - if (failcnt != 0) - abort (); - - return 0; + FINISH } diff --git a/gcc/testsuite/gcc.dg/dfp/compare-eq-const.c b/gcc/testsuite/gcc.dg/dfp/compare-eq-const.c index dd295200f2a..0c9ff200b28 100644 --- a/gcc/testsuite/gcc.dg/dfp/compare-eq-const.c +++ b/gcc/testsuite/gcc.dg/dfp/compare-eq-const.c @@ -1,8 +1,8 @@ -/* { dg-options "-std=gnu99" } */ - /* C99 6.5.9 Equality operators. Compare decimal float constants against each other. */ +#include "dfp-dbg.h" + extern void link_error (void); int @@ -24,5 +24,5 @@ main () if (1.4dd + 1.4dd + 1.4dd != 4.2dd) link_error (); - return 0; + FINISH } diff --git a/gcc/testsuite/gcc.dg/dfp/compare-eq-d128.c b/gcc/testsuite/gcc.dg/dfp/compare-eq-d128.c index 158e2f90ba5..79fcac3195e 100644 --- a/gcc/testsuite/gcc.dg/dfp/compare-eq-d128.c +++ b/gcc/testsuite/gcc.dg/dfp/compare-eq-d128.c @@ -1,4 +1,4 @@ -/* { dg-options "-std=gnu99 -O0" } */ +/* { dg-options "-O0" } */ /* C99 6.5.9 Equality operators. Compare decimal float values against each other at runtime. */ @@ -9,5 +9,6 @@ int main () { test_compares (); - return 0; + + FINISH } diff --git a/gcc/testsuite/gcc.dg/dfp/compare-eq-d32.c b/gcc/testsuite/gcc.dg/dfp/compare-eq-d32.c index d5e3bb378c9..6b1a4c6d7c4 100644 --- a/gcc/testsuite/gcc.dg/dfp/compare-eq-d32.c +++ b/gcc/testsuite/gcc.dg/dfp/compare-eq-d32.c @@ -1,4 +1,4 @@ -/* { dg-options "-std=gnu99 -O0" } */ +/* { dg-options "-O0" } */ /* C99 6.5.9 Equality operators. Compare decimal float values against each other at runtime. */ @@ -9,5 +9,6 @@ int main () { test_compares (); - return 0; + + FINISH } diff --git a/gcc/testsuite/gcc.dg/dfp/compare-eq-d64.c b/gcc/testsuite/gcc.dg/dfp/compare-eq-d64.c index 8fa39dfcd8f..f1b463ebe6a 100644 --- a/gcc/testsuite/gcc.dg/dfp/compare-eq-d64.c +++ b/gcc/testsuite/gcc.dg/dfp/compare-eq-d64.c @@ -1,4 +1,4 @@ -/* { dg-options "-std=gnu99 -O0" } */ +/* { dg-options "-O0" } */ /* C99 6.5.9 Equality operators. Compare decimal float values against each other at runtime. */ @@ -9,5 +9,6 @@ int main () { test_compares (); - return 0; + + FINISH } diff --git a/gcc/testsuite/gcc.dg/dfp/compare-eq-dfp.c b/gcc/testsuite/gcc.dg/dfp/compare-eq-dfp.c index 4203470a4be..79a5691ebfc 100644 --- a/gcc/testsuite/gcc.dg/dfp/compare-eq-dfp.c +++ b/gcc/testsuite/gcc.dg/dfp/compare-eq-dfp.c @@ -1,19 +1,9 @@ -/* { dg-options "-std=gnu99 -O0" } */ +/* { dg-options "-O0" } */ /* C99 6.5.9 Equality operators. Compare decimal float values against variables of different types. */ -extern void abort (void); -static int failcnt; - -/* Support compiling the test to report individual failures; default is - to abort as soon as a check fails. */ -#ifdef DBG -#include <stdio.h> -#define FAILURE { printf ("failed at line %d\n", __LINE__); failcnt++; } -#else -#define FAILURE abort (); -#endif +#include "dfp-dbg.h" _Decimal32 d32; _Decimal64 d64; @@ -59,7 +49,5 @@ main () compare_dfp (); - if (failcnt) - abort (); - return 0; + FINISH } diff --git a/gcc/testsuite/gcc.dg/dfp/compare-eq.h b/gcc/testsuite/gcc.dg/dfp/compare-eq.h index 809d642593c..830b3289bde 100644 --- a/gcc/testsuite/gcc.dg/dfp/compare-eq.h +++ b/gcc/testsuite/gcc.dg/dfp/compare-eq.h @@ -2,19 +2,18 @@ are not affected by rounding. */ #include <stdlib.h> - -static int failcnt; +#include "dfp-dbg.h" #define PASTE2(A,B) A ## B #define PASTE(A,B) PASTE2(A,B) +#undef FAILURE #ifdef DBG -#include <stdio.h> #define FAILURE(OP,KIND) \ { printf ("failed at line %d: %s for %s values\n", __LINE__, OP, KIND); \ - failcnt++; } + failures++; } #else -#define FAILURE(OP,KIND) abort (); +#define FAILURE(OP,KIND) __builtin_abort (); #endif #ifndef WIDTH @@ -90,7 +89,4 @@ test_compares (void) if (! (x != zero)) FAILURE ("!=", "greater") if (! (y != m_one)) FAILURE ("!=", "greater") if (! (z != m_two)) FAILURE ("!=", "greater") - - if (failcnt) - abort (); } diff --git a/gcc/testsuite/gcc.dg/dfp/compare-rel-const.c b/gcc/testsuite/gcc.dg/dfp/compare-rel-const.c index d2dda48e614..8e99b4466dc 100644 --- a/gcc/testsuite/gcc.dg/dfp/compare-rel-const.c +++ b/gcc/testsuite/gcc.dg/dfp/compare-rel-const.c @@ -1,5 +1,3 @@ -/* { dg-options "-std=gnu99" } */ - /* C99 6.5.8 Relational operators. Compare decimal float constants against each other. */ diff --git a/gcc/testsuite/gcc.dg/dfp/compare-rel-d128.c b/gcc/testsuite/gcc.dg/dfp/compare-rel-d128.c index 0d46925c2bb..38c931a0207 100644 --- a/gcc/testsuite/gcc.dg/dfp/compare-rel-d128.c +++ b/gcc/testsuite/gcc.dg/dfp/compare-rel-d128.c @@ -1,4 +1,4 @@ -/* { dg-options "-std=gnu99 -O0" } */ +/* { dg-options "-O0" } */ /* C99 6.5.8 Relational operators. Compare decimal float values against each other at runtime. */ @@ -10,5 +10,5 @@ int main () { test_compares (); - return 0; + FINISH } diff --git a/gcc/testsuite/gcc.dg/dfp/compare-rel-d32.c b/gcc/testsuite/gcc.dg/dfp/compare-rel-d32.c index 257a3c2b4df..04128aab924 100644 --- a/gcc/testsuite/gcc.dg/dfp/compare-rel-d32.c +++ b/gcc/testsuite/gcc.dg/dfp/compare-rel-d32.c @@ -1,4 +1,4 @@ -/* { dg-options "-std=gnu99 -O0" } */ +/* { dg-options "-O0" } */ /* C99 6.5.8 Relational operators. Compare decimal float values against each other at runtime. */ @@ -10,5 +10,5 @@ int main () { test_compares (); - return 0; + FINISH } diff --git a/gcc/testsuite/gcc.dg/dfp/compare-rel-d64.c b/gcc/testsuite/gcc.dg/dfp/compare-rel-d64.c index 73cbcee44d7..92f904a8154 100644 --- a/gcc/testsuite/gcc.dg/dfp/compare-rel-d64.c +++ b/gcc/testsuite/gcc.dg/dfp/compare-rel-d64.c @@ -1,4 +1,4 @@ -/* { dg-options "-std=gnu99 -O0" } */ +/* { dg-options "-O0" } */ /* C99 6.5.8 Relational operators. Compare decimal float values against each other at runtime. */ @@ -10,5 +10,5 @@ int main () { test_compares (); - return 0; + FINISH } diff --git a/gcc/testsuite/gcc.dg/dfp/compare-rel-dfp.c b/gcc/testsuite/gcc.dg/dfp/compare-rel-dfp.c index 58523b6ab02..59cc2035306 100644 --- a/gcc/testsuite/gcc.dg/dfp/compare-rel-dfp.c +++ b/gcc/testsuite/gcc.dg/dfp/compare-rel-dfp.c @@ -1,19 +1,9 @@ -/* { dg-options "-std=gnu99 -O0" } */ +/* { dg-options "-O0" } */ /* C99 6.5.8 Relational operators. Compare decimal float values against variables of different types. */ -extern void abort (void); -static int failcnt; - -/* Support compiling the test to report individual failures; default is - to abort as soon as a check fails. */ -#ifdef DBG -#include <stdio.h> -#define FAILURE { printf ("failed at line %d\n", __LINE__); failcnt++; } -#else -#define FAILURE abort (); -#endif +#include "dfp-dbg.h" _Decimal32 d32; _Decimal64 d64; @@ -59,7 +49,5 @@ main () compare_dfp (); - if (failcnt) - abort (); - return 0; + FINISH } diff --git a/gcc/testsuite/gcc.dg/dfp/compare-rel.h b/gcc/testsuite/gcc.dg/dfp/compare-rel.h index 06b2559bdb5..7840108142d 100644 --- a/gcc/testsuite/gcc.dg/dfp/compare-rel.h +++ b/gcc/testsuite/gcc.dg/dfp/compare-rel.h @@ -2,21 +2,20 @@ are not affected by rounding. */ #include <stdlib.h> +#include "dfp-dbg.h" -static int failcnt; - -#define PASTE2(A,B) A ## B -#define PASTE(A,B) PASTE2(A,B) - +#undef FAILURE #ifdef DBG -#include <stdio.h> #define FAILURE(OP,KIND) \ { printf ("failed at line %d: %s for %s values\n", __LINE__, OP, KIND); \ - failcnt++; } + failures++; } #else -#define FAILURE(OP,KIND) abort (); +#define FAILURE(OP,KIND) __builtin_abort (); #endif +#define PASTE2(A,B) A ## B +#define PASTE(A,B) PASTE2(A,B) + #ifndef WIDTH #error define WIDTH as decimal float size in bytes #endif @@ -130,7 +129,4 @@ test_compares (void) if (y > one) FAILURE (">", "greater") if (z > zero) FAILURE (">", "greater") if (z > one) FAILURE (">", "greater") - - if (failcnt) - abort (); } diff --git a/gcc/testsuite/gcc.dg/dfp/compare-special-d128.c b/gcc/testsuite/gcc.dg/dfp/compare-special-d128.c index cef4670b766..d1f5bc5edd4 100644 --- a/gcc/testsuite/gcc.dg/dfp/compare-special-d128.c +++ b/gcc/testsuite/gcc.dg/dfp/compare-special-d128.c @@ -1,4 +1,4 @@ -/* { dg-options "-std=gnu99 -O0" } */ +/* { dg-options "-O0" } */ /* C99 6.5.8 Relational operators. C99 6.5.9 Equality operators. @@ -11,5 +11,5 @@ int main () { test_compares (); - return 0; + FINISH } diff --git a/gcc/testsuite/gcc.dg/dfp/compare-special-d32.c b/gcc/testsuite/gcc.dg/dfp/compare-special-d32.c index fa91d7edd33..377c65a5bb7 100644 --- a/gcc/testsuite/gcc.dg/dfp/compare-special-d32.c +++ b/gcc/testsuite/gcc.dg/dfp/compare-special-d32.c @@ -1,4 +1,4 @@ -/* { dg-options "-std=gnu99 -O0" } */ +/* { dg-options "-O0" } */ /* C99 6.5.8 Relational operators. C99 6.5.9 Equality operators. @@ -11,5 +11,5 @@ int main () { test_compares (); - return 0; + FINISH } diff --git a/gcc/testsuite/gcc.dg/dfp/compare-special-d64.c b/gcc/testsuite/gcc.dg/dfp/compare-special-d64.c index 2238e0190e3..16154eff323 100644 --- a/gcc/testsuite/gcc.dg/dfp/compare-special-d64.c +++ b/gcc/testsuite/gcc.dg/dfp/compare-special-d64.c @@ -1,4 +1,4 @@ -/* { dg-options "-std=gnu99 -O0" } */ +/* { dg-options "-O0" } */ /* C99 6.5.8 Relational operators. C99 6.5.9 Equality operators. @@ -11,5 +11,5 @@ int main () { test_compares (); - return 0; + FINISH } diff --git a/gcc/testsuite/gcc.dg/dfp/compare-special.h b/gcc/testsuite/gcc.dg/dfp/compare-special.h index c5bef234424..9c27d126c29 100644 --- a/gcc/testsuite/gcc.dg/dfp/compare-special.h +++ b/gcc/testsuite/gcc.dg/dfp/compare-special.h @@ -1,19 +1,19 @@ /* Basic test of runtime relational comparisons using NaNs and infinities. */ #include <stdlib.h> - -static int failcnt; +#include "dfp-dbg.h" #define PASTE2(A,B) A ## B #define PASTE(A,B) PASTE2(A,B) +/* Override FAILURE from dfp-dbg.h with one that provides additional info. */ +#undef FAILURE #ifdef DBG -#include <stdio.h> #define FAILURE(OP,KIND) \ { printf ("failed at line %d: %s for %s values\n", __LINE__, OP, KIND); \ - failcnt++; } + failures++; } #else -#define FAILURE(OP,KIND) abort (); +#define FAILURE(OP,KIND) __builtin_abort (); #endif #ifndef WIDTH @@ -281,7 +281,4 @@ test_compares (void) if (!(y != m_inf)) FAILURE ("!=", "inf") if (!(z != inf)) FAILURE ("!=", "inf") if (z != m_inf) FAILURE ("!=", "inf") - - if (failcnt) - abort (); } diff --git a/gcc/testsuite/gcc.dg/dfp/composite-type.c b/gcc/testsuite/gcc.dg/dfp/composite-type.c index 2abc8217595..508ebbd5e29 100644 --- a/gcc/testsuite/gcc.dg/dfp/composite-type.c +++ b/gcc/testsuite/gcc.dg/dfp/composite-type.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-std=gnu99 -O -Wall" } */ +/* { dg-options "-O -Wall" } */ /* C99 6.2.7: Compatible type and composite type. */ diff --git a/gcc/testsuite/gcc.dg/dfp/constants-hex.c b/gcc/testsuite/gcc.dg/dfp/constants-hex.c index 936f0ed8481..980eae012a8 100644 --- a/gcc/testsuite/gcc.dg/dfp/constants-hex.c +++ b/gcc/testsuite/gcc.dg/dfp/constants-hex.c @@ -1,5 +1,4 @@ /* { dg-do compile } */ -/* { dg-options "-std=gnu99" } */ /* N1150 6: Constants. C99 6.4.4.2: Floating constants. diff --git a/gcc/testsuite/gcc.dg/dfp/constants-pedantic.c b/gcc/testsuite/gcc.dg/dfp/constants-pedantic.c index 540b7684035..be81b0fc44a 100644 --- a/gcc/testsuite/gcc.dg/dfp/constants-pedantic.c +++ b/gcc/testsuite/gcc.dg/dfp/constants-pedantic.c @@ -1,9 +1,11 @@ /* { dg-do compile } */ -/* { dg-options "-std=gnu99 -pedantic" } */ +/* { dg-options "-pedantic" } */ /* N1150 6: Constants. C99 6.4.4.2: Floating constants. */ +#include "dfp-dbg.h" + _Decimal32 a = 1.1df; /* { dg-warning "GCC extension|ISO C" } */ _Decimal32 b = -.003DF; /* { dg-warning "GCC extension|ISO C" } */ _Decimal64 c = 11e-1dl; /* { dg-warning "GCC extension|ISO C" } */ diff --git a/gcc/testsuite/gcc.dg/dfp/constants-zero.c b/gcc/testsuite/gcc.dg/dfp/constants-zero.c index e0db28cc38f..64b0054d2d3 100644 --- a/gcc/testsuite/gcc.dg/dfp/constants-zero.c +++ b/gcc/testsuite/gcc.dg/dfp/constants-zero.c @@ -1,10 +1,10 @@ -/* { dg-options "-std=gnu99 -O0" } */ +/* { dg-options "-O0" } */ /* Decimal float values can have significant trailing zeroes. This is true for zero values as well. Check that various representations of zero are handled correctly when specified as literal constants. */ -extern void abort (void); +#include "dfp-dbg.h" int big_endian; @@ -58,74 +58,74 @@ void dpd_tests (void) { if (! compare32 (0.DF, 0x22500000U)) - abort (); + FAILURE if (! compare32 (-0.DF, 0xa2500000U)) - abort (); + FAILURE if (! compare32 (0.E-4DF, 0x22100000U)) - abort (); + FAILURE if (! compare32 (0.E-7DF, 0x21e00000U)) - abort (); + FAILURE if (! compare32 (0.E+3DF, 0x22800000U)) - abort (); + FAILURE if (! compare64 (0.DD, 0x2238000000000000ULL)) - abort (); + FAILURE if (! compare64 (-0.DD, 0xa238000000000000ULL)) - abort (); + FAILURE if (! compare64 (0.E-6DD, 0x2220000000000000ULL)) - abort (); + FAILURE if (! compare64 (0.E-7DD, 0x221c000000000000ULL)) - abort (); + FAILURE if (! compare64 (0.E+2DD, 0x2240000000000000ULL)) - abort (); + FAILURE if (! compare128 (0.DL, 0x2208000000000000ULL, 0x0000000000000000ULL)) - abort (); + FAILURE if (! compare128 (-0.DL, 0xa208000000000000ULL, 0x0000000000000000ULL)) - abort (); + FAILURE if (! compare128 (0.E-3DL, 0x2207400000000000ULL, 0x0000000000000000ULL)) - abort (); + FAILURE if (! compare128 (0.E-8DL, 0x2206000000000000ULL, 0x0000000000000000ULL)) - abort (); + FAILURE if (! compare128 (0.E+2DL, 0x2208800000000000ULL, 0x0000000000000000ULL)) - abort (); + FAILURE } void bid_tests (void) { if (! compare32 (0.DF, 0x32800000U)) - abort (); + FAILURE if (! compare32 (-0.DF, 0xb2800000U)) - abort (); + FAILURE if (! compare32 (0.E-4DF, 0x30800000U)) - abort (); + FAILURE if (! compare32 (0.E-7DF, 0x2f000000U)) - abort (); + FAILURE if (! compare32 (0.E+3DF, 0x34000000U)) - abort (); + FAILURE if (! compare64 (0.DD, 0x31c0000000000000ULL)) - abort (); + FAILURE if (! compare64 (-0.DD, 0xb1c0000000000000ULL)) - abort (); + FAILURE if (! compare64 (0.E-6DD, 0x3100000000000000ULL)) - abort (); + FAILURE if (! compare64 (0.E-7DD, 0x30e0000000000000ULL)) - abort (); + FAILURE if (! compare64 (0.E+2DD, 0x3200000000000000ULL)) - abort (); + FAILURE if (! compare128 (0.DL, 0x3040000000000000ULL, 0x0000000000000000ULL)) - abort (); + FAILURE if (! compare128 (-0.DL, 0xb040000000000000ULL, 0x0000000000000000ULL)) - abort (); + FAILURE if (! compare128 (0.E-3DL, 0x303a000000000000ULL, 0x0000000000000000ULL)) - abort (); + FAILURE if (! compare128 (0.E-8DL, 0x3030000000000000ULL, 0x0000000000000000ULL)) - abort (); + FAILURE if (! compare128 (0.E+2DL, 0x3044000000000000ULL, 0x0000000000000000ULL)) - abort (); + FAILURE } int @@ -138,7 +138,7 @@ main () if ((sizeof (_Decimal64) != sizeof (long long)) || (sizeof (_Decimal128) != 2 * sizeof (long long)) || (sizeof (_Decimal32) != sizeof (_Decimal32))) - abort (); + FAILURE u32.d = 1.DF; @@ -153,7 +153,7 @@ main () bid_tests (); } else - abort (); /* unknown format; test problem */ + FAILURE /* unknown format; test problem */ - return 0; + FINISH } diff --git a/gcc/testsuite/gcc.dg/dfp/constants.c b/gcc/testsuite/gcc.dg/dfp/constants.c index 50045ed9cec..bb61ea3352b 100644 --- a/gcc/testsuite/gcc.dg/dfp/constants.c +++ b/gcc/testsuite/gcc.dg/dfp/constants.c @@ -1,5 +1,4 @@ /* { dg-do compile } */ -/* { dg-options "-std=gnu99" } */ /* N1150 6: Constants. C99 6.4.4.2: Floating constants. */ diff --git a/gcc/testsuite/gcc.dg/dfp/convert-bfp-10.c b/gcc/testsuite/gcc.dg/dfp/convert-bfp-10.c index dec7b515fcf..743eb293c55 100644 --- a/gcc/testsuite/gcc.dg/dfp/convert-bfp-10.c +++ b/gcc/testsuite/gcc.dg/dfp/convert-bfp-10.c @@ -1,5 +1,3 @@ -/* { dg-options "-std=gnu99" } */ - /* This test assumes IEEE float and double. */ #define __STDC_WANT_DEC_FP__ @@ -108,7 +106,5 @@ main () convert_246 (); convert_247 (); - if (failcnt != 0) - abort (); - return 0; + FINISH } diff --git a/gcc/testsuite/gcc.dg/dfp/convert-bfp-11.c b/gcc/testsuite/gcc.dg/dfp/convert-bfp-11.c index 283f9bd4f88..d16919f81ac 100644 --- a/gcc/testsuite/gcc.dg/dfp/convert-bfp-11.c +++ b/gcc/testsuite/gcc.dg/dfp/convert-bfp-11.c @@ -1,4 +1,3 @@ -/* { dg-options "-std=gnu99" } */ /* { dg-skip-if "" { ! "powerpc*-*-linux*" } { "*" } { "" } } */ /* Test decimal float conversions to and from IBM 128-bit long double. @@ -55,7 +54,5 @@ main () convert_311 (); convert_312 (); - if (failcnt != 0) - abort (); - return 0; + FINISH } diff --git a/gcc/testsuite/gcc.dg/dfp/convert-bfp-12.c b/gcc/testsuite/gcc.dg/dfp/convert-bfp-12.c index 96381415dce..7a909552afc 100644 --- a/gcc/testsuite/gcc.dg/dfp/convert-bfp-12.c +++ b/gcc/testsuite/gcc.dg/dfp/convert-bfp-12.c @@ -1,9 +1,7 @@ /* Test for bug where fold wrongly removed conversions to double and replaced them by conversions to float. */ -/* { dg-options "-std=gnu99" } */ -extern void abort (void); -extern void exit (int); +#include "dfp-dbg.h" volatile float f = __builtin_inff (); volatile _Decimal32 d32 = 1e40DF; @@ -12,6 +10,7 @@ int main (void) { if ((double) f == (double) d32) - abort (); - exit (0); + FAILURE + + FINISH } diff --git a/gcc/testsuite/gcc.dg/dfp/convert-bfp-13.c b/gcc/testsuite/gcc.dg/dfp/convert-bfp-13.c index 91a5b494884..259cc745ce3 100644 --- a/gcc/testsuite/gcc.dg/dfp/convert-bfp-13.c +++ b/gcc/testsuite/gcc.dg/dfp/convert-bfp-13.c @@ -1,9 +1,7 @@ /* Test for bug where fold changed binary operation to decimal depending on typedefs. */ -/* { dg-options "-std=gnu99" } */ -extern void abort (void); -extern void exit (int); +#include "dfp-dbg.h" volatile double d = 1.2345675; @@ -15,6 +13,6 @@ main (void) _Decimal32 a = (d * d); d32 b = (d * d); if (a != b) - abort (); - exit (0); + FAILURE + FINISH } diff --git a/gcc/testsuite/gcc.dg/dfp/convert-bfp-14.c b/gcc/testsuite/gcc.dg/dfp/convert-bfp-14.c index a1312d2a0e6..858c92980b5 100644 --- a/gcc/testsuite/gcc.dg/dfp/convert-bfp-14.c +++ b/gcc/testsuite/gcc.dg/dfp/convert-bfp-14.c @@ -1,9 +1,7 @@ /* Test for bug where fold narrowed decimal floating-point operations. */ -/* { dg-options "-std=gnu99" } */ -extern void abort (void); -extern void exit (int); +#include "dfp-dbg.h" volatile _Decimal32 f = 1.23456DF; volatile _Decimal64 d = 1.23456DD; @@ -12,6 +10,6 @@ int main (void) { if ((double)((_Decimal64)f * (_Decimal64)f) != (double)(d * d)) - abort (); - exit (0); + FAILURE + FINISH } diff --git a/gcc/testsuite/gcc.dg/dfp/convert-bfp-2.c b/gcc/testsuite/gcc.dg/dfp/convert-bfp-2.c index 28273512005..463d27f355f 100644 --- a/gcc/testsuite/gcc.dg/dfp/convert-bfp-2.c +++ b/gcc/testsuite/gcc.dg/dfp/convert-bfp-2.c @@ -1,5 +1,3 @@ -/* { dg-options "-std=gnu99" } */ - /* This test assumes IEEE float and double. It also tests long double but makes no assumption about its size or range of values. */ @@ -31,7 +29,5 @@ main () CALL_VALID_ALL (t6) CALL_VALID_ALL (t7) - if (failcnt != 0) - abort (); - return 0; + FINISH } diff --git a/gcc/testsuite/gcc.dg/dfp/convert-bfp-3.c b/gcc/testsuite/gcc.dg/dfp/convert-bfp-3.c index 67d31c33ac9..3e1d9d57a77 100644 --- a/gcc/testsuite/gcc.dg/dfp/convert-bfp-3.c +++ b/gcc/testsuite/gcc.dg/dfp/convert-bfp-3.c @@ -1,5 +1,3 @@ -/* { dg-options "-std=gnu99" } */ - /* This test assumes IEEE float and double. It also tests long double but makes no assumption about its size or range of values. */ @@ -19,7 +17,5 @@ main () { CALL_ZEROES_ALL (t) - if (failcnt != 0) - abort (); - return 0; + FINISH } diff --git a/gcc/testsuite/gcc.dg/dfp/convert-bfp-4.c b/gcc/testsuite/gcc.dg/dfp/convert-bfp-4.c index feba37a9eae..b97b9c6cb08 100644 --- a/gcc/testsuite/gcc.dg/dfp/convert-bfp-4.c +++ b/gcc/testsuite/gcc.dg/dfp/convert-bfp-4.c @@ -1,5 +1,3 @@ -/* { dg-options "-std=gnu99" } */ - /* This test assumes IEEE float and double. It also tests long double but makes no assumption about its size or range of values. */ @@ -19,7 +17,5 @@ main () { CALL_INF_ALL (t) - if (failcnt != 0) - abort (); - return 0; + FINISH } diff --git a/gcc/testsuite/gcc.dg/dfp/convert-bfp-5.c b/gcc/testsuite/gcc.dg/dfp/convert-bfp-5.c index cfb86fd015d..ada2d352cca 100644 --- a/gcc/testsuite/gcc.dg/dfp/convert-bfp-5.c +++ b/gcc/testsuite/gcc.dg/dfp/convert-bfp-5.c @@ -1,5 +1,3 @@ -/* { dg-options "-std=gnu99" } */ - /* This test assumes IEEE float and double. It also tests long double but makes no assumption about its size or range of values. */ @@ -19,7 +17,5 @@ main () { CALL_NAN_ALL (t) - if (failcnt != 0) - abort (); - return 0; + FINISH } diff --git a/gcc/testsuite/gcc.dg/dfp/convert-bfp-6.c b/gcc/testsuite/gcc.dg/dfp/convert-bfp-6.c index 7603f751992..64198a95f2a 100644 --- a/gcc/testsuite/gcc.dg/dfp/convert-bfp-6.c +++ b/gcc/testsuite/gcc.dg/dfp/convert-bfp-6.c @@ -1,5 +1,5 @@ /* { dg-xfail-run-if "" { lax_strtofp } "*" "" } */ -/* { dg-options "-std=gnu99 -w" } */ +/* { dg-options "-w" } */ /* This test assumes IEEE float and double. */ @@ -174,7 +174,5 @@ main () convert_364 (); } - if (failcnt != 0) - abort (); - return 0; + FINISH } diff --git a/gcc/testsuite/gcc.dg/dfp/convert-bfp-7.c b/gcc/testsuite/gcc.dg/dfp/convert-bfp-7.c index 0fb4f076d25..f51d696cee6 100644 --- a/gcc/testsuite/gcc.dg/dfp/convert-bfp-7.c +++ b/gcc/testsuite/gcc.dg/dfp/convert-bfp-7.c @@ -1,4 +1,4 @@ -/* { dg-options "-std=gnu99 -w" } */ +/* { dg-options "-w" } */ /* This test assumes IEEE float and double. */ @@ -79,7 +79,5 @@ main () convert_351 (); convert_352 (); - if (failcnt != 0) - abort (); - return 0; + FINISH } diff --git a/gcc/testsuite/gcc.dg/dfp/convert-bfp-8.c b/gcc/testsuite/gcc.dg/dfp/convert-bfp-8.c index 269fc37f208..532bd861314 100644 --- a/gcc/testsuite/gcc.dg/dfp/convert-bfp-8.c +++ b/gcc/testsuite/gcc.dg/dfp/convert-bfp-8.c @@ -1,4 +1,4 @@ -/* { dg-options "-std=gnu99 -w" } */ +/* { dg-options "-w" } */ /* This test assumes IEEE float and double. */ @@ -67,7 +67,5 @@ main () convert_443 (); convert_444 (); - if (failcnt != 0) - abort (); - return 0; + FINISH } diff --git a/gcc/testsuite/gcc.dg/dfp/convert-bfp-9.c b/gcc/testsuite/gcc.dg/dfp/convert-bfp-9.c index 90f0692136c..e609087525a 100644 --- a/gcc/testsuite/gcc.dg/dfp/convert-bfp-9.c +++ b/gcc/testsuite/gcc.dg/dfp/convert-bfp-9.c @@ -1,5 +1,5 @@ /* { dg-xfail-run-if "" { lax_strtofp } "*" "" } */ -/* { dg-options "-std=gnu99 -w" } */ +/* { dg-options "-w" } */ /* This test assumes IEEE float and double. */ @@ -188,7 +188,5 @@ main () convert_419 (); convert_420 (); - if (failcnt != 0) - abort (); - return 0; + FINISH } diff --git a/gcc/testsuite/gcc.dg/dfp/convert-bfp-fold.c b/gcc/testsuite/gcc.dg/dfp/convert-bfp-fold.c index 8c20a52ee69..41a04febf61 100644 --- a/gcc/testsuite/gcc.dg/dfp/convert-bfp-fold.c +++ b/gcc/testsuite/gcc.dg/dfp/convert-bfp-fold.c @@ -1,4 +1,4 @@ -/* { dg-options "-std=gnu99 -O2" } */ +/* { dg-options "-O2" } */ /* N1150 5.2 Conversions among decimal floating types and between decimal floating types and generic floating types. diff --git a/gcc/testsuite/gcc.dg/dfp/convert-bfp.c b/gcc/testsuite/gcc.dg/dfp/convert-bfp.c index b2e8ca87b16..710538d467b 100644 --- a/gcc/testsuite/gcc.dg/dfp/convert-bfp.c +++ b/gcc/testsuite/gcc.dg/dfp/convert-bfp.c @@ -1,23 +1,12 @@ -/* { dg-options "-std=gnu99" } */ - /* N1150 5.2 Conversions among decimal floating types and between decimal floating types and generic floating types. C99 6.3.1.5(4) Conversions, arithmetic operands, real floating types. */ /* Long double isn't supported yet at runtime, so disable those checks. */ -extern void abort (void); -static int failcnt; -static int skip_long_double; +#include "dfp-dbg.h" -/* Support compiling the test to report individual failures; default is - to abort as soon as a check fails. */ -#ifdef DBG -#include <stdio.h> -#define FAILURE { printf ("failed at line %d\n", __LINE__); failcnt++; } -#else -#define FAILURE abort (); -#endif +static int skip_long_double; volatile _Decimal32 d32; volatile _Decimal64 d64; @@ -138,8 +127,5 @@ main () || df > (2.9802322387695312e-08 + 0.00000000001)) FAILURE - if (failcnt != 0) - abort (); - - return 0; + FINISH } diff --git a/gcc/testsuite/gcc.dg/dfp/convert-complex.c b/gcc/testsuite/gcc.dg/dfp/convert-complex.c index 0083b091880..76eef87cb7c 100644 --- a/gcc/testsuite/gcc.dg/dfp/convert-complex.c +++ b/gcc/testsuite/gcc.dg/dfp/convert-complex.c @@ -3,17 +3,7 @@ /* N1150 5.3 Conversions between decimal floating and complex. C99 6.3.1.7 Conversions, arithmetic operands, real and complex. */ -extern void abort(void); -static int failcnt; - -/* Support compiling the test to report individual failures; default is - to abort as soon as a check fails. */ -#ifdef DBG -#include <stdio.h> -#define FAILURE { printf ("failed at line %d\n", __LINE__); failcnt++; } -#else -#define FAILURE abort (); -#endif +#include "dfp-dbg.h" int main () @@ -124,8 +114,5 @@ main () if (d128 != 0.0625DL) FAILURE - if (failcnt != 0) - abort (); - - return 0; + FINISH } diff --git a/gcc/testsuite/gcc.dg/dfp/convert-dfp-fold-2.c b/gcc/testsuite/gcc.dg/dfp/convert-dfp-fold-2.c index 9f0927963a1..073f7abc4a6 100644 --- a/gcc/testsuite/gcc.dg/dfp/convert-dfp-fold-2.c +++ b/gcc/testsuite/gcc.dg/dfp/convert-dfp-fold-2.c @@ -1,9 +1,7 @@ /* Test for bug where fold narrowed decimal floating-point operations. */ -/* { dg-options "-std=gnu99" } */ -extern void abort (void); -extern void exit (int); +#include "dfp-dbg.h" volatile _Decimal32 f = 1.23456DF; volatile _Decimal64 d = 1.23456DD; @@ -12,6 +10,6 @@ int main (void) { if ((_Decimal128)((_Decimal64)f * (_Decimal64)f) != (_Decimal128)(d * d)) - abort (); - exit (0); + FAILURE + FINISH } diff --git a/gcc/testsuite/gcc.dg/dfp/convert-dfp-fold.c b/gcc/testsuite/gcc.dg/dfp/convert-dfp-fold.c index a56f0dfc25e..349fb3545ec 100644 --- a/gcc/testsuite/gcc.dg/dfp/convert-dfp-fold.c +++ b/gcc/testsuite/gcc.dg/dfp/convert-dfp-fold.c @@ -1,4 +1,4 @@ -/* { dg-options "-std=gnu99 -O2" } */ +/* { dg-options "-O2" } */ /* N1150 5.2 Conversions among decimal floating types and between decimal floating types and generic floating types. diff --git a/gcc/testsuite/gcc.dg/dfp/convert-dfp-round.c b/gcc/testsuite/gcc.dg/dfp/convert-dfp-round.c index 9833abb7ff0..e3781bfc967 100644 --- a/gcc/testsuite/gcc.dg/dfp/convert-dfp-round.c +++ b/gcc/testsuite/gcc.dg/dfp/convert-dfp-round.c @@ -1,4 +1,4 @@ -/* { dg-options "-O0 -std=gnu99" } */ +/* { dg-options "-O0" } */ /* { dg-skip-if "test is for emulation" { hard_dfp } { "*" } { "" } } */ /* N1150 5.2: Conversions among decimal floating types and between @@ -12,20 +12,9 @@ Normally this would not be part of compiler testing, but conversions are currently handled in libgcc via decNumber. */ +#include "dfp-dbg.h" #include "dfp-round.h" -extern void abort (void); -static int failcnt = 0; - -/* Support compiling the test to report individual failures; default is - to abort as soon as a check fails. */ -#ifdef DBG -#include <stdio.h> -#define FAILURE { printf ("failed at line %d\n", __LINE__); failcnt++; } -#else -#define FAILURE abort (); -#endif - _Decimal32 d32; _Decimal64 d64; _Decimal128 d128; @@ -131,7 +120,5 @@ main () if (!do_d128_to_d64 (-1.1111111111111125dl, -1.111111111111112dd)) FAILURE if (!do_d128_to_d64 (-1.1111111111111135dl, -1.111111111111113dd)) FAILURE - if (failcnt) - abort (); - return 0; + FINISH } diff --git a/gcc/testsuite/gcc.dg/dfp/convert-dfp.c b/gcc/testsuite/gcc.dg/dfp/convert-dfp.c index 148dff60e3f..d52ba51b0be 100644 --- a/gcc/testsuite/gcc.dg/dfp/convert-dfp.c +++ b/gcc/testsuite/gcc.dg/dfp/convert-dfp.c @@ -1,4 +1,4 @@ -/* { dg-options "-std=gnu99 -O0" } */ +/* { dg-options "-O0" } */ /* N1150 5.2 Conversions among decimal floating types and between decimal floating types and generic floating types. @@ -10,20 +10,9 @@ #define __STDC_WANT_DEC_FP__ 1 #endif +#include "dfp-dbg.h" #include <float.h> -extern void abort (void); -static int failcnt; - -/* Support compiling the test to report individual failures; default is - to abort as soon as a check fails. */ -#ifdef DBG -#include <stdio.h> -#define FAILURE { printf ("failed at line %d\n", __LINE__); failcnt++; } -#else -#define FAILURE abort (); -#endif - volatile _Decimal32 d32; volatile _Decimal64 d64; volatile _Decimal128 d128; @@ -101,8 +90,5 @@ main () if (d64 != __builtin_infd64()) FAILURE - if (failcnt != 0) - abort (); - - return 0; + FINISH } diff --git a/gcc/testsuite/gcc.dg/dfp/convert-int-fold.c b/gcc/testsuite/gcc.dg/dfp/convert-int-fold.c index e550369be23..ae0945b0d5d 100644 --- a/gcc/testsuite/gcc.dg/dfp/convert-int-fold.c +++ b/gcc/testsuite/gcc.dg/dfp/convert-int-fold.c @@ -1,9 +1,13 @@ -/* { dg-options "-std=gnu99 -O2" } */ +/* { dg-options "-O2" } */ /* N1150 5.1 Conversion between decimal floating integer. C99 6.3.1.4(1a) New. These should all be folded at compile time. */ +#include "dfp-dbg.h" + +#define BOOL _Bool + extern void link_error (void); int @@ -18,11 +22,11 @@ main () int si; long sl; long long sll; - _Bool b; + BOOL b; /* C99 Section 6.7.2 Type specifiers. Type _Bool is mentioned in this section. Conversions between - _Bool and DFP types. */ + BOOL and DFP types. */ /* Decimal float to unsigned integer. */ d32 = 456.789df; @@ -61,7 +65,7 @@ main () /* Decimal float to signed integer. */ - /* Decimal float to _Bool. */ + /* Decimal float to BOOL. */ d32 = 1.23df; d64 = -3.4dd; d128 = 0.00003dl; @@ -146,7 +150,7 @@ main () if (d128 != -1234567.dl) link_error (); - /* _Bool to decimal float. */ + /* BOOL to decimal float. */ d32 = 0.0DF; d64 = 0.0DD; d128 = 0.0DL; diff --git a/gcc/testsuite/gcc.dg/dfp/convert-int-max-fold.c b/gcc/testsuite/gcc.dg/dfp/convert-int-max-fold.c index 7e016918ad2..9abbbbb6078 100644 --- a/gcc/testsuite/gcc.dg/dfp/convert-int-max-fold.c +++ b/gcc/testsuite/gcc.dg/dfp/convert-int-max-fold.c @@ -1,4 +1,4 @@ -/* { dg-options "-std=gnu99 -O2" } */ +/* { dg-options "-O2 -w" } */ /* N1150 5.1 Conversions from decimal float to integer. */ diff --git a/gcc/testsuite/gcc.dg/dfp/convert-int-max.c b/gcc/testsuite/gcc.dg/dfp/convert-int-max.c index cb0c428a164..724627d3763 100644 --- a/gcc/testsuite/gcc.dg/dfp/convert-int-max.c +++ b/gcc/testsuite/gcc.dg/dfp/convert-int-max.c @@ -1,4 +1,4 @@ -/* { dg-options "-std=gnu99 -O0" } */ +/* { dg-options "-O0 -w" } */ /* N1150 5.1 Conversions from decimal float to integer. */ @@ -6,15 +6,7 @@ what will fit into the destination type. This assumes 32-bit int and 64-bit long long (there's a check for that below). */ -extern void abort (void); -int failcnt; - -#ifdef DBG -extern int printf (const char *, ...); -#define FAILURE { printf ("failed at line %d\n", __LINE__); failcnt++; } -#else -#define FAILURE abort (); -#endif +#include "dfp-dbg.h" volatile _Decimal32 d32; volatile _Decimal64 d64; @@ -150,7 +142,5 @@ main () doit (); - if (failcnt != 0) - abort (); - return 0; + FINISH } diff --git a/gcc/testsuite/gcc.dg/dfp/convert-int-saturate.c b/gcc/testsuite/gcc.dg/dfp/convert-int-saturate.c index ab4c8d268ad..c92502d56ad 100644 --- a/gcc/testsuite/gcc.dg/dfp/convert-int-saturate.c +++ b/gcc/testsuite/gcc.dg/dfp/convert-int-saturate.c @@ -1,5 +1,3 @@ -/* { dg-options "-std=gnu99" } */ - /* N1150 5.1 Conversion between decimal floating integer. C99 6.3.1.4(1a) New. Test integer saturation. */ @@ -8,11 +6,10 @@ #define __STDC_WANT_DEC_FP__ 1 #endif +#include "dfp-dbg.h" #include <float.h> #include <limits.h> -extern void abort (void); - volatile _Decimal32 d32; volatile _Decimal64 d64; volatile _Decimal128 d128; @@ -28,40 +25,40 @@ main () /* Unsigned. */ usi = DEC32_MAX; /* { dg-warning "overflow in implicit constant conversion" } */ if (usi != UINT_MAX) - abort (); + FAILURE usi = DEC64_MAX; /* { dg-warning "overflow in implicit constant conversion" } */ if (usi != UINT_MAX) - abort (); + FAILURE usi = DEC128_MAX; /* { dg-warning "overflow in implicit constant conversion" } */ if (usi != UINT_MAX) - abort (); + FAILURE /* Signed. */ si = DEC32_MAX; /* { dg-warning "overflow in implicit constant conversion" } */ if (si != INT_MAX) - abort (); + FAILURE si = DEC64_MAX; /* { dg-warning "overflow in implicit constant conversion" } */ if (si != INT_MAX) - abort (); + FAILURE si = DEC128_MAX; /* { dg-warning "overflow in implicit constant conversion" } */ if (si != INT_MAX) - abort (); + FAILURE si = - DEC32_MAX; /* { dg-warning "overflow in implicit constant conversion" } */ if (si != INT_MIN) - abort (); + FAILURE si = - DEC64_MAX; /* { dg-warning "overflow in implicit constant conversion" } */ if (si != INT_MIN) - abort (); + FAILURE si = - DEC128_MAX; /* { dg-warning "overflow in implicit constant conversion" } */ if (si != INT_MIN) - abort (); + FAILURE - return 0; + FINISH } diff --git a/gcc/testsuite/gcc.dg/dfp/convert-int.c b/gcc/testsuite/gcc.dg/dfp/convert-int.c index 45efe32a5e8..0c2d7938604 100644 --- a/gcc/testsuite/gcc.dg/dfp/convert-int.c +++ b/gcc/testsuite/gcc.dg/dfp/convert-int.c @@ -1,17 +1,11 @@ -/* { dg-options "-std=gnu99 -O0" } */ +/* { dg-options "-O0" } */ /* N1150 5.1 Conversion between decimal floating types and integer. C99 6.3.1.4(1a) New. */ -extern void abort (void); -int failcnt; +#include "dfp-dbg.h" -#ifdef DBG -extern int printf (const char *, ...); -#define FAILURE { printf ("failed at line %d\n", __LINE__); failcnt++; } -#else -#define FAILURE abort (); -#endif +#define BOOL _Bool _Decimal32 d32; _Decimal64 d64; @@ -22,7 +16,7 @@ unsigned long long ull; int si; long sl; long long sll; -_Bool b; +BOOL b; void init_dfp_1 (void) @@ -68,7 +62,7 @@ main () { /* C99 Section 6.7.2 Type specifiers. Type _Bool is mentioned in this section. Conversions between - _Bool and DFP types. */ + BOOL and DFP types. */ /* Decimal float to unsigned integer. */ init_dfp_1 (); @@ -105,7 +99,7 @@ main () /* Decimal float to signed integer. */ - /* Decimal float to _Bool. */ + /* Decimal float to BOOL. */ init_dfp_2 (); b = d32; @@ -184,7 +178,7 @@ main () if (d128 != -1234567.dl) FAILURE - /* _Bool to decimal float. */ + /* BOOL to decimal float. */ init_dfp_3 (); b = d32; @@ -197,8 +191,5 @@ main () if (b) FAILURE - if (failcnt != 0) - abort (); - - return 0; + FINISH } diff --git a/gcc/testsuite/gcc.dg/dfp/convert.h b/gcc/testsuite/gcc.dg/dfp/convert.h index bc9ef42f4dd..304164ff627 100644 --- a/gcc/testsuite/gcc.dg/dfp/convert.h +++ b/gcc/testsuite/gcc.dg/dfp/convert.h @@ -1,5 +1,4 @@ -extern void abort (void); -static int failcnt = 0; +#include "dfp-dbg.h" /* Macros are set up to skip using long double, which doesn't necessarily map to TF mode. If there's a reason to skip those for a test, the @@ -8,14 +7,16 @@ static int failcnt = 0; #define USE_TF 1 #endif -/* Support compiling the test to report individual failures; default is - to abort as soon as a check fails. */ +/* Provide more information with FAILURE than what is available with + the version of that macro in dfp-dbg.h. */ + +#undef FAILURE #if defined(DBG) || defined(DBG2) #include <stdio.h> #define FAILURE(NUM) \ - { printf ("failed for test %s\n", NUM); failcnt++; } + { printf ("failed for test %s\n", NUM); failures++; } #else -#define FAILURE(N) abort (); +#define FAILURE(N) __builtin_abort (); #endif /* This is useful when modifying the test to make sure that tests are diff --git a/gcc/testsuite/gcc.dg/dfp/ctypes.c b/gcc/testsuite/gcc.dg/dfp/ctypes.c index 6afacd5173d..ca8fe954e5e 100644 --- a/gcc/testsuite/gcc.dg/dfp/ctypes.c +++ b/gcc/testsuite/gcc.dg/dfp/ctypes.c @@ -1,5 +1,4 @@ /* { dg-do compile } */ -/* { dg-options "-std=gnu99" } */ /* N1150 3: Decimal floating types. C99 6.7.2: Type specifiers */ diff --git a/gcc/testsuite/gcc.dg/dfp/ddmode-ice.c b/gcc/testsuite/gcc.dg/dfp/ddmode-ice.c index 979dabe11e2..19f3038010b 100644 --- a/gcc/testsuite/gcc.dg/dfp/ddmode-ice.c +++ b/gcc/testsuite/gcc.dg/dfp/ddmode-ice.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-std=gnu99 -O1" } */ +/* { dg-options "-O1" } */ /* This used to result in an ICE. */ diff --git a/gcc/testsuite/gcc.dg/dfp/dec-eval-method-2.c b/gcc/testsuite/gcc.dg/dfp/dec-eval-method-2.c index 55001cc3822..b87f159bf3b 100644 --- a/gcc/testsuite/gcc.dg/dfp/dec-eval-method-2.c +++ b/gcc/testsuite/gcc.dg/dfp/dec-eval-method-2.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-std=gnu99 -D__STDC_WANT_DEC_FP__" } */ +/* { dg-options "-D__STDC_WANT_DEC_FP__" } */ /* N1107 4: Characteristics of decimal floating types <float.h>. C99 5.2.4.2.2a[2] (New). diff --git a/gcc/testsuite/gcc.dg/dfp/decfloat-constants.c b/gcc/testsuite/gcc.dg/dfp/decfloat-constants.c index ec9d3816706..c72933f4233 100644 --- a/gcc/testsuite/gcc.dg/dfp/decfloat-constants.c +++ b/gcc/testsuite/gcc.dg/dfp/decfloat-constants.c @@ -1,5 +1,3 @@ -/* { dg-options "-std=gnu99" } */ - /* N1150 4: Characteristics of decimal floating types <float.h>. C99 5.2.4.2.2a[3]: New. @@ -11,20 +9,9 @@ #define __STDC_WANT_DEC_FP__ 1 #endif +#include "dfp-dbg.h" #include <float.h> -extern void abort (void); -static int failcnt; - -/* Support compiling the test to report individual failures; default is - to abort as soon as a check fails. */ -#ifdef DBG -#include <stdio.h> -#define FAILURE { printf ("failed at line %d\n", __LINE__); failcnt++; } -#else -#define FAILURE abort (); -#endif - int main () { if (DEC32_MANT_DIG != 7) FAILURE @@ -56,8 +43,5 @@ int main () if (DEC128_SUBNORMAL_MIN != 0.000000000000000000000000000000001E-6143DL) FAILURE - if (failcnt != 0) - abort (); - - return 0; + FINISH } diff --git a/gcc/testsuite/gcc.dg/dfp/dfp-dbg.h b/gcc/testsuite/gcc.dg/dfp/dfp-dbg.h new file mode 100644 index 00000000000..a32afa96bae --- /dev/null +++ b/gcc/testsuite/gcc.dg/dfp/dfp-dbg.h @@ -0,0 +1,10 @@ +int failures; + +#ifdef DBG +extern int printf (const char *, ...); +#define FAILURE { printf ("failed at line %d\n", __LINE__); failures++; } +#define FINISH if (failures != 0) __builtin_abort (); return 0; +#else +#define FAILURE __builtin_abort (); +#define FINISH return 0; +#endif diff --git a/gcc/testsuite/gcc.dg/dfp/dfp.exp b/gcc/testsuite/gcc.dg/dfp/dfp.exp index 2619a94122f..3881ea667c8 100644 --- a/gcc/testsuite/gcc.dg/dfp/dfp.exp +++ b/gcc/testsuite/gcc.dg/dfp/dfp.exp @@ -37,12 +37,14 @@ if { ![check_effective_target_dfprt] } { } verbose "dfp.exp: dg-do-what-default is ${dg-do-what-default}" 2 -# If a testcase doesn't have special options, use these. global DEFAULT_CFLAGS -if ![info exists DEFAULT_CFLAGS] then { - set DEFAULT_CFLAGS " -ansi -pedantic-errors" +if [info exists DEFAULT_CFLAGS] then { + set save_default_cflags DEFAULT_CFLAGS } +# If a testcase doesn't have special options, use these. +set DEFAULT_CFLAGS "-std=gnu99" + # Initialize `dg'. dg-init @@ -55,3 +57,6 @@ dg-finish set dg-do-what-default ${save-dg-do-what-default} verbose "dfp.exp: dg-do-what-default is ${dg-do-what-default}" 2 +if [info exists save_default_cflags] { + set DEFAULT_CFLAGS $save_default_cflags +} diff --git a/gcc/testsuite/gcc.dg/dfp/fe-binop.c b/gcc/testsuite/gcc.dg/dfp/fe-binop.c index 23f137818ed..eb0da1b2c6e 100644 --- a/gcc/testsuite/gcc.dg/dfp/fe-binop.c +++ b/gcc/testsuite/gcc.dg/dfp/fe-binop.c @@ -1,4 +1,3 @@ -/* { dg-options "-std=gnu99" } */ /* { dg-skip-if "test is for emulation" { hard_dfp } { "*" } { "" } } */ /* Touch tests that check for raising appropriate exceptions for binary @@ -102,7 +101,5 @@ main () binop_501 (); binop_502 (); - if (failcnt != 0) - abort (); - return 0; + FINISH } diff --git a/gcc/testsuite/gcc.dg/dfp/fe-check.h b/gcc/testsuite/gcc.dg/dfp/fe-check.h index 0e072aa9fa1..9c5f0ff8c59 100644 --- a/gcc/testsuite/gcc.dg/dfp/fe-check.h +++ b/gcc/testsuite/gcc.dg/dfp/fe-check.h @@ -2,19 +2,17 @@ are raised for decimal float operations. These tests are here to test the software decimal float support in libgcc. */ +#include "dfp-dbg.h" #include "dfp-except.h" -extern void abort (void); -static int failcnt = 0; - -/* Support compiling the test to report individual failures; default is - to abort as soon as a check fails. */ #if defined(DBG) || defined(DBG2) #include <stdio.h> +#undef FAILURE #define FAILURE(NUM,KIND,EXCEPT) \ - { printf ("failed for test %d: %s %s\n", NUM, KIND, EXCEPT); failcnt++; } + { printf ("failed for test %d: %s %s\n", NUM, KIND, EXCEPT); failures++; } #else -#define FAILURE(N,K,E) abort (); +#undef FAILURE +#define FAILURE(N,K,E) __builtin_abort (); #endif /* This is useful when modifying the test to make sure that tests are diff --git a/gcc/testsuite/gcc.dg/dfp/fe-convert-1.c b/gcc/testsuite/gcc.dg/dfp/fe-convert-1.c index f65cf7870ae..b6528029b40 100644 --- a/gcc/testsuite/gcc.dg/dfp/fe-convert-1.c +++ b/gcc/testsuite/gcc.dg/dfp/fe-convert-1.c @@ -1,4 +1,3 @@ -/* { dg-options "-std=gnu99" } */ /* { dg-skip-if "test is for emulation" { hard_dfp } { "*" } { "" } } */ /* Check that appropriate exceptions are raised for conversions involving @@ -37,7 +36,5 @@ main () convert_121 (); convert_122 (); - if (failcnt != 0) - abort (); - return 0; + FINISH } diff --git a/gcc/testsuite/gcc.dg/dfp/fe-convert-2.c b/gcc/testsuite/gcc.dg/dfp/fe-convert-2.c index 83b490d54be..4abce24c608 100644 --- a/gcc/testsuite/gcc.dg/dfp/fe-convert-2.c +++ b/gcc/testsuite/gcc.dg/dfp/fe-convert-2.c @@ -1,5 +1,3 @@ -/* { dg-options "-std=gnu99" } */ - /* Check that appropriate exceptions are raised for BFP to DFP conversions. The test only uses double and _Decimal32; tests for conversions to _Decimal64 would need 128-bit long double. */ @@ -29,7 +27,5 @@ main () convert_104 (); convert_105 (); - if (failcnt != 0) - abort (); - return 0; + FINISH } diff --git a/gcc/testsuite/gcc.dg/dfp/fe-convert-3.c b/gcc/testsuite/gcc.dg/dfp/fe-convert-3.c index e3fe30eeb11..5938edb94e7 100644 --- a/gcc/testsuite/gcc.dg/dfp/fe-convert-3.c +++ b/gcc/testsuite/gcc.dg/dfp/fe-convert-3.c @@ -1,5 +1,3 @@ -/* { dg-options "-std=gnu99" } */ - /* Check that appropriate exceptions are raised for int to DFP conversions. */ #include "fe-check.h" @@ -43,7 +41,5 @@ main () convert_210 (); convert_211 (); - if (failcnt != 0) - abort (); - return 0; + FINISH } diff --git a/gcc/testsuite/gcc.dg/dfp/float-constant-double.c b/gcc/testsuite/gcc.dg/dfp/float-constant-double.c index 3f8de656bf6..52c5d712665 100644 --- a/gcc/testsuite/gcc.dg/dfp/float-constant-double.c +++ b/gcc/testsuite/gcc.dg/dfp/float-constant-double.c @@ -1,5 +1,4 @@ /* { dg-do compile } */ -/* { dg-options "-std=gnu99" } */ /* Constant float values of type double in <float.h> are suffixed with L and cast to double so they can be used within code that uses pragma diff --git a/gcc/testsuite/gcc.dg/dfp/func-array.c b/gcc/testsuite/gcc.dg/dfp/func-array.c index 93713486baa..6d158f35523 100644 --- a/gcc/testsuite/gcc.dg/dfp/func-array.c +++ b/gcc/testsuite/gcc.dg/dfp/func-array.c @@ -1,19 +1,7 @@ -/* { dg-options "-std=gnu99" } */ - /* C99 6.5.2.2 Function calls. Test passing array elements involving decimal floating point types. */ -extern void abort (void); -static int failcnt; - -/* Support compiling the test to report individual failures; default is - to abort as soon as a check fails. */ -#ifdef DBG -#include <stdio.h> -#define FAILURE { printf ("failed at line %d\n", __LINE__); failcnt++; } -#else -#define FAILURE abort (); -#endif +#include "dfp-dbg.h" /* A handful of functions that return the Nth _Decimal32 argument of an incoming array. */ @@ -165,8 +153,5 @@ int main() if (arg4_128 (d128) != 4.0dl) FAILURE if (arg5_128 (d128) != 5.0dl) FAILURE - if (failcnt != 0) - abort (); - - return 0; + FINISH } diff --git a/gcc/testsuite/gcc.dg/dfp/func-deref.c b/gcc/testsuite/gcc.dg/dfp/func-deref.c index d16e70d29d5..81a48a9f8e8 100644 --- a/gcc/testsuite/gcc.dg/dfp/func-deref.c +++ b/gcc/testsuite/gcc.dg/dfp/func-deref.c @@ -1,20 +1,8 @@ -/* { dg-options "-std=gnu99" } */ - /* C99 6.5.2.2 Function calls. Test scalar passing and return values involving decimal floating point types and dereferenced pointers. */ -extern void abort (void); -static int failcnt; - -/* Support compiling the test to report individual failures; default is - to abort as soon as a check fails. */ -#ifdef DBG -#include <stdio.h> -#define FAILURE { printf ("failed at line %d\n", __LINE__); failcnt++; } -#else -#define FAILURE abort (); -#endif +#include "dfp-dbg.h" /* A handful of functions that return their Nth _Decimal32 argument. */ @@ -213,8 +201,5 @@ main () if (arg5_128 (*pdl0, *pdl1, *pdl2, *pdl3, *pdl4, *pdl5) != 5.0dl) FAILURE - if (failcnt != 0) - abort (); - - return 0; + FINISH } diff --git a/gcc/testsuite/gcc.dg/dfp/func-mixed.c b/gcc/testsuite/gcc.dg/dfp/func-mixed.c index 620d342e980..6f7e2eb4157 100644 --- a/gcc/testsuite/gcc.dg/dfp/func-mixed.c +++ b/gcc/testsuite/gcc.dg/dfp/func-mixed.c @@ -1,20 +1,10 @@ -/* { dg-options "-std=gnu99 -Wall" } */ +/* { dg-options "-Wall" } */ /* C99 6.5.2.2 Function calls. Test scalar passing and return values involving decimal floating point types. */ -extern void abort (void); -static int failcnt; - -/* Support compiling the test to report individual failures; default is - to abort as soon as a check fails. */ -#ifdef DBG -#include <stdio.h> -#define FAILURE { printf ("failed at line %d\n", __LINE__); failcnt++; } -#else -#define FAILURE abort (); -#endif +#include "dfp-dbg.h" /* A handful of functions that return their Nth _Decimal32 argument with mixed types in parameter list. */ @@ -180,8 +170,5 @@ main () if (arg4_128 (0, -1, 2.0f, 3.0, 4.0dl, 5.0l) != 4.0dl) FAILURE if (arg5_128 (0, -1, 2.0f, 3.0, 4.0l, 5.0dl) != 5.0dl) FAILURE - if (failcnt != 0) - abort (); - - return 0; + FINISH } diff --git a/gcc/testsuite/gcc.dg/dfp/func-pointer.c b/gcc/testsuite/gcc.dg/dfp/func-pointer.c index e1faceb63f0..cfdf2356c9d 100644 --- a/gcc/testsuite/gcc.dg/dfp/func-pointer.c +++ b/gcc/testsuite/gcc.dg/dfp/func-pointer.c @@ -1,20 +1,8 @@ -/* { dg-options "-std=gnu99" } */ - /* C99 6.5.2.2 Function calls. Test pointer argument passing and return values involving decimal floating point types. */ -extern void abort (void); -static int failcnt; - -/* Support compiling the test to report individual failures; default is - to abort as soon as a check fails. */ -#ifdef DBG -#include <stdio.h> -#define FAILURE { printf ("failed at line %d\n", __LINE__); failcnt++; } -#else -#define FAILURE abort (); -#endif +#include "dfp-dbg.h" /* A handful of functions that return their Nth pointer to Decimal32 argument. */ @@ -213,8 +201,5 @@ main () if (*arg5_128 (pdl0, pdl1, pdl2, pdl3, pdl4, pdl5) != 5.0dl) FAILURE - if (failcnt != 0) - abort (); - - return 0; + FINISH } diff --git a/gcc/testsuite/gcc.dg/dfp/func-scalar.c b/gcc/testsuite/gcc.dg/dfp/func-scalar.c index bbda52c0773..370c21b20e2 100644 --- a/gcc/testsuite/gcc.dg/dfp/func-scalar.c +++ b/gcc/testsuite/gcc.dg/dfp/func-scalar.c @@ -1,20 +1,8 @@ -/* { dg-options "-std=gnu99" } */ - /* C99 6.5.2.2 Function calls. Test scalar passing and return values involving decimal floating point types. */ -extern void abort (void); -static int failcnt; - -/* Support compiling the test to report individual failures; default is - to abort as soon as a check fails. */ -#ifdef DBG -#include <stdio.h> -#define FAILURE { printf ("failed at line %d\n", __LINE__); failcnt++; } -#else -#define FAILURE abort (); -#endif +#include "dfp-dbg.h" /* A handful of functions that return their Nth _Decimal32 argument. */ @@ -200,8 +188,5 @@ main () if (arg5_128 (0.0dl, 1.0dl, 2.0dl, 3.0dl, 4.0dl, 5.0dl) != 5.0dl) FAILURE - if (failcnt != 0) - abort (); - - return 0; + FINISH } diff --git a/gcc/testsuite/gcc.dg/dfp/func-struct.c b/gcc/testsuite/gcc.dg/dfp/func-struct.c index f022f181659..ad0224d6cad 100644 --- a/gcc/testsuite/gcc.dg/dfp/func-struct.c +++ b/gcc/testsuite/gcc.dg/dfp/func-struct.c @@ -1,20 +1,8 @@ -/* { dg-options "-std=gnu99" } */ - /* C99 6.5.2.2 Function calls. Test structure passing and return values involving decimal floating point types. */ -extern void abort (void); -static int failcnt; - -/* Support compiling the test to report individual failures; default is - to abort as soon as a check fails. */ -#ifdef DBG -#include <stdio.h> -#define FAILURE { printf ("failed at line %d\n", __LINE__); failcnt++; } -#else -#define FAILURE abort (); -#endif +#include "dfp-dbg.h" struct example { @@ -101,8 +89,5 @@ main () if (ptr_dummy1_field (&nums) != 'a') FAILURE if (ptr_dummy2_field (&nums) != 'b') FAILURE - if (failcnt != 0) - abort (); - - return 0; + FINISH } diff --git a/gcc/testsuite/gcc.dg/dfp/func-vararg-alternate-d128-2.c b/gcc/testsuite/gcc.dg/dfp/func-vararg-alternate-d128-2.c index 167da24b889..2960c357ade 100644 --- a/gcc/testsuite/gcc.dg/dfp/func-vararg-alternate-d128-2.c +++ b/gcc/testsuite/gcc.dg/dfp/func-vararg-alternate-d128-2.c @@ -1,5 +1,5 @@ /* { dg-do run { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */ -/* { dg-options "-std=gnu99 -mpreferred-stack-boundary=2" } */ +/* { dg-options "-mpreferred-stack-boundary=2" } */ /* Simple test of vararg passing for problematic types with and without double values passed between them. */ @@ -17,5 +17,6 @@ int main () { doit (); - return 0; + + FINISH } diff --git a/gcc/testsuite/gcc.dg/dfp/func-vararg-alternate-d128.c b/gcc/testsuite/gcc.dg/dfp/func-vararg-alternate-d128.c index e8fc0271dcb..8d452eadc38 100644 --- a/gcc/testsuite/gcc.dg/dfp/func-vararg-alternate-d128.c +++ b/gcc/testsuite/gcc.dg/dfp/func-vararg-alternate-d128.c @@ -1,5 +1,3 @@ -/* { dg-options "-std=gnu99" } */ - /* Simple test of vararg passing for problematic types with and without double values passed between them. */ @@ -16,5 +14,6 @@ int main () { doit (); - return 0; + + FINISH } diff --git a/gcc/testsuite/gcc.dg/dfp/func-vararg-alternate-d32.c b/gcc/testsuite/gcc.dg/dfp/func-vararg-alternate-d32.c index cd6853cc985..651b7e8c50f 100644 --- a/gcc/testsuite/gcc.dg/dfp/func-vararg-alternate-d32.c +++ b/gcc/testsuite/gcc.dg/dfp/func-vararg-alternate-d32.c @@ -1,5 +1,3 @@ -/* { dg-options "-std=gnu99" } */ - /* Simple test of vararg passing for problematic types with and without double values passed between them. */ @@ -16,5 +14,6 @@ int main () { doit (); - return 0; + + FINISH } diff --git a/gcc/testsuite/gcc.dg/dfp/func-vararg-alternate-d64.c b/gcc/testsuite/gcc.dg/dfp/func-vararg-alternate-d64.c index 39470013ecd..86b475d2ada 100644 --- a/gcc/testsuite/gcc.dg/dfp/func-vararg-alternate-d64.c +++ b/gcc/testsuite/gcc.dg/dfp/func-vararg-alternate-d64.c @@ -1,5 +1,3 @@ -/* { dg-options "-std=gnu99" } */ - /* Simple test of vararg passing for problematic types with and without double values passed between them. */ @@ -16,5 +14,6 @@ int main () { doit (); - return 0; + + FINISH } diff --git a/gcc/testsuite/gcc.dg/dfp/func-vararg-alternate.h b/gcc/testsuite/gcc.dg/dfp/func-vararg-alternate.h index 393111b33bc..8dbb5093fe2 100644 --- a/gcc/testsuite/gcc.dg/dfp/func-vararg-alternate.h +++ b/gcc/testsuite/gcc.dg/dfp/func-vararg-alternate.h @@ -1,14 +1,9 @@ /* Simple test of vararg passing for problematic types with and without double values passed between them. */ +#include "dfp-dbg.h" #include <stdarg.h> -#ifdef DBG -#include <stdio.h> -#endif -extern void abort (void); - -int failcnt; DTYPE a[10]; double b[10]; @@ -28,6 +23,7 @@ compare (double r, double s, int *p, int *q, int n, int line) { int j; + failures++; printf ("line %-3d", line); for (j = 0; j < n; j++) printf (" %08x", p[j]); @@ -39,7 +35,7 @@ compare (double r, double s, int *p, int *q, int n, int line) return; } #else - abort (); + __builtin_abort (); #endif } @@ -102,7 +98,7 @@ doit () printf ("test error: INTS = %d, sizeof (DTYPE) = %d\n", INTS, sizeof (DTYPE)); #endif - abort (); + __builtin_abort (); } x = ONE / THREE; @@ -144,7 +140,4 @@ doit () u1.d = x; u2.d = a[0]; compare (1.5, b[0], u1.i, u2.i, INTS, __LINE__); u1.d = y; u2.d = a[1]; compare (2.5, b[1], u1.i, u2.i, INTS, __LINE__); u1.d = z; u2.d = a[2]; compare (3.5, b[2], u1.i, u2.i, INTS, __LINE__); - - if (failcnt != 0) - abort (); } diff --git a/gcc/testsuite/gcc.dg/dfp/func-vararg-dfp.c b/gcc/testsuite/gcc.dg/dfp/func-vararg-dfp.c index 1a681bcaf9b..5add1f7fd38 100644 --- a/gcc/testsuite/gcc.dg/dfp/func-vararg-dfp.c +++ b/gcc/testsuite/gcc.dg/dfp/func-vararg-dfp.c @@ -1,21 +1,8 @@ -/* { dg-options "-std=gnu99" } */ - /* C99 6.5.2.2 Function calls. Test passing varargs of the decimal float types. */ #include <stdarg.h> - -extern void abort (void); -static int failcnt = 0; - -/* Support compiling the test to report individual failures; default is - to abort as soon as a check fails. */ -#ifdef DBG -#include <stdio.h> -#define FAILURE { printf ("failed at line %d\n", __LINE__); failcnt++; } -#else -#define FAILURE abort (); -#endif +#include "dfp-dbg.h" static _Decimal32 vararg32 (unsigned arg, ...) @@ -104,7 +91,5 @@ int main() if (vararg128 (5, 0.0dl, 1.0dl, 2.0dl, 3.0dl, 4.0dl, 5.0dl) != 5.0dl) FAILURE - if (failcnt != 0) - abort (); - return 0; + FINISH } diff --git a/gcc/testsuite/gcc.dg/dfp/func-vararg-mixed-2.c b/gcc/testsuite/gcc.dg/dfp/func-vararg-mixed-2.c index c1b349c6728..893cdae27ff 100644 --- a/gcc/testsuite/gcc.dg/dfp/func-vararg-mixed-2.c +++ b/gcc/testsuite/gcc.dg/dfp/func-vararg-mixed-2.c @@ -1,23 +1,12 @@ /* { dg-do run { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */ -/* { dg-options "-std=gnu99 -mpreferred-stack-boundary=2" } */ +/* { dg-options "-mpreferred-stack-boundary=2" } */ /* C99 6.5.2.2 Function calls. Test passing varargs of the combination of decimal float types and other types. */ #include <stdarg.h> - -extern void abort (void); -static int failcnt = 0; - -/* Support compiling the test to report individual failures; default is - to abort as soon as a check fails. */ -#ifdef DBG -#include <stdio.h> -#define FAILURE { printf ("failed at line %d\n", __LINE__); failcnt++; } -#else -#define FAILURE abort (); -#endif +#include "dfp-dbg.h" /* Supposing the list of varying number of arguments is: unsigned int, _Decimal128, double, _Decimal32, _Decimal64. */ @@ -112,7 +101,5 @@ main () if (vararg_int (0, 0, 1.0dl, 2.0, 3.0df, 4.0dd) != 0) FAILURE if (vararg_double (2, 0, 1.0dl, 2.0, 3.0df, 4.0dd) != 2.0) FAILURE - if (failcnt != 0) - abort (); - return 0; + FINISH } diff --git a/gcc/testsuite/gcc.dg/dfp/func-vararg-mixed.c b/gcc/testsuite/gcc.dg/dfp/func-vararg-mixed.c index b5a5be45d7e..1669eaf959a 100644 --- a/gcc/testsuite/gcc.dg/dfp/func-vararg-mixed.c +++ b/gcc/testsuite/gcc.dg/dfp/func-vararg-mixed.c @@ -1,22 +1,9 @@ -/* { dg-options "-std=gnu99" } */ - /* C99 6.5.2.2 Function calls. Test passing varargs of the combination of decimal float types and other types. */ #include <stdarg.h> - -extern void abort (void); -static int failcnt = 0; - -/* Support compiling the test to report individual failures; default is - to abort as soon as a check fails. */ -#ifdef DBG -#include <stdio.h> -#define FAILURE { printf ("failed at line %d\n", __LINE__); failcnt++; } -#else -#define FAILURE abort (); -#endif +#include "dfp-dbg.h" /* Supposing the list of varying number of arguments is: unsigned int, _Decimal128, double, _Decimal32, _Decimal64. */ @@ -111,7 +98,5 @@ main () if (vararg_int (0, 0, 1.0dl, 2.0, 3.0df, 4.0dd) != 0) FAILURE if (vararg_double (2, 0, 1.0dl, 2.0, 3.0df, 4.0dd) != 2.0) FAILURE - if (failcnt != 0) - abort (); - return 0; + FINISH } diff --git a/gcc/testsuite/gcc.dg/dfp/func-vararg-size0.c b/gcc/testsuite/gcc.dg/dfp/func-vararg-size0.c index dc94709c108..bc8b20fd484 100644 --- a/gcc/testsuite/gcc.dg/dfp/func-vararg-size0.c +++ b/gcc/testsuite/gcc.dg/dfp/func-vararg-size0.c @@ -1,10 +1,7 @@ -/* { dg-options "-std=gnu99" } */ - /* C99 6.5.2.2 Function calls. */ #include <stdarg.h> - -extern void abort (void); +#include "dfp-dbg.h" struct S1 { @@ -38,7 +35,7 @@ main () struct S1 a1[5]; if (check_var(5, 1.0, s1, 2LL, a1[2], a1[2]) == 0) - abort (); + FAILURE - return 0; + FINISH } diff --git a/gcc/testsuite/gcc.dg/dfp/inf-1.c b/gcc/testsuite/gcc.dg/dfp/inf-1.c index 86aa9e4cfaa..c4f8cd79610 100644 --- a/gcc/testsuite/gcc.dg/dfp/inf-1.c +++ b/gcc/testsuite/gcc.dg/dfp/inf-1.c @@ -1,63 +1,61 @@ -/* { dg-options "-std=gnu99" } */ - /* N1150 4: Characteristics of decimal floating types (not explicit) C99 5.2.4.2.2: Characteristics of floating types. A few simple checks on arithmetic operations. */ -extern void abort (void); +#include "dfp-dbg.h" int main() { /* Assumes rounding mode. */ if (9999999.E90DF + 1.E90df != __builtin_infd32 ()) - abort (); + FAILURE if (!__builtin_isinfd32 (9999999.E90DF + 1.E90df)) - abort (); + FAILURE if (9.999999999999999E384dd + .000000000000001e384dd != __builtin_infd32 ()) - abort (); + FAILURE if (-9999999.E90DF - 1.E90df != -__builtin_infd32 ()) - abort (); + FAILURE if (!__builtin_isinfd32 (9.999999999999999E384dd + .000000000000001e384dd)) - abort (); + FAILURE if (7.999999999999999999999999999999999E6144dl + 3.0E6144dl != __builtin_infd32 ()) - abort (); + FAILURE if (__builtin_infd32 () * __builtin_infd32 () != __builtin_infd32 ()) - abort (); + FAILURE if (__builtin_infd32 () * 2 != __builtin_infd32 ()) - abort (); + FAILURE if (__builtin_infd64 () * -5 != -__builtin_infd32 ()) - abort (); + FAILURE if (!__builtin_isinfd128 (__builtin_infd32 () / 4)) - abort (); + FAILURE if (__builtin_infd64 () != __builtin_infd128 ()) - abort (); + FAILURE if (!__builtin_isinfd64 (__builtin_infd128 ())) - abort (); + FAILURE if (__builtin_finited64 (__builtin_infd32 () * 4)) - abort (); + FAILURE if (!__builtin_finited128 (9.999999E90DL - 1.E90dd)) - abort (); + FAILURE if (__builtin_finited128 (__builtin_infd32 () *__builtin_infd128 ())) - abort (); + FAILURE if (__builtin_finited32 (__builtin_nand32 (""))) - abort (); - - return 0; + FAILURE + + FINISH } diff --git a/gcc/testsuite/gcc.dg/dfp/keywords-pedantic.c b/gcc/testsuite/gcc.dg/dfp/keywords-pedantic.c index 9492c798555..bca51066be3 100644 --- a/gcc/testsuite/gcc.dg/dfp/keywords-pedantic.c +++ b/gcc/testsuite/gcc.dg/dfp/keywords-pedantic.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-std=gnu99 -pedantic" } */ +/* { dg-options "-pedantic" } */ /* Decimal float is a GCC extension. */ diff --git a/gcc/testsuite/gcc.dg/dfp/keywords-reserved.c b/gcc/testsuite/gcc.dg/dfp/keywords-reserved.c index 4a042adf4c2..1117ae8d937 100644 --- a/gcc/testsuite/gcc.dg/dfp/keywords-reserved.c +++ b/gcc/testsuite/gcc.dg/dfp/keywords-reserved.c @@ -1,5 +1,4 @@ /* { dg-do compile } */ -/* { dg-options "-std=gnu99" } */ /* N1150 3: Decimal floating types. C99 6.4.1(2): Keywords. diff --git a/gcc/testsuite/gcc.dg/dfp/loop-index.c b/gcc/testsuite/gcc.dg/dfp/loop-index.c index ff52189bc15..a944042a79b 100644 --- a/gcc/testsuite/gcc.dg/dfp/loop-index.c +++ b/gcc/testsuite/gcc.dg/dfp/loop-index.c @@ -1,9 +1,8 @@ -/* { dg-options "-std=gnu99" } */ - /* C99 6.8.5.2: The for statement. */ #include <stdio.h> #include <stdlib.h> +#include "dfp-dbg.h" void f32 (void) @@ -15,7 +14,7 @@ f32 (void) i++; if (i != 5) - abort(); + FAILURE } void @@ -28,7 +27,7 @@ f64 (void) i++; if (i != 5) - abort(); + FAILURE } void @@ -41,7 +40,7 @@ f128 (void) i++; if (i != 5) - abort(); + FAILURE } int @@ -53,5 +52,6 @@ main () f64 (); f128 (); + FINISH return (0); } diff --git a/gcc/testsuite/gcc.dg/dfp/modes.c b/gcc/testsuite/gcc.dg/dfp/modes.c index ff2382b1c75..09d4a15c264 100644 --- a/gcc/testsuite/gcc.dg/dfp/modes.c +++ b/gcc/testsuite/gcc.dg/dfp/modes.c @@ -1,5 +1,4 @@ /* { dg-do compile } */ -/* { dg-options "-std=gnu99" } */ typedef float decimal32 __attribute__ ((mode (SD))); typedef float decimal64 __attribute__ ((mode (DD))); diff --git a/gcc/testsuite/gcc.dg/dfp/nan-1.c b/gcc/testsuite/gcc.dg/dfp/nan-1.c index 50972e0eb00..8961777c79b 100644 --- a/gcc/testsuite/gcc.dg/dfp/nan-1.c +++ b/gcc/testsuite/gcc.dg/dfp/nan-1.c @@ -1,108 +1,106 @@ -/* { dg-options "-std=gnu99" } */ - /* N1150 4: Characteristics of decimal floating types (not explicit) C99 5.2.4.2.2: Characteristics of floating types. A few simple checks on arithmetic operations. */ -extern void abort (void); +#include "dfp-dbg.h" int main() { /* Some possibly non-obvious tests, but most logical operations on NaN return false, including NaN == NaN. */ if (__builtin_nand32("") == __builtin_nand32("")) - abort(); + FAILURE if (__builtin_nand64("") == __builtin_nand64("")) - abort(); + FAILURE if (__builtin_nand128("") == __builtin_nand128("")) - abort(); + FAILURE if (!(__builtin_nand32("") != __builtin_nand32(""))) - abort(); + FAILURE if (!(__builtin_nand64("") != __builtin_nand64(""))) - abort(); + FAILURE if (!(__builtin_nand128("") != __builtin_nand128(""))) - abort(); + FAILURE if (__builtin_nand32("") > __builtin_nand32("")) - abort(); + FAILURE if (__builtin_nand64("") >= __builtin_nand64("")) - abort(); + FAILURE if (__builtin_nand128("") < __builtin_nand128("")) - abort(); + FAILURE if (-__builtin_nand128("") < +__builtin_nand128("")) - abort(); + FAILURE /* 0.0/0.0 => NaN, but NaN != NaN. */ if (0.0df/0.0dl == __builtin_nand32("")) - abort(); + FAILURE /* 0.0 * INF => NaN. */ if (!__builtin_isnand32 (0.0df * __builtin_infd32())) - abort (); + FAILURE if (!__builtin_isnand64 (0.0dd * __builtin_infd64())) - abort (); + FAILURE if (!__builtin_isnand128 (0.0dd * __builtin_infd128())) - abort (); + FAILURE /* INF - INF => NaN. */ if (!__builtin_isnand32 (__builtin_infd32() - __builtin_infd32())) - abort (); + FAILURE if (!__builtin_isnand64 (__builtin_infd64() - __builtin_infd64())) - abort (); + FAILURE if (!__builtin_isnand128 (__builtin_infd128() - __builtin_infd128())) - abort (); + FAILURE /* INF/INF => NaN. */ if (!__builtin_isnand32 (__builtin_infd32()/__builtin_infd32()) ) - abort (); + FAILURE if (!__builtin_isnand64 (__builtin_infd64()/__builtin_infd64()) ) - abort (); + FAILURE if (!__builtin_isnand128 (__builtin_infd128()/__builtin_infd128()) ) - abort (); + FAILURE /* 0.0/0.0 => NaN, but NaN != NaN. */ if ((0.0dd/0.0df) == (0.0dd/0.0df)) - abort(); + FAILURE if (__builtin_nand32("") < __builtin_infd32()) - abort(); + FAILURE if (__builtin_nand32("") >= __builtin_infd32()) - abort(); + FAILURE /* Fixme: Add sqrtdf(-x.df) test when sqrt is supported. */ if (!__builtin_isnand32(__builtin_nand32(""))) - abort(); + FAILURE if (!__builtin_isnand64(__builtin_nand64(""))) - abort(); + FAILURE if (!__builtin_isnand128(__builtin_nand128(""))) - abort(); + FAILURE if (!__builtin_isnand128(8.0df * __builtin_nand128(""))) - abort(); + FAILURE if (!__builtin_isnand32(8.1dl - __builtin_nand32(""))) - abort(); + FAILURE if (!__builtin_isnand128(__builtin_nand64("") + __builtin_nand128(""))) - abort(); + FAILURE - return 0; + FINISH } diff --git a/gcc/testsuite/gcc.dg/dfp/nan-2.c b/gcc/testsuite/gcc.dg/dfp/nan-2.c index e8a663e74e1..ec9d18e1000 100644 --- a/gcc/testsuite/gcc.dg/dfp/nan-2.c +++ b/gcc/testsuite/gcc.dg/dfp/nan-2.c @@ -1,11 +1,9 @@ -/* { dg-options "-std=gnu99" } */ - /* N1150 4: Characteristics of decimal floating types (not explicit) C99 5.2.4.2.2: Characteristics of floating types. A few simple checks on arithmetic operations. Based on nan-1.c with the consideration of negative zero. */ -extern void abort (void); +#include "dfp-dbg.h" int main() { @@ -17,39 +15,39 @@ int main() result. */ d32 = 123.45f; if (d32/-0.0df != -__builtin_infd32()) - abort(); + FAILURE if (123.45df/-0.0df != -__builtin_infd32()) - abort(); + FAILURE d64 = 123.45f; if (d64/-0.0dd != -__builtin_infd64()) - abort(); + FAILURE if (123.45dd/-0.0dd != -__builtin_infd64()) - abort(); + FAILURE d128 = 123.45f; if (d128/-0.0dl != -__builtin_infd64()) - abort(); + FAILURE if (123.45dl/-0.0dl != -__builtin_infd128()) - abort(); + FAILURE d32 = 0.0df; if (!__builtin_isnand32(-(d32/-0.0df))) - abort(); + FAILURE if (!__builtin_isnand32(-(0.0df/-0.0df))) - abort(); + FAILURE d64 = 0.0dd; if (!__builtin_isnand64(-(d64/-0.0dd))) - abort(); + FAILURE if (!__builtin_isnand64(-(0.0dd/-0.0dd))) - abort(); + FAILURE d128 = 0.0dl; if (!__builtin_isnand128(-(d128/-0.0dl))) - abort(); + FAILURE if (!__builtin_isnand128(-(0.0dl/-0.0dl))) - abort(); + FAILURE - return 0; + FINISH } diff --git a/gcc/testsuite/gcc.dg/dfp/operator-arith-fold.c b/gcc/testsuite/gcc.dg/dfp/operator-arith-fold.c index ad398d9b67c..65105899fb4 100644 --- a/gcc/testsuite/gcc.dg/dfp/operator-arith-fold.c +++ b/gcc/testsuite/gcc.dg/dfp/operator-arith-fold.c @@ -1,4 +1,4 @@ -/* { dg-options "-std=gnu99 -O2" } */ +/* { dg-options "-O2" } */ /* C99 6.5.5: Multiplicative operators. C99 6.5.6: Additive operators. */ diff --git a/gcc/testsuite/gcc.dg/dfp/operator-assignment.c b/gcc/testsuite/gcc.dg/dfp/operator-assignment.c index 49d15d2382d..faadf1e8650 100644 --- a/gcc/testsuite/gcc.dg/dfp/operator-assignment.c +++ b/gcc/testsuite/gcc.dg/dfp/operator-assignment.c @@ -1,21 +1,9 @@ -/* { dg-options "-std=gnu99" } */ - /* C99 6.5.16 Assignment operators. Verify the compound assignment operator for decimal float types, using it with other decimal float types, integers, and other binary float types cast to decimal float types. */ -extern void abort (void); -static int failcnt; - -/* Support compiling the test to report individual failures; default is - to abort as soon as a check fails. */ -#ifdef DBG -#include <stdio.h> -#define FAILURE { printf ("failed at line %d\n", __LINE__); failcnt++; } -#else -#define FAILURE abort (); -#endif +#include "dfp-dbg.h" #define OPERATE(OPRD1,OPRT,OPRD2,RLT) \ if (( OPRD1 OPRT OPRD2 )!= RLT) \ @@ -64,8 +52,5 @@ main () DECIMAL_COMPOUND_ASSIGNMENT(64, d64); DECIMAL_COMPOUND_ASSIGNMENT(128, d128); - if (failcnt != 0) - abort (); - - return 0; + FINISH } diff --git a/gcc/testsuite/gcc.dg/dfp/operator-bitwise.c b/gcc/testsuite/gcc.dg/dfp/operator-bitwise.c index 8523cb91a5f..f895a970578 100644 --- a/gcc/testsuite/gcc.dg/dfp/operator-bitwise.c +++ b/gcc/testsuite/gcc.dg/dfp/operator-bitwise.c @@ -1,5 +1,4 @@ /* { dg-do compile } */ -/* { dg-options "-std=gnu99" } */ /* C99 6.5.10: Bitwise AND operator. C99 6.5.11: Bitwise exclusive OR operator. @@ -7,8 +6,6 @@ Test that these operators do not accept decimal float operands. */ -extern void abort (void); - #define OPERATE(OPRD1,OPRT,OPRD2) \ do \ { \ diff --git a/gcc/testsuite/gcc.dg/dfp/operator-comma.c b/gcc/testsuite/gcc.dg/dfp/operator-comma.c index 904f9b3a676..be6bf6f8cd1 100644 --- a/gcc/testsuite/gcc.dg/dfp/operator-comma.c +++ b/gcc/testsuite/gcc.dg/dfp/operator-comma.c @@ -1,19 +1,9 @@ -/* { dg-options "-std=gnu99 -O0" } */ +/* { dg-options "-O0" } */ /* C99 6.5.17: Comma operator. Test with decimal float operands. */ -extern void abort (void); -static int failcnt = 0; - -/* Support compiling the test to report individual failures; default is - to abort as soon as a check fails. */ -#ifdef DBG -#include <stdio.h> -#define FAILURE { printf ("failed at line %d\n", __LINE__); failcnt++; } -#else -#define FAILURE abort (); -#endif +#include "dfp-dbg.h" volatile _Decimal32 d32a, d32b, d32c; volatile _Decimal64 d64a, d64b, d64c; @@ -53,5 +43,5 @@ main () if (d64a != 12.0dd) FAILURE; - return 0; + FINISH } diff --git a/gcc/testsuite/gcc.dg/dfp/operator-cond.c b/gcc/testsuite/gcc.dg/dfp/operator-cond.c index 5230134f637..140dd95074a 100644 --- a/gcc/testsuite/gcc.dg/dfp/operator-cond.c +++ b/gcc/testsuite/gcc.dg/dfp/operator-cond.c @@ -1,19 +1,9 @@ -/* { dg-options "-std=gnu99 -O0" } */ +/* { dg-options "-O0" } */ /* C99 6.5.15 Conditional operator. Test with decimal float operands. */ -extern void abort (void); -static int failcnt = 0; - -/* Support compiling the test to report individual failures; default is - to abort as soon as a check fails. */ -#ifdef DBG -#include <stdio.h> -#define FAILURE { printf ("failed at line %d\n", __LINE__); failcnt++; } -#else -#define FAILURE abort (); -#endif +#include "dfp-dbg.h" volatile _Decimal32 d32a, d32b, d32c; volatile _Decimal64 d64a, d64b, d64c; @@ -63,5 +53,5 @@ main () if (d128a != d128b) FAILURE - return 0; + FINISH } diff --git a/gcc/testsuite/gcc.dg/dfp/operator-logical.c b/gcc/testsuite/gcc.dg/dfp/operator-logical.c index 90a94b078fa..c784468c77a 100644 --- a/gcc/testsuite/gcc.dg/dfp/operator-logical.c +++ b/gcc/testsuite/gcc.dg/dfp/operator-logical.c @@ -1,16 +1,14 @@ -/* { dg-options "-std=gnu99" } */ - /* C99 Logical AND operator. C99 Logical OR operator. Test with decimal float operands. */ -extern void abort (void); +#include "dfp-dbg.h" #define OPERATE(OPRD1,OPRT,OPRD2,RLT) \ do \ { \ if (( (OPRD1) OPRT (OPRD2) )!= RLT) \ - abort (); \ + __builtin_abort (); \ } while (0) #define DECIMAL_LOGICAL_OR(OPRD) \ diff --git a/gcc/testsuite/gcc.dg/dfp/operator-unary.c b/gcc/testsuite/gcc.dg/dfp/operator-unary.c index bcf50683c0c..65f0be074d9 100644 --- a/gcc/testsuite/gcc.dg/dfp/operator-unary.c +++ b/gcc/testsuite/gcc.dg/dfp/operator-unary.c @@ -1,23 +1,21 @@ -/* { dg-options "-std=gnu99" } */ - /* C99 6.5.3 Unary operators. */ -extern void abort (void); +#include "dfp-dbg.h" #define AUTO_INCREASE_DECREASE(TYPE,SUFFIX) \ do \ { \ - _Decimal##TYPE in_de_d##TYPE = 0.0##SUFFIX; \ - if (in_de_d##TYPE++) abort (); \ - if (--in_de_d##TYPE) abort (); \ - if (++in_de_d##TYPE == 0.0##SUFFIX) abort (); \ - if (in_de_d##TYPE-- == 0.0##SUFFIX) abort (); \ + _Decimal##TYPE in_de_d##TYPE = 0.0##SUFFIX; \ + if (in_de_d##TYPE++) FAILURE \ + if (--in_de_d##TYPE) FAILURE \ + if (++in_de_d##TYPE == 0.0##SUFFIX) FAILURE \ + if (in_de_d##TYPE-- == 0.0##SUFFIX) FAILURE \ } while(0) #define UNARY_OPERATOR(TYPE,SUFFIX) \ do \ { \ - _Decimal##TYPE unary_d##TYPE = 1.0##SUFFIX; \ + _Decimal##TYPE unary_d##TYPE = 1.0##SUFFIX; \ _Decimal##TYPE* unary_dp##TYPE; \ /* & operator. */ \ unary_dp##TYPE = &(unary_d##TYPE); \ @@ -25,11 +23,11 @@ do \ unary_d##TYPE = *(unary_dp##TYPE); \ /* - operator. */ \ unary_d##TYPE = -unary_d##TYPE; \ - if (unary_d##TYPE != -1.0##SUFFIX) abort (); \ + if (unary_d##TYPE != -1.0##SUFFIX) FAILURE \ /* + operator. */ \ unary_d##TYPE = +unary_d##TYPE; \ - if (unary_d##TYPE != -1.0##SUFFIX) abort (); \ - if (!unary_d##TYPE) abort (); /*! operator. */ \ + if (unary_d##TYPE != -1.0##SUFFIX) FAILURE \ + if (!unary_d##TYPE) FAILURE /*! operator. */ \ } while (0) int @@ -46,9 +44,9 @@ main () UNARY_OPERATOR(128, DL); /* C99 6.5.3 Unary operators for zero values. */ - if (- +0.df != -0.df) abort (); - if (+ -0.df != -0.df) abort (); - if (- -0.df != +0.df) abort (); + if (- +0.df != -0.df) FAILURE + if (+ -0.df != -0.df) FAILURE + if (- -0.df != +0.df) FAILURE - return 0; + FINISH } diff --git a/gcc/testsuite/gcc.dg/dfp/pr31344.c b/gcc/testsuite/gcc.dg/dfp/pr31344.c index de76a72f937..0f5e21ecdff 100644 --- a/gcc/testsuite/gcc.dg/dfp/pr31344.c +++ b/gcc/testsuite/gcc.dg/dfp/pr31344.c @@ -1,6 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O -std=gnu99 -mtune=i386" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */ -/* { dg-options "-O -std=gnu99" } */ +/* { dg-options "-O -mtune=i386" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */ +/* { dg-options "-O" } */ typedef struct { diff --git a/gcc/testsuite/gcc.dg/dfp/pr31385.c b/gcc/testsuite/gcc.dg/dfp/pr31385.c index 63a23c4bb75..72f5f935f09 100644 --- a/gcc/testsuite/gcc.dg/dfp/pr31385.c +++ b/gcc/testsuite/gcc.dg/dfp/pr31385.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-std=gnu99 -O2" } */ +/* { dg-options "-O2" } */ typedef _Decimal32 fp_t; diff --git a/gcc/testsuite/gcc.dg/dfp/pr33466.c b/gcc/testsuite/gcc.dg/dfp/pr33466.c index c8ac1116558..e1cd76b74ff 100644 --- a/gcc/testsuite/gcc.dg/dfp/pr33466.c +++ b/gcc/testsuite/gcc.dg/dfp/pr33466.c @@ -1,5 +1,4 @@ /* { dg-do compile } */ -/* { dg-options "-std=gnu99" } */ /* The suffix for a decimal float constant must use a single case. diff --git a/gcc/testsuite/gcc.dg/dfp/pr35620.c b/gcc/testsuite/gcc.dg/dfp/pr35620.c index 90f9500c384..08137cfb6d9 100644 --- a/gcc/testsuite/gcc.dg/dfp/pr35620.c +++ b/gcc/testsuite/gcc.dg/dfp/pr35620.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-std=gnu99 -O2" } */ +/* { dg-options "-O2" } */ extern void foo (_Decimal32); _Decimal32 *p; diff --git a/gcc/testsuite/gcc.dg/dfp/pr36800.c b/gcc/testsuite/gcc.dg/dfp/pr36800.c index 5b899cf0e7f..76ff28c9815 100644 --- a/gcc/testsuite/gcc.dg/dfp/pr36800.c +++ b/gcc/testsuite/gcc.dg/dfp/pr36800.c @@ -1,26 +1,25 @@ /* { dg-do run } */ -/* { dg-options "-std=gnu99" } */ #include <stdarg.h> -extern void abort (void); +#include "dfp-dbg.h" void f (int a, ...) { va_list ap; if (a != 0) - abort (); + FAILURE va_start (ap, a); if (va_arg (ap, _Decimal128) != 1.2DL) - abort (); + FAILURE if (va_arg (ap, _Decimal128) != 2.34DL) - abort (); + FAILURE if (va_arg (ap, _Decimal128) != 3.456DL) - abort (); + FAILURE if (va_arg (ap, _Decimal128) != 4.567DL) - abort (); + FAILURE if (va_arg (ap, double) != 5.125) - abort (); + FAILURE va_end (ap); } @@ -28,5 +27,6 @@ int main (void) { f (0, 1.2DL, 2.34DL, 3.456DL, 4.567DL, 5.125); - return 0; + + FINISH } diff --git a/gcc/testsuite/gcc.dg/dfp/pr37435.c b/gcc/testsuite/gcc.dg/dfp/pr37435.c index 98acc9c118b..867fdd26bc4 100644 --- a/gcc/testsuite/gcc.dg/dfp/pr37435.c +++ b/gcc/testsuite/gcc.dg/dfp/pr37435.c @@ -1,5 +1,5 @@ /* { dg-do compile { target fpic } } */ -/* { dg-options "-std=gnu99 -O2 -fPIC" } */ +/* { dg-options "-O2 -fPIC" } */ volatile _Decimal32 d; volatile int i; diff --git a/gcc/testsuite/gcc.dg/dfp/pr39034.c b/gcc/testsuite/gcc.dg/dfp/pr39034.c index 6a261c9ddc2..2a7eedbdbe2 100644 --- a/gcc/testsuite/gcc.dg/dfp/pr39034.c +++ b/gcc/testsuite/gcc.dg/dfp/pr39034.c @@ -1,19 +1,10 @@ /* { dg-do run } */ -/* { dg-options "-std=gnu99 -O" } */ +/* { dg-options "-O" } */ /* DFP TR 24732 == WG14 / N1176, N1312 */ /* Based on a test from Fred Tydeman. */ -extern void abort (void); -int failures = 0; - -#ifdef DBG -#include <stdio.h> -#define FAILURE(MSG) { printf ("line %d: %s\n", __LINE__, MSG); failures++; } -#else -#define FAILURE(MSG) failures++; -#endif - +#include "dfp-dbg.h" /* Test runtime computations. */ @@ -25,9 +16,9 @@ runtime32 (void) _Decimal32 d32 = (float)((v1/v2-v3) - (v4/v5-v6)); if (b32) - FAILURE ("runtime: b32 should be zero") + FAILURE if (d32) - FAILURE ("runtime: d32 should be zero") + FAILURE } void @@ -38,9 +29,9 @@ runtime64 (void) _Decimal64 d64 = (double)((v1/v2-v3) - (v4/v5-v6)); if (b64) - FAILURE ("runtime: b64 should be zero") + FAILURE if (d64) - FAILURE ("runtime: d64 should be zero") + FAILURE } void @@ -52,9 +43,9 @@ runtime128 (void) _Decimal128 d128 = (long double)((v1/v2-v3) - (v4/v5-v6)); if (b128) - FAILURE ("runtime: b128 should be zero") + FAILURE if (d128) - FAILURE ("runtime: d128 should be zero") + FAILURE } /* Test constant folding. */ @@ -66,9 +57,9 @@ fold32 (void) _Decimal32 b32 = (float)((28.f/3.f-9.f) - (31.f/3.f-10.f)); if (b32) - FAILURE ("fold: b32 should be zero") + FAILURE if (d32) - FAILURE ("fold: d32 should be zero") + FAILURE } void @@ -78,9 +69,9 @@ fold64 (void) _Decimal64 d64 = (double)((28./3.-9.) - (31./3.-10.)); if (b64) - FAILURE ("fold: b64 should be zero") + FAILURE if (d64) - FAILURE ("fold: d64 should be zero") + FAILURE } void @@ -90,9 +81,9 @@ fold128 (void) _Decimal128 d128 = (long double)((28./3.-9.) - (31./3.-10.)); if (b128) - FAILURE ("fold: b128 should be zero") + FAILURE if (d128) - FAILURE ("fold: d128 should be zero") + FAILURE } int @@ -105,7 +96,5 @@ main () fold64 (); fold128 (); - if (failures != 0) - abort (); - return 0; + FINISH } diff --git a/gcc/testsuite/gcc.dg/dfp/pr39035.c b/gcc/testsuite/gcc.dg/dfp/pr39035.c index 2d44e06a432..2c9e8b386ed 100644 --- a/gcc/testsuite/gcc.dg/dfp/pr39035.c +++ b/gcc/testsuite/gcc.dg/dfp/pr39035.c @@ -1,18 +1,10 @@ /* { dg-do run } */ -/* { dg-options "-std=gnu99 -O" } */ +/* { dg-options "-O" } */ /* DFP TR 24732 == WG14 / N1176, N1312 */ /* Based on a test from Fred Tydeman. */ -extern void abort (void); -int failures = 0; - -#ifdef DBG -#include <stdio.h> -#define FAILURE(MSG) { printf ("line %d: %s\n", __LINE__, MSG); failures++; } -#else -#define FAILURE(MSG) failures++; -#endif +#include "dfp-dbg.h" /* Test runtime computations. */ @@ -22,7 +14,7 @@ runtime32 (void) volatile _Decimal32 d; d = 0.0DF; if (d) - FAILURE ("0.0DF should be zero") + FAILURE } void @@ -31,7 +23,7 @@ runtime64 (void) volatile _Decimal64 d; d = 0.0DD; if (d) - FAILURE ("0.0DD should be zero") + FAILURE } void @@ -40,28 +32,28 @@ runtime128 (void) volatile _Decimal128 d; d = 0.0DL; if (d) - FAILURE ("0.0DL should be zero") + FAILURE } void fold32 (void) { if (0.0DF) - FAILURE ("0.0DF should be zero") + FAILURE } void fold64 (void) { if (0.0DD) - FAILURE ("0.0DD should be zero") + FAILURE } void fold128 (void) { if (0.0DL) - FAILURE ("0.0DL should be zero") + FAILURE } int @@ -75,7 +67,5 @@ main(void) fold64 (); fold128 (); - if (failures != 0) - abort (); - return 0; + FINISH } diff --git a/gcc/testsuite/gcc.dg/dfp/pr39902.c b/gcc/testsuite/gcc.dg/dfp/pr39902.c index 120610c3779..847069966e3 100644 --- a/gcc/testsuite/gcc.dg/dfp/pr39902.c +++ b/gcc/testsuite/gcc.dg/dfp/pr39902.c @@ -1,18 +1,8 @@ -/* { dg-options "--std=gnu99" } */ - /* Check that optimizations like (x * 1) to x, or (x * -1) to -x, do not apply to decimal float computations where trailing zeroes are significant. */ -extern void abort (void); -int failcnt; - -#ifdef DBG -extern int printf (const char *, ...); -#define FAILURE { printf ("failed at line %d\n", __LINE__); failcnt++; } -#else -#define FAILURE abort (); -#endif +#include "dfp-dbg.h" #define COMPARE32(A,B) \ A.i == B.i @@ -232,8 +222,5 @@ main (void) doit64 (); doit128 (); - if (failcnt != 0) - abort (); - - return 0; + FINISH } diff --git a/gcc/testsuite/gcc.dg/dfp/pr39986.c b/gcc/testsuite/gcc.dg/dfp/pr39986.c index 53bda3c824a..04ff2b623e0 100644 --- a/gcc/testsuite/gcc.dg/dfp/pr39986.c +++ b/gcc/testsuite/gcc.dg/dfp/pr39986.c @@ -1,5 +1,4 @@ /* { dg-do compile } */ -/* { dg-options "-std=gnu99" } */ /* Check that the compiler generates the correct decimal float constants. */ diff --git a/gcc/testsuite/gcc.dg/dfp/pragma-float-const-decimal64-1.c b/gcc/testsuite/gcc.dg/dfp/pragma-float-const-decimal64-1.c index 79fabf34484..62d85b6d349 100644 --- a/gcc/testsuite/gcc.dg/dfp/pragma-float-const-decimal64-1.c +++ b/gcc/testsuite/gcc.dg/dfp/pragma-float-const-decimal64-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-std=gnu99 -Wall" } */ +/* { dg-options "-Wall" } */ /* N1312 7.1.1: The FLOAT_CONST_DECIMAL64 pragma. C99 6.4.4.2a (New). diff --git a/gcc/testsuite/gcc.dg/dfp/pragma-float-const-decimal64-2.c b/gcc/testsuite/gcc.dg/dfp/pragma-float-const-decimal64-2.c index 212748c6c78..8bc49f77106 100644 --- a/gcc/testsuite/gcc.dg/dfp/pragma-float-const-decimal64-2.c +++ b/gcc/testsuite/gcc.dg/dfp/pragma-float-const-decimal64-2.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-std=gnu99 -Wall" } */ +/* { dg-options "-Wall" } */ /* N1312 7.1.1: The FLOAT_CONST_DECIMAL64 pragma. C99 6.4.4.2a (New). diff --git a/gcc/testsuite/gcc.dg/dfp/pragma-float-const-decimal64-3.c b/gcc/testsuite/gcc.dg/dfp/pragma-float-const-decimal64-3.c index b9286aac11a..19599867035 100644 --- a/gcc/testsuite/gcc.dg/dfp/pragma-float-const-decimal64-3.c +++ b/gcc/testsuite/gcc.dg/dfp/pragma-float-const-decimal64-3.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-std=gnu99 -Wall" } */ +/* { dg-options "-Wall" } */ /* N1312 7.1.1: The FLOAT_CONST_DECIMAL64 pragma. C99 6.4.4.2a (New). */ diff --git a/gcc/testsuite/gcc.dg/dfp/pragma-float-const-decimal64-4.c b/gcc/testsuite/gcc.dg/dfp/pragma-float-const-decimal64-4.c index 86cec1dbd45..af0398daf79 100644 --- a/gcc/testsuite/gcc.dg/dfp/pragma-float-const-decimal64-4.c +++ b/gcc/testsuite/gcc.dg/dfp/pragma-float-const-decimal64-4.c @@ -1,5 +1,4 @@ /* { dg-do compile } */ -/* { dg-options "-std=gnu99" } */ /* N1312 7.1.1: The FLOAT_CONST_DECIMAL64 pragma. C99 6.4.4.2a (New). diff --git a/gcc/testsuite/gcc.dg/dfp/pragma-float-const-decimal64-7.c b/gcc/testsuite/gcc.dg/dfp/pragma-float-const-decimal64-7.c index 7533ee7f0de..55e0d661c03 100644 --- a/gcc/testsuite/gcc.dg/dfp/pragma-float-const-decimal64-7.c +++ b/gcc/testsuite/gcc.dg/dfp/pragma-float-const-decimal64-7.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-std=gnu99 -Wall" } */ +/* { dg-options "-Wall" } */ /* N1312 7.1.1: The FLOAT_CONST_DECIMAL64 pragma. C99 6.4.4.2a (New). diff --git a/gcc/testsuite/gcc.dg/dfp/pragma-float-const-decimal64-8.c b/gcc/testsuite/gcc.dg/dfp/pragma-float-const-decimal64-8.c index 5dbbda5b8f2..39d38c1d8f0 100644 --- a/gcc/testsuite/gcc.dg/dfp/pragma-float-const-decimal64-8.c +++ b/gcc/testsuite/gcc.dg/dfp/pragma-float-const-decimal64-8.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-std=gnu99 -Wall" } */ +/* { dg-options "-Wall" } */ /* N1312 7.1.1: The FLOAT_CONST_DECIMAL64 pragma. C99 6.4.4.2a (New). diff --git a/gcc/testsuite/gcc.dg/dfp/signbit-1.c b/gcc/testsuite/gcc.dg/dfp/signbit-1.c index cde28f9ba84..d83d2a48ed7 100644 --- a/gcc/testsuite/gcc.dg/dfp/signbit-1.c +++ b/gcc/testsuite/gcc.dg/dfp/signbit-1.c @@ -1,16 +1,8 @@ -/* { dg-options "-O0 -std=gnu99" } */ +/* { dg-options "-O0" } */ /* Decimal float versions of __builtin_signbit. */ -extern void abort (void); -int failures; - -#ifdef DBG -extern int printf (const char *, ...); -#define FAILURE { printf ("failed at line %d\n", __LINE__); failures++; } -#else -#define FAILURE abort (); -#endif +#include "dfp-dbg.h" #define CHECK32(D,I) \ if ((__builtin_signbitd32 (D) != 0) != I) FAILURE @@ -44,7 +36,5 @@ main () td = 0.0dl; CHECK128 (td, 0) td = -0.0dl; CHECK128 (td, 1) - if (failures != 0) - abort (); - return 0; + FINISH } diff --git a/gcc/testsuite/gcc.dg/dfp/signbit-2.c b/gcc/testsuite/gcc.dg/dfp/signbit-2.c index 6f9a2276b8a..e7d3f0405e7 100644 --- a/gcc/testsuite/gcc.dg/dfp/signbit-2.c +++ b/gcc/testsuite/gcc.dg/dfp/signbit-2.c @@ -1,9 +1,9 @@ -/* { dg-options "-O0 -std=gnu99" } */ +/* { dg-options "-O0" } */ /* Check that the compiler uses builtins for signbit; if not the link will fail because library functions are in libm. */ -extern void abort (void); +#include "dfp-dbg.h" volatile _Decimal32 sd = 2.3df; volatile _Decimal64 dd = -4.5dd; @@ -22,12 +22,12 @@ extern int signbitd128 (_Decimal128); int main () { - if (signbitf (f) != 0) abort (); - if (signbit (d) == 0) abort (); - if (signbitl (ld) != 0) abort (); - if (signbitd32 (sd) != 0) abort (); - if (signbitd64 (dd) == 0) abort (); - if (signbitd128 (tf) != 0) abort (); + if (signbitf (f) != 0) FAILURE + if (signbit (d) == 0) FAILURE + if (signbitl (ld) != 0) FAILURE + if (signbitd32 (sd) != 0) FAILURE + if (signbitd64 (dd) == 0) FAILURE + if (signbitd128 (tf) != 0) FAILURE - return 0; + FINISH } diff --git a/gcc/testsuite/gcc.dg/dfp/struct-layout-1.c b/gcc/testsuite/gcc.dg/dfp/struct-layout-1.c index 9e54e48c726..2a9d7304fd1 100644 --- a/gcc/testsuite/gcc.dg/dfp/struct-layout-1.c +++ b/gcc/testsuite/gcc.dg/dfp/struct-layout-1.c @@ -1,8 +1,5 @@ -/* { dg-options "-std=gnu99" } */ - #include <stdarg.h> - -extern void abort (void); +#include "dfp-dbg.h" struct S1 { @@ -39,20 +36,6 @@ struct S5 } a; }; -static int failcnt = 0; - -/* Support compiling the test to report individual failures; default is - to abort as soon as a check fails. */ -#ifdef DBG -#include <stdio.h> -#define FAILURE do \ -{ printf ("failed at line %d\n", __LINE__); \ - failcnt++; \ -}while(0) -#else -#define FAILURE abort () -#endif - int check_var (int z, ...) { long long result; @@ -84,8 +67,5 @@ int main () if (check_var (2, s5, 2LL) == 0) FAILURE; - if (failcnt) - abort (); - - return 0; + FINISH } diff --git a/gcc/testsuite/gcc.dg/dfp/typespec.c b/gcc/testsuite/gcc.dg/dfp/typespec.c index c7fc343ec43..a4545d5d921 100644 --- a/gcc/testsuite/gcc.dg/dfp/typespec.c +++ b/gcc/testsuite/gcc.dg/dfp/typespec.c @@ -1,7 +1,6 @@ /* Test for valid and invalid combinations of type specifiers. Based off gcc.dg/test-spec-1.c */ /* { dg-do compile } */ -/* { dg-options "-std=gnu99" } */ typedef char type; void _Decimal32 *x0; /* { dg-error "" "void _Decimal32" } */ diff --git a/gcc/testsuite/gcc.dg/dfp/union-init.c b/gcc/testsuite/gcc.dg/dfp/union-init.c index fede76ba328..6896ece99b2 100644 --- a/gcc/testsuite/gcc.dg/dfp/union-init.c +++ b/gcc/testsuite/gcc.dg/dfp/union-init.c @@ -1,8 +1,6 @@ -/* { dg-options "-std=gnu99" } */ - /* Cast to union is a GNU C extension. */ -extern void abort (void); +#include "dfp-dbg.h" union u { @@ -30,10 +28,10 @@ int main () double d; if (u1.d128 != 0.0dl) - abort (); + FAILURE if (u2.d128 != 4.2dl) - abort (); + FAILURE /* cast decimal floating point to union type. */ d128 = 1.23dl; @@ -42,19 +40,19 @@ int main () u4 = (union u) d128; if (u4.d128 != 1.23dl) - abort (); + FAILURE u4 = (union u) d; if (u4.d != 3.25) - abort (); + FAILURE n1 = (union n) d64; if (n1.d64 != 4.56dd) - abort (); + FAILURE n1 = (union n)d; if (n1.d != 3.25) - abort (); + FAILURE - return 0; + FINISH } diff --git a/gcc/testsuite/gcc.dg/dfp/usual-arith-conv-bad-2.c b/gcc/testsuite/gcc.dg/dfp/usual-arith-conv-bad-2.c index 4693abc90d9..7bd0f64f136 100644 --- a/gcc/testsuite/gcc.dg/dfp/usual-arith-conv-bad-2.c +++ b/gcc/testsuite/gcc.dg/dfp/usual-arith-conv-bad-2.c @@ -1,5 +1,4 @@ /* { dg-do compile } */ -/* { dg-options "-std=gnu99" } */ /* This used to result in an ICE. */ diff --git a/gcc/testsuite/gcc.dg/dfp/usual-arith-conv-bad.c b/gcc/testsuite/gcc.dg/dfp/usual-arith-conv-bad.c index e4033ca50f4..e14c7b20a12 100644 --- a/gcc/testsuite/gcc.dg/dfp/usual-arith-conv-bad.c +++ b/gcc/testsuite/gcc.dg/dfp/usual-arith-conv-bad.c @@ -1,5 +1,4 @@ /* { dg-do compile } */ -/* { dg-options "-std=gnu99" } */ /* N1150 5.4: Usual arithmetic conversions. C99 6.3.1.8[1] (New). diff --git a/gcc/testsuite/gcc.dg/dfp/usual-arith-conv-const.c b/gcc/testsuite/gcc.dg/dfp/usual-arith-conv-const.c index 3f06e4753ff..0d39a24bb65 100644 --- a/gcc/testsuite/gcc.dg/dfp/usual-arith-conv-const.c +++ b/gcc/testsuite/gcc.dg/dfp/usual-arith-conv-const.c @@ -1,5 +1,4 @@ /* { dg-do compile } */ -/* { dg-options "-std=gnu99" } */ /* Test various conversions involving decimal floating types. */ diff --git a/gcc/testsuite/gcc.dg/dfp/usual-arith-conv.c b/gcc/testsuite/gcc.dg/dfp/usual-arith-conv.c index 584058b8cc4..baff06bc175 100644 --- a/gcc/testsuite/gcc.dg/dfp/usual-arith-conv.c +++ b/gcc/testsuite/gcc.dg/dfp/usual-arith-conv.c @@ -1,4 +1,4 @@ -/* { dg-options "-std=gnu99 -O0" } */ +/* { dg-options "-O0" } */ /* N1150 5.4: Usual arithmetic conversions. C99 6.3.1.8[1] (New). @@ -6,17 +6,7 @@ Test arithmetic operators with different decimal float types, and between decimal float types and integer types. */ -extern void abort (void); -static int failcnt = 0; - -/* Support compiling the test to report individual failures; default is - to abort as soon as a check fails. */ -#ifdef DBG -#include <stdio.h> -#define FAILURE { printf ("failed at line %d\n", __LINE__); failcnt++; } -#else -#define FAILURE abort (); -#endif +#include "dfp-dbg.h" volatile _Decimal32 d32a, d32b, d32c; volatile _Decimal64 d64a, d64b, d64c; @@ -123,5 +113,5 @@ main () if (d128a != d128c / 2.0dl) FAILURE - return 0; + FINISH } diff --git a/gcc/testsuite/gcc.dg/dfp/wtr-conversion-1.c b/gcc/testsuite/gcc.dg/dfp/wtr-conversion-1.c index 0994c65783e..2b50fe6a56e 100644 --- a/gcc/testsuite/gcc.dg/dfp/wtr-conversion-1.c +++ b/gcc/testsuite/gcc.dg/dfp/wtr-conversion-1.c @@ -3,7 +3,7 @@ Based on gcc.dg/wtr-conversion-1.c */ /* { dg-do compile } */ -/* { dg-options "-std=gnu99 -Wtraditional" } */ +/* { dg-options "-Wtraditional" } */ extern void foo_i (int); extern void foo_f (float); |