From: Zack Weinberg Date: Tue, 23 May 2000 19:30:44 +0000 (+0000) Subject: bcp-1.c: Replace abort in arg of __builtin_constant_p with a generic external function. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7b8442983d5a10cc648ffd493c9bb44569367fa5;p=gcc.git bcp-1.c: Replace abort in arg of __builtin_constant_p with a generic external function. gcc/testsuite: * c-torture/execute/bcp-1.c: Replace abort in arg of __builtin_constant_p with a generic external function. * gcc.dg/20000108-1.c, gcc.dg/980211-1.c, gcc.dg/980414-1.c, gcc.dg/990119-1.c, gcc.dg/990409.c, gcc.dg/990424-1.c, gcc.dg/991230-1.c, gcc.dg/clobbers.c, gcc.dg/lineno.c, gcc.dg/noreturn-1.c, gcc.dg/trigraphs.c, gcc.dg/uninit-4.c: Prototype abort and/or exit. * gcc.dg/990407-1.c, gcc.dg/strpaste.c, gcc.dg/special/alias-1.c, gcc.dg/special/gcsec-1.c, gcc.dg/special/weak-1.c, gcc.dg/special/weak-2.c, gcc.dg/special/wkali-1.c, gcc.dg/special/wkali-2.c: Include stdlib.h. libio/tests: * tfformat.c: Include stdlib.h. From-SVN: r34110 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 179e7bfb41a..8b280cbe725 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,19 @@ +2000-05-23 Zack Weinberg + + * c-torture/execute/bcp-1.c: Replace abort in arg of + __builtin_constant_p with a generic external function. + + * gcc.dg/20000108-1.c, gcc.dg/980211-1.c, gcc.dg/980414-1.c, + gcc.dg/990119-1.c, gcc.dg/990409.c, gcc.dg/990424-1.c, + gcc.dg/991230-1.c, gcc.dg/clobbers.c, gcc.dg/lineno.c, + gcc.dg/noreturn-1.c, gcc.dg/trigraphs.c, gcc.dg/uninit-4.c: + Prototype abort and/or exit. + + * gcc.dg/990407-1.c, gcc.dg/strpaste.c, + gcc.dg/special/alias-1.c, gcc.dg/special/gcsec-1.c, + gcc.dg/special/weak-1.c, gcc.dg/special/weak-2.c, + gcc.dg/special/wkali-1.c, gcc.dg/special/wkali-2.c: Include stdlib.h. + 2000-05-22 Alexandre Oliva * gcc.dg/dwarf2-1.c: New test. diff --git a/gcc/testsuite/gcc.c-torture/execute/bcp-1.c b/gcc/testsuite/gcc.c-torture/execute/bcp-1.c index 38b1d3e8e93..fcb65cb321e 100644 --- a/gcc/testsuite/gcc.c-torture/execute/bcp-1.c +++ b/gcc/testsuite/gcc.c-torture/execute/bcp-1.c @@ -1,4 +1,5 @@ int global; +int func(void); /* These must fail. */ int bad0(void) { return __builtin_constant_p(global); } @@ -8,7 +9,7 @@ inline int bad3(int x) { return __builtin_constant_p(x); } inline int bad4(const char *x) { return __builtin_constant_p(x); } int bad5(void) { return bad2(1); } inline int bad6(int x) { return __builtin_constant_p(x+1); } -int bad7(void) { return __builtin_constant_p(abort()); } +int bad7(void) { return __builtin_constant_p(func()); } int bad8(void) { char buf[10]; return __builtin_constant_p(buf); } int bad9(const char *x) { return __builtin_constant_p(x[123456]); } int bad10(void) { return __builtin_constant_p(&global); } diff --git a/gcc/testsuite/gcc.dg/20000108-1.c b/gcc/testsuite/gcc.dg/20000108-1.c index f9ff668a8e6..4391be2ad8e 100644 --- a/gcc/testsuite/gcc.dg/20000108-1.c +++ b/gcc/testsuite/gcc.dg/20000108-1.c @@ -5,6 +5,8 @@ /* { dg-do run } */ /* { dg-options "-O3" } */ +extern void abort (void); + void foo () {} /* unused, but essential to trigger the bug */ int main () { diff --git a/gcc/testsuite/gcc.dg/980211-1.c b/gcc/testsuite/gcc.dg/980211-1.c index 6332b7e7e3f..11b3c36f172 100644 --- a/gcc/testsuite/gcc.dg/980211-1.c +++ b/gcc/testsuite/gcc.dg/980211-1.c @@ -3,6 +3,8 @@ /* { dg-do run { target i?86-*-* } } */ /* { dg-options -O2 } */ +extern void abort (void); + __inline int __signbitl (long double __x) { diff --git a/gcc/testsuite/gcc.dg/980414-1.c b/gcc/testsuite/gcc.dg/980414-1.c index fcd02b5f4a4..59382ef2c49 100644 --- a/gcc/testsuite/gcc.dg/980414-1.c +++ b/gcc/testsuite/gcc.dg/980414-1.c @@ -3,6 +3,8 @@ /* { dg-do run { target i?86-*-* } } */ /* { dg-options -O2 } */ +extern void abort (void); + static __inline double mypow (double __x, double __y) { diff --git a/gcc/testsuite/gcc.dg/990119-1.c b/gcc/testsuite/gcc.dg/990119-1.c index ce5807b89b2..c9b75bd7720 100644 --- a/gcc/testsuite/gcc.dg/990119-1.c +++ b/gcc/testsuite/gcc.dg/990119-1.c @@ -6,6 +6,8 @@ int i = __LINE__\ ; +extern void abort (void); + int main (void) /* { dg-bogus "parse error" "semicolon eaten" } */ { if (i != 6) diff --git a/gcc/testsuite/gcc.dg/990407-1.c b/gcc/testsuite/gcc.dg/990407-1.c index 96b3f862639..d6da8d65689 100644 --- a/gcc/testsuite/gcc.dg/990407-1.c +++ b/gcc/testsuite/gcc.dg/990407-1.c @@ -4,6 +4,7 @@ /* { dg-do run } */ #include +#include #define STR(x) #x diff --git a/gcc/testsuite/gcc.dg/990409-1.c b/gcc/testsuite/gcc.dg/990409-1.c index cda9dd87ad8..c7bfa617212 100644 --- a/gcc/testsuite/gcc.dg/990409-1.c +++ b/gcc/testsuite/gcc.dg/990409-1.c @@ -1,6 +1,8 @@ /* Test that __LINE__ works when embedded in a macro. */ /* { dg-do run } */ +extern void abort (void); + #define XLINE __LINE__ void diff --git a/gcc/testsuite/gcc.dg/990424-1.c b/gcc/testsuite/gcc.dg/990424-1.c index 589e0468e76..00b476427f3 100644 --- a/gcc/testsuite/gcc.dg/990424-1.c +++ b/gcc/testsuite/gcc.dg/990424-1.c @@ -6,6 +6,9 @@ void __attribute__((stdcall)) foo(int a, int b, int c); +extern void abort (void); +extern void exit (int); + int main () { diff --git a/gcc/testsuite/gcc.dg/991230-1.c b/gcc/testsuite/gcc.dg/991230-1.c index 42c6a8e6faa..39b259541de 100644 --- a/gcc/testsuite/gcc.dg/991230-1.c +++ b/gcc/testsuite/gcc.dg/991230-1.c @@ -3,6 +3,9 @@ /* Test that floating point greater-than tests are compiled correctly with -ffast-math. */ + +extern void abort (void); + static int gt (double a, double b) { if (a > b) diff --git a/gcc/testsuite/gcc.dg/clobbers.c b/gcc/testsuite/gcc.dg/clobbers.c index 0eddc14f953..474a396a051 100644 --- a/gcc/testsuite/gcc.dg/clobbers.c +++ b/gcc/testsuite/gcc.dg/clobbers.c @@ -2,6 +2,8 @@ /* { dg-do run { target i?86-*-* } } */ +extern void abort (void); + int main () { int i; diff --git a/gcc/testsuite/gcc.dg/lineno-2.c b/gcc/testsuite/gcc.dg/lineno-2.c index 64647e25a8c..77b940f0c13 100644 --- a/gcc/testsuite/gcc.dg/lineno-2.c +++ b/gcc/testsuite/gcc.dg/lineno-2.c @@ -2,6 +2,8 @@ /* Test #line with and without macros for the line number. */ +extern void abort (void); + #define L 90 #line 44 diff --git a/gcc/testsuite/gcc.dg/noreturn-1.c b/gcc/testsuite/gcc.dg/noreturn-1.c index 0adfbadf82b..6e72f362bf3 100644 --- a/gcc/testsuite/gcc.dg/noreturn-1.c +++ b/gcc/testsuite/gcc.dg/noreturn-1.c @@ -2,6 +2,8 @@ /* { dg-do compile } */ /* { dg-options "-O2 -Wmissing-noreturn" } */ +extern void exit (int); + extern void foo1(void) __attribute__ ((__noreturn__)); void foo1(void) diff --git a/gcc/testsuite/gcc.dg/special/alias-1.c b/gcc/testsuite/gcc.dg/special/alias-1.c index 347e1745630..d58393179a8 100644 --- a/gcc/testsuite/gcc.dg/special/alias-1.c +++ b/gcc/testsuite/gcc.dg/special/alias-1.c @@ -1,5 +1,7 @@ /* { dg-do link } */ +#include + extern int foo(void) __attribute__((alias("bar"))); int bar(void) { diff --git a/gcc/testsuite/gcc.dg/special/gcsec-1.c b/gcc/testsuite/gcc.dg/special/gcsec-1.c index fa3f884fcbf..125ae1f218b 100644 --- a/gcc/testsuite/gcc.dg/special/gcsec-1.c +++ b/gcc/testsuite/gcc.dg/special/gcsec-1.c @@ -1,5 +1,7 @@ /* { dg-do run } */ +#include + static int unusedint=5; static int usedint=1; diff --git a/gcc/testsuite/gcc.dg/special/weak-1.c b/gcc/testsuite/gcc.dg/special/weak-1.c index ccf2b087a94..fa02f22ace3 100644 --- a/gcc/testsuite/gcc.dg/special/weak-1.c +++ b/gcc/testsuite/gcc.dg/special/weak-1.c @@ -1,5 +1,7 @@ /* { dg-do run } */ +#include + int foo(void) __attribute__((weak)); int foo(void) { diff --git a/gcc/testsuite/gcc.dg/special/weak-2.c b/gcc/testsuite/gcc.dg/special/weak-2.c index 74259cf9bca..b51ba8373e0 100644 --- a/gcc/testsuite/gcc.dg/special/weak-2.c +++ b/gcc/testsuite/gcc.dg/special/weak-2.c @@ -1,5 +1,7 @@ /* { dg-do run } */ +#include + extern int foo(void); int main(void) { diff --git a/gcc/testsuite/gcc.dg/special/wkali-1.c b/gcc/testsuite/gcc.dg/special/wkali-1.c index d33c8d1d601..f28d40b9795 100644 --- a/gcc/testsuite/gcc.dg/special/wkali-1.c +++ b/gcc/testsuite/gcc.dg/special/wkali-1.c @@ -1,5 +1,7 @@ /* { dg-do link } */ +#include + extern int foo(void) __attribute__((weak, alias("bar"))); int bar(void) { diff --git a/gcc/testsuite/gcc.dg/special/wkali-2.c b/gcc/testsuite/gcc.dg/special/wkali-2.c index 74259cf9bca..b51ba8373e0 100644 --- a/gcc/testsuite/gcc.dg/special/wkali-2.c +++ b/gcc/testsuite/gcc.dg/special/wkali-2.c @@ -1,5 +1,7 @@ /* { dg-do run } */ +#include + extern int foo(void); int main(void) { diff --git a/gcc/testsuite/gcc.dg/strpaste.c b/gcc/testsuite/gcc.dg/strpaste.c index 56e148489bc..096d968c96b 100644 --- a/gcc/testsuite/gcc.dg/strpaste.c +++ b/gcc/testsuite/gcc.dg/strpaste.c @@ -4,6 +4,7 @@ We got internal escape markers in the strings. */ #include +#include #define S(x) _S(x) #define _S(x) #x diff --git a/gcc/testsuite/gcc.dg/trigraphs.c b/gcc/testsuite/gcc.dg/trigraphs.c index 62ac10339af..5f60b632ee7 100644 --- a/gcc/testsuite/gcc.dg/trigraphs.c +++ b/gcc/testsuite/gcc.dg/trigraphs.c @@ -1,6 +1,8 @@ /* { dg-do run } */ /* { dg-options "-ansi" } */ +extern void abort (void); + /* Basic tests for trigraph conversion. All of them are here, but not in all possible contexts. *??/ / diff --git a/gcc/testsuite/gcc.dg/uninit-4.c b/gcc/testsuite/gcc.dg/uninit-4.c index 34973532c57..a27317ebed5 100644 --- a/gcc/testsuite/gcc.dg/uninit-4.c +++ b/gcc/testsuite/gcc.dg/uninit-4.c @@ -8,6 +8,8 @@ /* { dg-do compile } */ /* { dg-options "-O -Wuninitialized" } */ +extern void abort (void); + struct operation { short op; char rprio; diff --git a/libio/tests/ChangeLog b/libio/tests/ChangeLog index dc9a375a162..5d937238d57 100644 --- a/libio/tests/ChangeLog +++ b/libio/tests/ChangeLog @@ -1,3 +1,7 @@ +2000-05-23 Zack Weinberg + + * tfformat.c: Include stdlib.h. + 1997-10-31 Brendan Kehoe * tFile.cc (t4): Cast TMPFILE to char* in the call to unlink, to diff --git a/libio/tests/tfformat.c b/libio/tests/tfformat.c index 29bac8b6b79..56efa1a9eba 100644 --- a/libio/tests/tfformat.c +++ b/libio/tests/tfformat.c @@ -8,6 +8,8 @@ #endif #endif /* !TEST_LIBIO */ +#include /* for exit */ + /* Tests taken from Cygnus C library. */ typedef struct