diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg')
71 files changed, 0 insertions, 1976 deletions
diff --git a/gcc/testsuite/gcc.dg/980211-1.c b/gcc/testsuite/gcc.dg/980211-1.c deleted file mode 100644 index 6332b7e7e3f..00000000000 --- a/gcc/testsuite/gcc.dg/980211-1.c +++ /dev/null @@ -1,27 +0,0 @@ -/* Test long double on x86. */ - -/* { dg-do run { target i?86-*-* } } */ -/* { dg-options -O2 } */ - -__inline int -__signbitl (long double __x) -{ - union { long double __l; int __i[3]; } __u = { __l: __x }; - - return (__u.__i[2] & 0x8000) != 0; -} - -void -foo (long double x, long double y) -{ - long double z = x / y; - if (__signbitl (x) && __signbitl (z)) - abort (); -} - -int main() -{ - if (sizeof (long double) > sizeof (double)) - foo (-0.0, -1.0); - return 0; -} diff --git a/gcc/testsuite/gcc.dg/980217-1.c b/gcc/testsuite/gcc.dg/980217-1.c deleted file mode 100644 index 2236e848d03..00000000000 --- a/gcc/testsuite/gcc.dg/980217-1.c +++ /dev/null @@ -1,36 +0,0 @@ -/* Test float on alpha. */ - -/* { dg-do run { target alpha*-*-* } } */ -/* { dg-options "-mieee -O2" } */ - -typedef int int32_t __attribute__ ((__mode__ ( __SI__ ))) ; -typedef union -{ - float value; - int32_t word; -} ieee_float_shape_type; - -int isinff(float x) -{ - int32_t ix,t; - ieee_float_shape_type gf_u; - gf_u.value = x; - ix = gf_u.word; - printf ("%x\n", ix); - t = ix & 0x7fffffff; - t ^= 0x7f800000; - t |= -t; - return ~(t >> 31) & (1 - ((ix & 0x80000000) >> 30)); -} - -main () -{ - float x = 1.0 / 0.0; - int i = isinff (x); - - if (i == 0) - abort (); - - printf ("%d\n", i); - return 0; -} diff --git a/gcc/testsuite/gcc.dg/980226-1.c b/gcc/testsuite/gcc.dg/980226-1.c deleted file mode 100644 index f66e9e2a9f7..00000000000 --- a/gcc/testsuite/gcc.dg/980226-1.c +++ /dev/null @@ -1,12 +0,0 @@ -/* { dg-do compile { target i?86-*-* } } */ -/* { dg-options -O2 } */ - -extern double bar (double); - -int -baz (double d) -{ - double e = bar (d); - asm volatile ("" : : : "st"); - return printf ("%lg\n", e); -} diff --git a/gcc/testsuite/gcc.dg/980312-1.c b/gcc/testsuite/gcc.dg/980312-1.c deleted file mode 100644 index 8f72c31d341..00000000000 --- a/gcc/testsuite/gcc.dg/980312-1.c +++ /dev/null @@ -1,24 +0,0 @@ -/* { dg-do link { target i?86-*-* } } */ -/* { dg-options "-O2 -march=pentiumpro" } */ - -extern __inline double -__expm1 (double __x) -{ - double __temp; - __temp = 1.0; - return __temp; -} -extern __inline double -__sgn1 (double __x) -{ - return __x >= 0.0 ? 1.0 : -1.0; -} -double -tanh (double __x) -{ - return __expm1 (__x) * __sgn1 (-__x); -} -main () -{ - return tanh (3.45) != 0; -} diff --git a/gcc/testsuite/gcc.dg/980313-1.c b/gcc/testsuite/gcc.dg/980313-1.c deleted file mode 100644 index 1036339b076..00000000000 --- a/gcc/testsuite/gcc.dg/980313-1.c +++ /dev/null @@ -1,25 +0,0 @@ -/* { dg-do link { target i?86-*-* } } */ -/* { dg-options "-O2 -march=pentiumpro" } */ - -extern __inline double -__expm1 (double __x) -{ - double __temp; - __temp -= 1.0; - return __temp; -} -extern __inline double -__sgn1 (double __x) -{ - return __x >= 0.0 ? 1.0 : -1.0; -} -double -tanh (double __x) -{ - register double __exm1 = __expm1 (__x); - return __exm1 / (__exm1 + 2.0) * __sgn1 (-__x); -} -main () -{ - return tanh (3.45) != 0; -} diff --git a/gcc/testsuite/gcc.dg/980414-1.c b/gcc/testsuite/gcc.dg/980414-1.c deleted file mode 100644 index 8fd0e127296..00000000000 --- a/gcc/testsuite/gcc.dg/980414-1.c +++ /dev/null @@ -1,76 +0,0 @@ -/* Test double on x86. */ - -/* { dg-do run { target i?86-*-* } } */ -/* { dg-options -O2 } */ - -static __inline double -mypow (double __x, double __y) -{ - register double __value, __exponent; - long __p = (long) __y; - if (__y == (double) __p) - { - double __r = 1.0; - if (__p == 0) - return 1.0; - if (__p < 0) - { - __p = -__p; - __x = 1.0 / __x; - } - while (1) - { - if (__p & 1) - __r *= __x; - __p >>= 1; - if (__p == 0) - return __r; - __x *= __x; - } - } - __asm __volatile__ - ("fmul %%st(1),%%st\n\t" /* y * log2(x) */ - "fst %%st(1)\n\t" - "frndint\n\t" /* int(y * log2(x)) */ - "fxch\n\t" - "fsub %%st(1),%%st\n\t" /* fract(y * log2(x)) */ - "f2xm1\n\t" /* 2^(fract(y * log2(x))) - 1 */ - : "=t" (__value), "=u" (__exponent) : "0" (__x), "1" (__y)); - __value += 1.0; - __asm __volatile__ - ("fscale" - : "=t" (__value) : "0" (__value), "u" (__exponent)); - return __value; -} - -const double E1 = 2.71828182845904523536028747135; - -double fact (double x) -{ - double corr; - corr = 1.0; - return corr * mypow(x/E1, x); -} - -int main () -{ - double y, z; - - y = fact (46.2); - z = mypow (46.2/E1, 46.2); - -#if 0 - printf ("%26.19e, %26.19e\n", y, z); -#endif - - if (y > z) - y -= z; - else - y = z - y; - - y /= z; - if (y > 0.1) - abort (); - - return 0; -} diff --git a/gcc/testsuite/gcc.dg/980502-1.c b/gcc/testsuite/gcc.dg/980502-1.c deleted file mode 100644 index f06491cd96c..00000000000 --- a/gcc/testsuite/gcc.dg/980502-1.c +++ /dev/null @@ -1,9 +0,0 @@ -/* { dg-do compile }*/ -/* { dg-options "-O2" } */ - -char *const f(void) -{ - char *const line = "/dev/ptyXX"; - line[8] = 1; - return line; -} diff --git a/gcc/testsuite/gcc.dg/980520-1.c b/gcc/testsuite/gcc.dg/980520-1.c deleted file mode 100644 index e1401824f54..00000000000 --- a/gcc/testsuite/gcc.dg/980520-1.c +++ /dev/null @@ -1,17 +0,0 @@ -/* { dg-do compile { target i?86-*-* } } */ -/* { dg-options -O2 } */ - -int bug(void) -{ - unsigned long a, b; - - __asm__("" - : "=d" (a) - : - : "memory"); - __asm__ __volatile__("" - : - : "g" (b) - : "memory"); - return a; -} diff --git a/gcc/testsuite/gcc.dg/980523-1.c b/gcc/testsuite/gcc.dg/980523-1.c deleted file mode 100644 index 6265a733780..00000000000 --- a/gcc/testsuite/gcc.dg/980523-1.c +++ /dev/null @@ -1,51 +0,0 @@ -/* { dg-do run { target rs6000-*-linux* powerpc-*-linux*} } */ -/* { dg-options "-O2 -fpic" } */ - -void foo1(int a, char *b, int c) -{ - c =a+c+234; -} - -int foo2(int d) -{ - return d*d; -} - -int bar1, bar2, bar3; -char * bar4; - -int main(void) { - int h; - bar1 = foo2(1); - bar2 = foo2(1); - - h = foo2(1); - foo1(1, "a", foo2(1)); - foo1(bar1, "a", foo2(1)); - foo2(1); - - h = foo2(1); - bar3 = 1; - bar4 = "a"; - foo1(1, "n", foo2(1)); - foo1(1, "o", foo2(1)); - foo1(1, "p", foo2(1)); - foo1(bar1, "a", foo2(1)); - - bar3 = h; - bar4 = "b"; foo1(bar1, "b", foo2(1)); - foo1(1, "q", foo2(1)); - bar4 = "c"; foo1(1, "c", foo2(1)); - bar4 = "d"; foo1(1, "d", foo2(1)); - bar4 = "e"; foo1(1, "e", foo2(1)); - bar4 = "f"; foo1(1, "f", foo2(1)); - bar4 = "g"; foo1(1, "g", foo2(1)); - bar4 = "h"; foo1(1, "h", foo2(1)); - bar4 = "i"; foo1(1, "i", foo2(1)); - bar4 = "j"; foo1(1, "j", foo2(1)); - bar4 = "k"; foo1(1, "k", foo2(1)); - bar4 = "l"; foo1(1, "l", foo2(1)); - bar4 = "m"; - foo1(bar2, "m", foo2(1)); - exit(0); -} diff --git a/gcc/testsuite/gcc.dg/980526-1.c b/gcc/testsuite/gcc.dg/980526-1.c deleted file mode 100644 index 08ef6e285a1..00000000000 --- a/gcc/testsuite/gcc.dg/980526-1.c +++ /dev/null @@ -1,17 +0,0 @@ -/* { dg-do compile { target rs6000-*-linux* powerpc-*-linux* } } */ -/* { dg-options "-O2 -fpic" } */ - -int -test(void) -{ - double value, maxValue = - (__extension__ ((union { unsigned __l __attribute__((__mode__(__DI__))); double __d; }) { __l: 0x7ff0000000000000ULL }).__d) ; - int idx, maxIdx = 1; - - for (idx = 1; idx < 22; idx++) { - if (value > maxValue) { - maxValue = value; - maxIdx = idx; - } - } - return 0 ; -} diff --git a/gcc/testsuite/gcc.dg/980709-1.c b/gcc/testsuite/gcc.dg/980709-1.c deleted file mode 100644 index a4359300587..00000000000 --- a/gcc/testsuite/gcc.dg/980709-1.c +++ /dev/null @@ -1,20 +0,0 @@ -/* { dg-do compile { target i?86-*-* } } */ -/* { dg-options -O2 } */ - -extern __inline__ int test_and_set_bit(int nr, volatile void * addr) -{ - int oldbit; - __asm__ __volatile__( "" - "btsl %2,%1\n\tsbbl %0,%0" - :"=r" (oldbit),"=m" (addr) - :"ir" (nr)); - return oldbit; -} -struct buffer_head { - unsigned long b_state; -}; -extern void lock_buffer(struct buffer_head * bh) -{ - while (test_and_set_bit(2 , &bh->b_state)) - __wait_on_buffer(bh); -} diff --git a/gcc/testsuite/gcc.dg/980816-1.c b/gcc/testsuite/gcc.dg/980816-1.c deleted file mode 100644 index 2a96ef4bcc9..00000000000 --- a/gcc/testsuite/gcc.dg/980816-1.c +++ /dev/null @@ -1,20 +0,0 @@ -/* { dg-do compile } */ -/* { dg-options -fno-force-mem } */ - -int -div_and_round_double (lden_orig, hden_orig) - int lden_orig, hden_orig; -{ - int quo[4]; - register int i; - unsigned int work; - register unsigned int carry = 0; - int lden = lden_orig; - int hden = hden_orig; - neg_double (&lden, &hden); - for (i = 4 - 1; i >= 0; i--) - { - quo[i] = work / (unsigned int ) lden; - carry = work % (unsigned int ) lden; - } -} diff --git a/gcc/testsuite/gcc.dg/980827-1.c b/gcc/testsuite/gcc.dg/980827-1.c deleted file mode 100644 index 0de02ccc58f..00000000000 --- a/gcc/testsuite/gcc.dg/980827-1.c +++ /dev/null @@ -1,26 +0,0 @@ -/* { dg-do run { target rs6000-*-linux* powerpc-*-linux*} } */ -/* { dg-options -O2 } */ - -double dval = 0; - -void splat (double d); - -int main(void) -{ - splat(0); - if (dval == 0) - abort(); - exit (0); -} - -void splat (double d) -{ - union { - double f; - unsigned int l[2]; - } u; - - u.f = d + d; - u.l[1] |= 1; - asm volatile ("stfd %0,dval@sdarel(13)" : : "f" (u.f)); -} diff --git a/gcc/testsuite/gcc.dg/990117-1.c b/gcc/testsuite/gcc.dg/990117-1.c deleted file mode 100644 index 2e7ea5a1551..00000000000 --- a/gcc/testsuite/gcc.dg/990117-1.c +++ /dev/null @@ -1,21 +0,0 @@ -/* { dg-do compile { target i?86-*-* } } */ -/* { dg-options "-O2 -march=pentiumpro" } */ - -extern __inline double -fabs (double __x) -{ - register double __value; - __asm __volatile__ - ("fabs" - : "=t" (__value) : "0" (__x)); - return __value; -} -int -foo () -{ - int i, j, k; - double x = 0, y = ((i == j) ? 1 : 0); - for (i = 0; i < 10; i++) - ; - fabs (x - y); -} diff --git a/gcc/testsuite/gcc.dg/990119-1.c b/gcc/testsuite/gcc.dg/990119-1.c deleted file mode 100644 index 7e33518a35c..00000000000 --- a/gcc/testsuite/gcc.dg/990119-1.c +++ /dev/null @@ -1,15 +0,0 @@ -/* This checks for two things: - - an obscure corner case in the standard rules for __LINE__ - - regression of an associated bug in cpplib where the semicolon got lost */ -/* { dg-do run } */ - -int i = __LINE__\ -; - -int main (void) /* { dg-bogus "parse error" "semicolon eaten" } */ -{ - if (i != 6) - abort(); - else - return 0; -} diff --git a/gcc/testsuite/gcc.dg/990130-1.c b/gcc/testsuite/gcc.dg/990130-1.c deleted file mode 100644 index 3e711c2febb..00000000000 --- a/gcc/testsuite/gcc.dg/990130-1.c +++ /dev/null @@ -1,24 +0,0 @@ -/* { dg-do compile { target i?86-*-* } } */ -/* { dg-options -O0 } */ - -typedef int SItype __attribute__ ((mode (SI))); -typedef int DItype __attribute__ ((mode (DI))); -typedef unsigned int USItype __attribute__ ((mode (SI))); - struct DIstruct {SItype low, high;}; -typedef union -{ - struct DIstruct s; - DItype ll; -} DIunion; -DItype -__muldi3 (DItype u, DItype v) -{ - DIunion w; - DIunion uu, vv; - uu.ll = u, - vv.ll = v; - w.ll = ({DIunion __w; __asm__ ("mull %3" : "=a" ((USItype) ( __w.s.low )), "=d" ((USItype) ( __w.s.high )) : "%0" ((USItype) ( uu.s.low )), "rm" ((USItype) ( vv.s.low ))) ; __w.ll; }) ; - w.s.high += ((USItype) uu.s.low * (USItype) vv.s.high - + (USItype) uu.s.high * (USItype) vv.s.low); - return w.ll; -} diff --git a/gcc/testsuite/gcc.dg/990213-1.c b/gcc/testsuite/gcc.dg/990213-1.c deleted file mode 100644 index a7c9f24898a..00000000000 --- a/gcc/testsuite/gcc.dg/990213-1.c +++ /dev/null @@ -1,12 +0,0 @@ -/* { dg-do compile } */ -/* { dg-options "-W -Wall -Werror" } */ - -static inline int unused_fn(int dummyarg) -{ - return dummyarg*dummyarg; -} - -int main() -{ - return 0; -} diff --git a/gcc/testsuite/gcc.dg/990213-2.c b/gcc/testsuite/gcc.dg/990213-2.c deleted file mode 100644 index 6e6b924ed89..00000000000 --- a/gcc/testsuite/gcc.dg/990213-2.c +++ /dev/null @@ -1,15 +0,0 @@ -/* { dg-do compile { target i?86-*-* } } */ -/* { dg-options "-fPIC" } */ - -struct normal_encoding {}; -struct unknown_encoding {}; -static const struct normal_encoding latin1_encoding = {}; - -struct encoding* -XmlInitUnknownEncoding(void *mem) -{ - int i; - struct unknown_encoding *e = mem; - for (i = 0; i < sizeof(struct normal_encoding); i++) - ((char *)mem)[i] = ((char *)&latin1_encoding)[i]; -} diff --git a/gcc/testsuite/gcc.dg/990214-1.c b/gcc/testsuite/gcc.dg/990214-1.c deleted file mode 100644 index 5701b5df713..00000000000 --- a/gcc/testsuite/gcc.dg/990214-1.c +++ /dev/null @@ -1,15 +0,0 @@ -/* { dg-do compile { target i?86-*-* } } */ -/* { dg-options "-fPIC" } */ - -typedef int int64_t __attribute__ ((__mode__ ( __DI__ ))) ; -unsigned * -bar (int64_t which) -{ - switch (which & 15 ) { - case 0 : - break; - case 1 : - case 5 : - case 2 : - } -} diff --git a/gcc/testsuite/gcc.dg/990228-1.c b/gcc/testsuite/gcc.dg/990228-1.c deleted file mode 100644 index 4b846ea219f..00000000000 --- a/gcc/testsuite/gcc.dg/990228-1.c +++ /dev/null @@ -1,29 +0,0 @@ -/* Regression test for cpp. The following input may cause core dumps - or # line markers in the middle of the line. */ -/* { dg-do preprocess } */ - -#define foo(string, arg) bar(2, string, arg) - -foo ("\ -\ -\ -\ -\ -\ -\ -\ -\ -\ -\ -", -NULL); - -/* - { dg-final { if ![file exists 990228-1.i] { return } } } - { dg-final { set tmp [grep 990228-1.i ".#"] } } - { dg-final { if { [string length $tmp] == 0 } \{ } } - { dg-final { pass "990228-1.c: linemarkers in middle of line" } } - { dg-final { \} else \{ } } - { dg-final { fail "990228-1.c: linemarkers in middle of line" } } - { dg-final { \} } } - */ diff --git a/gcc/testsuite/gcc.dg/990407-1.c b/gcc/testsuite/gcc.dg/990407-1.c deleted file mode 100644 index 96b3f862639..00000000000 --- a/gcc/testsuite/gcc.dg/990407-1.c +++ /dev/null @@ -1,18 +0,0 @@ -/* Regression test for a cpplib macro-expansion bug where - `@' becomes `@@' when stringified. */ - -/* { dg-do run } */ - -#include <string.h> - -#define STR(x) #x - -char *a = STR(@foo), *b = "@foo"; - -int -main(void) -{ - if (strcmp (a, b)) - abort (); - return 0; -} diff --git a/gcc/testsuite/gcc.dg/990409-1.c b/gcc/testsuite/gcc.dg/990409-1.c deleted file mode 100644 index cda9dd87ad8..00000000000 --- a/gcc/testsuite/gcc.dg/990409-1.c +++ /dev/null @@ -1,18 +0,0 @@ -/* Test that __LINE__ works when embedded in a macro. */ -/* { dg-do run } */ - -#define XLINE __LINE__ - -void -bar(int x, int y) -{ - if (x != y) - abort(); -} - -int -main(void) -{ - bar(XLINE, __LINE__); - return 0; -} diff --git a/gcc/testsuite/gcc.dg/990413-1.c b/gcc/testsuite/gcc.dg/990413-1.c deleted file mode 100644 index 591159abc67..00000000000 --- a/gcc/testsuite/gcc.dg/990413-1.c +++ /dev/null @@ -1,13 +0,0 @@ -/* Verify that cpp doesn't screw up the line numbering when a macro argument - extends over multiple lines. */ -/* { dg-do compile } */ - -#define FOO(x) /* nothing */ - -void -func(void) -{ - FOO(i - = 4) - else; /* { dg-error "parse error" "error on this line" { target native } { 12 } } */ -} diff --git a/gcc/testsuite/gcc.dg/990424-1.c b/gcc/testsuite/gcc.dg/990424-1.c deleted file mode 100644 index 589e0468e76..00000000000 --- a/gcc/testsuite/gcc.dg/990424-1.c +++ /dev/null @@ -1,26 +0,0 @@ -/* Test that stack alignment is preserved with pending_stack_adjust - with stdcall functions. */ - -/* { dg-do run { target i?86-*-* } } */ -/* { dg-options -mpreferred-stack-boundary=4 } */ - -void __attribute__((stdcall)) foo(int a, int b, int c); - -int -main () -{ - foo(1, 2, 3); - foo(1, 2, 3); - exit (0); -} - -void __attribute__((stdcall)) -foo(int a, int b, int c) -{ - static int last_align = -1; - int dummy, align = (int)&dummy & 15; - if (last_align < 0) - last_align = align; - else if (align != last_align) - abort (); -} diff --git a/gcc/testsuite/gcc.dg/990506-0.c b/gcc/testsuite/gcc.dg/990506-0.c deleted file mode 100644 index 7db7215721a..00000000000 --- a/gcc/testsuite/gcc.dg/990506-0.c +++ /dev/null @@ -1,9 +0,0 @@ -/* Verify that a diagnostic is issued without crashing due to - --enable-checking catching a bug in the C front end. */ -/* { dg-do compile } */ -x() -{ - foo (i); - /* { dg-error "undeclared" "undeclared-variable message" { target native } { 6 } } */ - /* { dg-error "function it appears in" "reminder message" { target native } { 6 } } */ -} diff --git a/gcc/testsuite/gcc.dg/README b/gcc/testsuite/gcc.dg/README deleted file mode 100644 index 6f14899edf9..00000000000 --- a/gcc/testsuite/gcc.dg/README +++ /dev/null @@ -1,16 +0,0 @@ -Notes for testsuite/gcc.dg. - -1) There should be only one driver, dg.exp. - -2) Try to organize the tests by topic using file name prefixes. - - Eg: All bitfield tests are named "bf-*.c". - - This lets the person running the tests choose particular sets of tests to - run easily (using wildcards). - - Eg: make check RUNTESTFLAGS='dg.exp=bf-*.c' - -3) Remember DOS file name restrictions (8.3). Sigh. - -4) Send bugs, comments, etc. to dje@cygnus.com.
\ No newline at end of file diff --git a/gcc/testsuite/gcc.dg/bf-spl1.c b/gcc/testsuite/gcc.dg/bf-spl1.c deleted file mode 100644 index df3f4817043..00000000000 --- a/gcc/testsuite/gcc.dg/bf-spl1.c +++ /dev/null @@ -1,58 +0,0 @@ -/* { dg-do run { target m68k-*-* sparc-*-* } } */ -/* { dg-options { -m68000 -O2 } { target m68k-*-* } } */ -/* { dg-options { -O2 } { target sparc-*-* } } */ - -typedef SFtype __attribute__ ((mode (SF))); -typedef DFtype __attribute__ ((mode (DF))); - -typedef int HItype __attribute__ ((mode (HI))); -typedef int SItype __attribute__ ((mode (SI))); -typedef int DItype __attribute__ ((mode (DI))); - -typedef unsigned int UHItype __attribute__ ((mode (HI))); -typedef unsigned int USItype __attribute__ ((mode (SI))); -typedef unsigned int UDItype __attribute__ ((mode (DI))); - -typedef UDItype fractype; -typedef USItype halffractype; -typedef DFtype FLO_type; -typedef DItype intfrac; - - -typedef union -{ - long long foo; - FLO_type value; - struct - { - fractype fraction:52 __attribute__ ((packed)); - unsigned int exp:11 __attribute__ ((packed)); - unsigned int sign:1 __attribute__ ((packed)); - } - bits; -} FLO_union_type; - -void foo (long long a); -long long x; - -void -pack_d () -{ - FLO_union_type dst = { 0x0123456789abcdefLL }; - - x = dst.bits.fraction; -} - -main () -{ - pack_d (); - foo (x); - return 0; -} - -void -foo (long long a) -{ - if (a != 0x0123456789abcLL) - abort (); -} diff --git a/gcc/testsuite/gcc.dg/cast-qual-1.c b/gcc/testsuite/gcc.dg/cast-qual-1.c deleted file mode 100644 index a7a34700bd5..00000000000 --- a/gcc/testsuite/gcc.dg/cast-qual-1.c +++ /dev/null @@ -1,30 +0,0 @@ -/* Incorrect `cast discards `const'' warnings. There should be warnings - in bad_cast and bad_assign; bad_assign gets the correct warning, but - good_cast may get the warning instead of bad_cast. - gcc 2.7.2.3 passes, egcs-1.1.2 and egcs-ss-19990428 fail. - http://www.cygnus.com/ml/egcs-bugs/1998-Aug/0635.html */ -/* { dg-do compile } */ -/* { dg-options "-Wcast-qual" } */ -void -good_cast(const void *bar) -{ - (char *const *)bar; /* { dg-bogus "cast discards" "discarding `const' warning" } */ -} - -void -bad_cast(const void *bar) -{ - (const char **)bar; /* { dg-warning "cast discards" "discarding `const' warning" } */ -} - -void -good_assign(const void *bar) -{ - char *const *foo = bar; -} - -void -bad_assign(const void *bar) -{ - const char **foo = bar; /* { dg-warning "initialization discards" "discarding `const' warning" } */ -} diff --git a/gcc/testsuite/gcc.dg/clobbers.c b/gcc/testsuite/gcc.dg/clobbers.c deleted file mode 100644 index 0eddc14f953..00000000000 --- a/gcc/testsuite/gcc.dg/clobbers.c +++ /dev/null @@ -1,27 +0,0 @@ -/* Test asm clobbers on x86. */ - -/* { dg-do run { target i?86-*-* } } */ - -int main () -{ - int i; - __asm__ ("movl $1,%0\n\txorl %%eax,%%eax" : "=r" (i) : : "eax"); - if (i != 1) - abort (); - __asm__ ("movl $1,%0\n\txorl %%ebx,%%ebx" : "=r" (i) : : "ebx"); - if (i != 1) - abort (); - __asm__ ("movl $1,%0\n\txorl %%ecx,%%ecx" : "=r" (i) : : "ecx"); - if (i != 1) - abort (); - __asm__ ("movl $1,%0\n\txorl %%edx,%%edx" : "=r" (i) : : "edx"); - if (i != 1) - abort (); - __asm__ ("movl $1,%0\n\txorl %%esi,%%esi" : "=r" (i) : : "esi"); - if (i != 1) - abort (); - __asm__ ("movl $1,%0\n\txorl %%edi,%%edi" : "=r" (i) : : "edi"); - if (i != 1) - abort (); - return 0; -} diff --git a/gcc/testsuite/gcc.dg/compare1.c b/gcc/testsuite/gcc.dg/compare1.c deleted file mode 100644 index bba5f1d1dce..00000000000 --- a/gcc/testsuite/gcc.dg/compare1.c +++ /dev/null @@ -1,26 +0,0 @@ -/* Test for a bogus warning on comparison between signed and unsigned. - This was inspired by code in gcc. */ - -/* { dg-do compile } */ -/* { dg-options "-Wsign-compare" } */ - -int target_flags = 1; - -enum machine_mode -{ - VOIDmode , PQImode , QImode , PHImode , HImode , - PSImode , SImode , PDImode , DImode , TImode , OImode , QFmode , - HFmode , TQFmode , SFmode , DFmode , XFmode , TFmode , QCmode , - HCmode , SCmode , DCmode , XCmode , TCmode , CQImode , CHImode , - CSImode , CDImode , CTImode , COImode , BLKmode , CCmode , CCXmode, - CC_NOOVmode, CCX_NOOVmode, CCFPmode, CCFPEmode , MAX_MACHINE_MODE -}; - -#define Pmode ( target_flags ? DImode : SImode ) - -int main() -{ - enum machine_mode mode = DImode; - - return (mode == Pmode); /* dg-bogus "warning:" "comparison between signed and unsigned" } */ -} diff --git a/gcc/testsuite/gcc.dg/cpp-if1.c b/gcc/testsuite/gcc.dg/cpp-if1.c deleted file mode 100644 index d3b078fc3c6..00000000000 --- a/gcc/testsuite/gcc.dg/cpp-if1.c +++ /dev/null @@ -1,34 +0,0 @@ -/* { dg-do preprocess } */ -/* { dg-options "-pedantic-errors" } */ - -#if 0xa != 10 -#error 0xa != 10 /* { dg-bogus "#error" "normal conversion" } */ -#endif - -#if 077 != 63 -#error 077 != 63 /* { dg-bogus "#error" "normal conversion" } */ -#endif - -#if 12wrt /* { dg-error "nvalid number|missing white" "invalid number" } */ -#endif - -#if 0abc /* { dg-error "nvalid number|missing white" "invalid number" } */ -#endif - -#if 42abc /* { dg-error "nvalid number|missing white" "invalid number" } */ -#endif - -#if 1.2 /* { dg-error "loating point numbers" "floating point in #if" } */ -#endif - -#if 4uu /* { dg-error "(too many|two) `u'" "too many suffixes" } */ -#endif - -#if 124123231lll /* { dg-error "too many `l'" "too many suffixes" } */ -#endif - -#if 099 /* { dg-error "digits beyond the radix" "decimal in octal constant" } */ -#endif - -#if 0xfffffffffffffffff /* { dg-error "integer constant out of range" "range error" } */ -#endif diff --git a/gcc/testsuite/gcc.dg/cpp-if2.c b/gcc/testsuite/gcc.dg/cpp-if2.c deleted file mode 100644 index 60e8ffd22dc..00000000000 --- a/gcc/testsuite/gcc.dg/cpp-if2.c +++ /dev/null @@ -1,19 +0,0 @@ -/* { dg-do preprocess } */ -/* { dg-options -pedantic-errors } */ - -#if 'a' != 'a' || '\001' != 1 || '\x12' != 0x12 -#error a,1,0x12 /* { dg-bogus "#error" "basic charconst recognition" } */ -#endif - -#if 'a' != L'a' || L'\xfeed' != 0xfeed -#error L'a',0xfeed /* { dg-bogus "#error" "wide charconst recognition" } */ -#endif - -#if 'abcd' /* { dg-warning "multi-character character constant" "multi-character charconst" } */ -#endif - -#if 'abcdefghi' /* { dg-error "character constant (is )?too long" "charconst too long" } */ -#endif - -#if '' /* { dg-error "empty character constant" "empty charconst" } */ -#endif diff --git a/gcc/testsuite/gcc.dg/cpp-if3.c b/gcc/testsuite/gcc.dg/cpp-if3.c deleted file mode 100644 index c46f5633761..00000000000 --- a/gcc/testsuite/gcc.dg/cpp-if3.c +++ /dev/null @@ -1,25 +0,0 @@ -/* Test that the preprocessor is capable of 64-bit arithmetic. - (Must turn off -pedantic, since `LL' constants are only in C9x.) */ -/* { dg-do preprocess } */ -/* { dg-options "" } */ - -#define U_MAX 4294967295U -#define ULL_MAX 18446744073709551615ULL -#define LL_MAX 9223372036854775807LL -#define LL_MIN (-LL_MAX-1) - -/* Check simple truncation. */ -#if U_MAX == ULL_MAX || LL_MIN == 0 || LL_MAX == -1 -#error "simple truncation" /* { dg-bogus "trunc" "simple truncation" } */ -#endif - -/* Check left/right shifting with all bits set and with one bit set. */ -#if !(~0ULL >> 63) || !(~0ULL << 63) || !(~0LL >> 63) || !(~0LL << 63) || \ - !(LL_MIN >> 63) || !(1LL << 62) || !(ULL_MAX >> 63) || !(1ULL << 63) -#error "bit shift truncation" /* { dg-bogus "trunc" "bit shift truncation" } */ -#endif - -/* Check math expressions. */ -#if (2ULL * U_MAX < U_MAX) || (1ULL + U_MAX < U_MAX) -#error "math truncation" /* { dg-bogus "trunc" "math truncation" } */ -#endif diff --git a/gcc/testsuite/gcc.dg/cpp-mi.c b/gcc/testsuite/gcc.dg/cpp-mi.c deleted file mode 100644 index f667d0c4b9d..00000000000 --- a/gcc/testsuite/gcc.dg/cpp-mi.c +++ /dev/null @@ -1,34 +0,0 @@ -/* Test "ignore redundant include" facility. - This doesn't test for the case where the file is opened, and then ignored - (the file shouldn't have even been opened). That would require tracing - system calls. It could be done on some systems however. */ - -/* We have to test two cases: C comments at the top and C++ comments - at the top. */ - -/* -{ dg-do preprocess } -{ dg-options "-Wp,-lang-c-c++-comments" } -*/ - -#include "cpp-mic.h" -#include "cpp-mic.h" - -#include "cpp-micc.h" -#include "cpp-micc.h" - -main () -{ -} - -/* - { dg-final { if ![file exists cpp-mi.i] { return } } } - - { dg-final { set tmp [grep cpp-mi.i cpp-micc? line] } } - { dg-final { # send_user "$tmp\n" } } - { dg-final { if [regexp "^{\[0-9\]+ cpp-mic} {\[0-9\]+ cpp-micc}$" $tmp] \{ } } - { dg-final { pass "cpp-mi.c: redundant include check" } } - { dg-final { \} else \{ } } - { dg-final { fail "cpp-mi.c: redundant include check" } } - { dg-final { \} } } -*/ diff --git a/gcc/testsuite/gcc.dg/cpp-mic.h b/gcc/testsuite/gcc.dg/cpp-mic.h deleted file mode 100644 index bae9d8b6db7..00000000000 --- a/gcc/testsuite/gcc.dg/cpp-mic.h +++ /dev/null @@ -1,10 +0,0 @@ -/* Redundant header include test with C comments at top. */ - -#ifndef CPP_MIC_H -#define CPP_MIC_H - -int a; - -#endif - -/* And at the end too! */ diff --git a/gcc/testsuite/gcc.dg/cpp-micc.h b/gcc/testsuite/gcc.dg/cpp-micc.h deleted file mode 100644 index 52c9dccca89..00000000000 --- a/gcc/testsuite/gcc.dg/cpp-micc.h +++ /dev/null @@ -1,10 +0,0 @@ -// Redundant header include test with C comments at top. - -#ifndef CPP_MICC_H -#define CPP_MICC_H - -int a; - -#endif - -// And at the end too! diff --git a/gcc/testsuite/gcc.dg/dg.exp b/gcc/testsuite/gcc.dg/dg.exp deleted file mode 100644 index 6edb5dcae01..00000000000 --- a/gcc/testsuite/gcc.dg/dg.exp +++ /dev/null @@ -1,69 +0,0 @@ -# Copyright (C) 1997 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -# Please email any bugs, comments, and/or additions to this file to: -# bug-gcc@prep.ai.mit.edu - -# GCC testsuite that uses the `dg.exp' driver. - -# Load support procs. -load_lib gcc-dg.exp - -# Utility for scanning compiler result, invoked via dg-final. -# Call pass if pattern is present, otherwise fail. -proc scan-assembler { testcase pattern } { - global subdir - - set fd [open [file rootname $testcase].s r] - set text [read $fd] - close $fd - - if [regexp -- $pattern $text] { - pass "$subdir/$testcase scan-assembler" - } else { - fail "$subdir/$testcase scan-assembler" - } -} - -# Call pass if pattern is not present, otherwise fail. -proc scan-assembler-not { testcase pattern } { - global subdir - - set fd [open [file rootname $testcase].s r] - set text [read $fd] - close $fd - - if ![regexp -- $pattern $text] { - pass "$subdir/$testcase scan-assembler-not" - } else { - fail "$subdir/$testcase scan-assembler-not" - } -} - -# 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" -} - -# Initialize `dg'. -dg-init - -# Main loop. -dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.c]] "" $DEFAULT_CFLAGS - -# All done. -dg-finish diff --git a/gcc/testsuite/gcc.dg/dll-1.c b/gcc/testsuite/gcc.dg/dll-1.c deleted file mode 100644 index eb3b9b867f0..00000000000 --- a/gcc/testsuite/gcc.dg/dll-1.c +++ /dev/null @@ -1,10 +0,0 @@ -/* { dg-do compile { target arm*-*-pe* } } */ -/* { dg-do compile { target thumb*-*-pe* } } */ -/* { dg-options -mno-nop-fun-dllimport } */ - -__declspec (dllimport) void imp (); - -__declspec (dllexport) void exp () { imp (); } - -/* { dg-final { scan-assembler dll-1.c "\.section\[ \t\]*.drectve\n\[^\n\]*-export:exp.*__imp_imp" } } */ -/* { dg-final { scan-assembler-not dll-1.c "__imp_exp" } } */ diff --git a/gcc/testsuite/gcc.dg/dll-2.c b/gcc/testsuite/gcc.dg/dll-2.c deleted file mode 100644 index c55e9209359..00000000000 --- a/gcc/testsuite/gcc.dg/dll-2.c +++ /dev/null @@ -1,24 +0,0 @@ -/* These dllimport and dllexport appearing for a symbol. - The desired behaviour is that if both dllimport - and dllexport appear (in either order) the result is dllexport. - - Microsoft's MSVC 2.0 allows dllimport followed by dllexport for variables, - but does not allow dllexport followed by dllimport. - - In C, it's ok to redeclare a variable so this works for variables - and functions. In C++, it only works for functions. */ - -/* { dg-do compile { target arm*-*-pe* } } */ -/* { dg-do compile { target thumb*-*-pe* } } */ - -__declspec (dllimport) int foo1 (); -__declspec (dllexport) int foo1 (); - -__declspec (dllexport) int foo2 (); -__declspec (dllimport) int foo2 (); - -__declspec (dllimport) int bar1; -__declspec (dllexport) int bar1; - -__declspec (dllexport) int bar2; -__declspec (dllimport) int bar2; diff --git a/gcc/testsuite/gcc.dg/dll-3.c b/gcc/testsuite/gcc.dg/dll-3.c deleted file mode 100644 index 0f7818f1e5c..00000000000 --- a/gcc/testsuite/gcc.dg/dll-3.c +++ /dev/null @@ -1,16 +0,0 @@ -/* Ensure dllexport overrides dllimport. */ - -/* { dg-do compile { target arm*-*-pe* } } */ -/* { dg-do compile { target thumb*-*-pe* } } */ - -__declspec (dllimport) int foo1 (); -__declspec (dllexport) int foo1 (); - -__declspec (dllexport) int foo2 (); -__declspec (dllimport) int foo2 (); - -__declspec (dllexport) int foo1 () { return foo2 (); } -__declspec (dllexport) int foo2 () { return foo1 (); } - -/* { dg-final { scan-assembler dll-3.c "\.section\[ \t\]*\.drectve\n\[^\n\]*-export:foo1.*\.section\[ \t\]*\.drectve\n\[^\n\]*-export:foo2" } } */ -/* { dg-final { scan-assembler-not dll-3.c "(__imp_foo1|__imp_foo2)" } } */ diff --git a/gcc/testsuite/gcc.dg/dll-4.c b/gcc/testsuite/gcc.dg/dll-4.c deleted file mode 100644 index b708790baa5..00000000000 --- a/gcc/testsuite/gcc.dg/dll-4.c +++ /dev/null @@ -1,14 +0,0 @@ -/* { dg-do compile { target arm*-*-pe* } } */ -/* { dg-do compile { target thumb*-*-pe* } } */ - -__declspec (dllimport) int foo1; -int foo1; - -__declspec (dllimport) int foo2; -int foo2 = 5; - -int f () { return foo1 + foo2; } - -/* FIXME: We should scan the output of nm for this case. */ -/* { dg-final { scan-assembler dll-4.c "(foo2:.*\.comm\[ \t_\]*foo1)" } } */ -/* { dg-final { scan-assembler-not dll-4.c "__imp_" } } */ diff --git a/gcc/testsuite/gcc.dg/ifelse-1.c b/gcc/testsuite/gcc.dg/ifelse-1.c deleted file mode 100644 index 2dd2208b01f..00000000000 --- a/gcc/testsuite/gcc.dg/ifelse-1.c +++ /dev/null @@ -1,21 +0,0 @@ -/* -{ dg-do compile } -{ dg-options "-W -Wall" } -*/ - - -extern int bar (); -extern int com (); -extern int baz (); -void -foo (a,b) - int a, b; -{ - if (a) - if (b) - bar (); - else - com (); /* { dg-bogus ".*warning.*" "bogus warning" } */ - else - baz (); -} diff --git a/gcc/testsuite/gcc.dg/noreturn-1.c b/gcc/testsuite/gcc.dg/noreturn-1.c deleted file mode 100644 index 3d68cbcf500..00000000000 --- a/gcc/testsuite/gcc.dg/noreturn-1.c +++ /dev/null @@ -1,43 +0,0 @@ -/* Check for various valid and erroneous "noreturn" cases. */ -/* { dg-do compile } */ -/* { dg-options "-O -Wmissing-noreturn" } */ - -extern void foo1(void) __attribute__ ((__noreturn__)); -void -foo1(void) -{ -} /* { dg-warning "`noreturn' function does return" "detect falling off end of noreturn" } */ - -extern void foo2(void) __attribute__ ((__noreturn__)); -void -foo2(void) -{ - exit(0); -} /* { dg-bogus "warning:" "this function should not get any warnings" } */ - -extern void foo3(void); -void -foo3(void) -{ -} /* { dg-bogus "warning:" "this function should not get any warnings" } */ - -extern void foo4(void); -void -foo4(void) -{ - exit(0); -} /* { dg-warning "candidate for attribute `noreturn'" "detect noreturn candidate" } */ - -extern void foo5(void) __attribute__ ((__noreturn__)); -void -foo5(void) -{ - return; /* { dg-warning "`noreturn' has a `return' statement" "detect invalid return" } */ -} /* { dg-warning "`noreturn' function does return" "detect return from noreturn" } */ - -extern void foo6(void); -void -foo6(void) -{ - return; -} /* { dg-bogus "warning:" "this function should not get any warnings" } */ diff --git a/gcc/testsuite/gcc.dg/return-type-1.c b/gcc/testsuite/gcc.dg/return-type-1.c deleted file mode 100644 index 4b245533ac9..00000000000 --- a/gcc/testsuite/gcc.dg/return-type-1.c +++ /dev/null @@ -1,9 +0,0 @@ -/* Missing warning for falling off the end of a non-void function. - egcs-1.1.2 passes, egcs-ss-19990428 fails. - http://egcs.cygnus.com/ml/egcs-bugs/1999-03/msg00220.html */ -/* { dg-do compile } */ -/* { dg-options "-O -Wreturn-type" } */ -int -foo(void) -{ -} /* { dg-warning "control reaches end of non-void function" "warning for falling off end of non-void function" } */ diff --git a/gcc/testsuite/gcc.dg/setjmp-1.c b/gcc/testsuite/gcc.dg/setjmp-1.c deleted file mode 100644 index 85e0fb4261f..00000000000 --- a/gcc/testsuite/gcc.dg/setjmp-1.c +++ /dev/null @@ -1,36 +0,0 @@ -/* Test for bogus "variable `x' may be clobbered by longjmp" warnings. - Inspired by cse.c:simplify_relational_operation. */ - -/* { dg-do compile } */ -/* { dg-options "-O -W -Wall" } */ - -#include <setjmp.h> - -extern void set_float_handler (jmp_buf *); - -#define EQ 0x01 -#define LT 0x02 -#define GT 0x04 - -int -compare_float (double a, double b) /* { dg-bogus "clobbered" "spurious clobbered warning" { xfail *-*-* } } */ -{ - jmp_buf handler; - int result; - - a += 1.0; - - if (setjmp (handler)) - { - set_float_handler (0); - return 0; - } - - set_float_handler (&handler); - if (a == b) result = EQ; - else if (a > b) result = LT; - else if (a < b) result = GT; - else result = 0; - set_float_handler (0); - return result; -} diff --git a/gcc/testsuite/gcc.dg/special/alias-1.c b/gcc/testsuite/gcc.dg/special/alias-1.c deleted file mode 100644 index 347e1745630..00000000000 --- a/gcc/testsuite/gcc.dg/special/alias-1.c +++ /dev/null @@ -1,15 +0,0 @@ -/* { dg-do link } */ - -extern int foo(void) __attribute__((alias("bar"))); - -int bar(void) { - return 1; -} - -int main(void) { - - if (foo()) - exit(0); - else - abort(); -} diff --git a/gcc/testsuite/gcc.dg/special/ecos.exp b/gcc/testsuite/gcc.dg/special/ecos.exp deleted file mode 100644 index dc54df6eea1..00000000000 --- a/gcc/testsuite/gcc.dg/special/ecos.exp +++ /dev/null @@ -1,214 +0,0 @@ -# Copyright (C) 1999 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -# Please email any bugs, comments, and/or additions to this file to: -# jlarmour@cygnus.co.uk - -# This file was written by Jonathan Larmour (jlarmour@cygnus.co.uk). - -# GCC testsuite that uses the `dg.exp' driver. - -# Load support procs. -load_lib gcc-dg.exp - -################################### -# proc gcc_target_object_format { } -################################### - -proc gcc_target_object_format { } { - global gcc_target_object_format_saved - - if [info exists gcc_target_object_format_saved] { - verbose "gcc_target_object_format returning saved $gcc_target_object_format_saved" 2 - return $gcc_target_object_format_saved - } else { - - set objdump_name [find_binutils_prog objdump] - set open_file [open objfmtst.c w] - puts $open_file "void foo(void) { }" - close $open_file - - gcc_target_compile objfmtst.c objfmtst.o object "" - - set output [exec $objdump_name --file-headers objfmtst.o ] - - file delete objfmtst.o - - if ![ regexp "file format (.*)arch" $output dummy objformat ] { - verbose "Could not parse objdump output" 2 - set gcc_target_object_format_saved unknown - } else { - switch -regexp $objformat { - elf { - verbose "gcc_target_object_format returning elf" 2 - set gcc_target_object_format_saved elf - } - ecoff { - verbose "gcc_target_object_format returning ecoff" 2 - set gcc_target_object_format_saved ecoff - } - coff { - verbose "gcc_target_object_format returning coff" 2 - set gcc_target_object_format_saved coff - } - a\.out { - verbose "gcc_target_object_format returning a.out" 2 - set gcc_target_object_format_saved a.out - } - default { - verbose "gcc_target_object_format returning unknown" 2 - set gcc_target_object_format_saved unknown - } - } - } - return $gcc_target_object_format_saved - } -} - -############################### -# proc check_weak_available { } -############################### - -# weak symbols are only supported in some configs/object formats -# this proc returns 1 if they're support, 0 if they're not, or -1 if unsure - -proc check_weak_available { } { - global target_cpu - - # All mips targets should support it - - if { [ string first "mips" $target_cpu ] >= 0 } { - return 1 - } - - # ELF and ECOFF support it. a.out does with gas/gld but may also with - # other linkers, so we should try it - - set objformat [gcc_target_object_format] - - switch $objformat { - elf { return 1 } - ecoff { return 1 } - a.out { return 1 } - unknown { return -1 } - default { return 0 } - } -} - -########## -# weak-1.c -########## - -if { [ check_weak_available ] == 1 } { - dg-init - - set lines [gcc_target_compile "$srcdir/$subdir/weak-1a.c" "weak-1a.o" object ""] - if ![string match "" $lines] then { - fail "weak-1a.o" - } else { - dg-runtest "$srcdir/$subdir/weak-1.c" "weak-1a.o" "" - file delete weak-1a.o - } - dg-finish -} elseif { [ check_weak_available ] == 0 } { - unsupported "weak-1.c" -} else { - unresolved "weak-1.c" -} - -########## -# weak-2.c -########## - -if { [ check_weak_available ] == 1 } { - dg-init - - set lines [gcc_target_compile "$srcdir/$subdir/weak-2a.c" "weak-2a.o" object ""] - if ![string match "" $lines] then { - fail "weak-2a.o" - } else { - set lines [gcc_target_compile "$srcdir/$subdir/weak-2b.c" "weak-2b.o" object ""] - if ![string match "" $lines] then { - fail "weak-2b.o" - } else { - dg-runtest "$srcdir/$subdir/weak-2.c" "weak-2a.o weak-2b.o" "" - file delete weak-2a.o weak-2b.o - } - } - dg-finish -} elseif { [ check_weak_available ] == 0 } { - unsupported "weak-2.c" -} else { - unresolved "weak-2.c" -} - -########### -# alias-1.c -########### - -dg-init -dg-runtest "$srcdir/$subdir/alias-1.c" "" "" -dg-finish - -########### -# wkali-1.c -########### - -dg-init -dg-runtest "$srcdir/$subdir/wkali-1.c" "" "" -dg-finish - -########### -# wkali-2.c -########### - -if { [ check_weak_available ] == 1 } { - dg-init - set lines [gcc_target_compile "$srcdir/$subdir/wkali-2a.c" "wkali-2a.o" object ""] - if ![string match "" $lines] then { - fail "wkali-2a.o" - } else { - set lines [gcc_target_compile "$srcdir/$subdir/wkali-2b.c" "wkali-2b.o" object ""] - if ![string match "" $lines] then { - fail "wkali-2b.o" - } else { - dg-runtest "$srcdir/$subdir/wkali-2.c" "wkali-2a.o wkali-2b.o" "" - file delete wkali-2a.o wkali-2b.o - } - } - dg-finish -} elseif { [ check_weak_available ] == 0 } { - unsupported "wkali-2.c" -} else { - unresolved "wkali-2.c" -} - -########### -# gcsec-1.c -########### - -set ld_output [ exec [ find_ld ] --help ] - -if { [ string first "--gc-sections" $ld_output ] >= 0 } { - - dg-init - dg-runtest "$srcdir/$subdir/gcsec-1.c" "-ffunction-sections -fdata-sections -Wl,--gc-sections" "" - dg-finish -} else { - unsupported "gcsec-1.c" -} - -### EOF ecos.exp diff --git a/gcc/testsuite/gcc.dg/special/gcsec-1.c b/gcc/testsuite/gcc.dg/special/gcsec-1.c deleted file mode 100644 index fa3f884fcbf..00000000000 --- a/gcc/testsuite/gcc.dg/special/gcsec-1.c +++ /dev/null @@ -1,21 +0,0 @@ -/* { dg-do run } */ - -static int unusedint=5; - -static int usedint=1; - -int unused(void) { - return 1; -} - -int foo(void) { - return usedint; -} - -int main(void) { - - if (foo()) - exit(0); - else - abort(); -} diff --git a/gcc/testsuite/gcc.dg/special/weak-1.c b/gcc/testsuite/gcc.dg/special/weak-1.c deleted file mode 100644 index ccf2b087a94..00000000000 --- a/gcc/testsuite/gcc.dg/special/weak-1.c +++ /dev/null @@ -1,15 +0,0 @@ -/* { dg-do run } */ - -int foo(void) __attribute__((weak)); - -int foo(void) { - return 0; -} - -int main(void) { - - if (foo()) - exit(0); - else - abort(); -} diff --git a/gcc/testsuite/gcc.dg/special/weak-1a.c b/gcc/testsuite/gcc.dg/special/weak-1a.c deleted file mode 100644 index 2a7dbba3d89..00000000000 --- a/gcc/testsuite/gcc.dg/special/weak-1a.c +++ /dev/null @@ -1,3 +0,0 @@ -int foo(void) { - return 1; -} diff --git a/gcc/testsuite/gcc.dg/special/weak-2.c b/gcc/testsuite/gcc.dg/special/weak-2.c deleted file mode 100644 index 74259cf9bca..00000000000 --- a/gcc/testsuite/gcc.dg/special/weak-2.c +++ /dev/null @@ -1,11 +0,0 @@ -/* { dg-do run } */ - -extern int foo(void); - -int main(void) { - - if (foo()) - exit(0); - else - abort(); -} diff --git a/gcc/testsuite/gcc.dg/special/weak-2a.c b/gcc/testsuite/gcc.dg/special/weak-2a.c deleted file mode 100644 index 52d3e08a2d7..00000000000 --- a/gcc/testsuite/gcc.dg/special/weak-2a.c +++ /dev/null @@ -1,5 +0,0 @@ -int foo(void) __attribute__((weak)); - -int foo(void) { - return 0; -} diff --git a/gcc/testsuite/gcc.dg/special/weak-2b.c b/gcc/testsuite/gcc.dg/special/weak-2b.c deleted file mode 100644 index 2a7dbba3d89..00000000000 --- a/gcc/testsuite/gcc.dg/special/weak-2b.c +++ /dev/null @@ -1,3 +0,0 @@ -int foo(void) { - return 1; -} diff --git a/gcc/testsuite/gcc.dg/special/wkali-1.c b/gcc/testsuite/gcc.dg/special/wkali-1.c deleted file mode 100644 index d33c8d1d601..00000000000 --- a/gcc/testsuite/gcc.dg/special/wkali-1.c +++ /dev/null @@ -1,15 +0,0 @@ -/* { dg-do link } */ - -extern int foo(void) __attribute__((weak, alias("bar"))); - -int bar(void) { - return 1; -} - -int main(void) { - - if (foo()) - exit(0); - else - abort(); -} diff --git a/gcc/testsuite/gcc.dg/special/wkali-2.c b/gcc/testsuite/gcc.dg/special/wkali-2.c deleted file mode 100644 index 74259cf9bca..00000000000 --- a/gcc/testsuite/gcc.dg/special/wkali-2.c +++ /dev/null @@ -1,11 +0,0 @@ -/* { dg-do run } */ - -extern int foo(void); - -int main(void) { - - if (foo()) - exit(0); - else - abort(); -} diff --git a/gcc/testsuite/gcc.dg/special/wkali-2a.c b/gcc/testsuite/gcc.dg/special/wkali-2a.c deleted file mode 100644 index 79dde145540..00000000000 --- a/gcc/testsuite/gcc.dg/special/wkali-2a.c +++ /dev/null @@ -1,7 +0,0 @@ -/* { dg-do run } */ - -extern int foo(void) __attribute__((weak, alias("bar_a"))); - -int bar_a(void) { - return 0; -} diff --git a/gcc/testsuite/gcc.dg/special/wkali-2b.c b/gcc/testsuite/gcc.dg/special/wkali-2b.c deleted file mode 100644 index 84f389e846d..00000000000 --- a/gcc/testsuite/gcc.dg/special/wkali-2b.c +++ /dev/null @@ -1,7 +0,0 @@ -/* { dg-do run } */ - -extern int foo(void) __attribute__((alias("bar_b"))); - -int bar_b(void) { - return 1; -} diff --git a/gcc/testsuite/gcc.dg/splet-1.c b/gcc/testsuite/gcc.dg/splet-1.c deleted file mode 100644 index 03dbb2e3a3c..00000000000 --- a/gcc/testsuite/gcc.dg/splet-1.c +++ /dev/null @@ -1,21 +0,0 @@ -/* Test inl-sparc.h. */ - -/* { dg-do run { target sparclet-*-* } } */ -/* { dg-options -mcpu=sparclet } */ - -#include <inl-sparc.h> - -main () -{ - int a,b; - - a = scan (1, 2); - if (a != 3) - abort (); - - b = shuffle (4, 5); - if (b != 6) - abort (); - - exit (0); -} diff --git a/gcc/testsuite/gcc.dg/struct-ret-1.c b/gcc/testsuite/gcc.dg/struct-ret-1.c deleted file mode 100644 index f581aad07d2..00000000000 --- a/gcc/testsuite/gcc.dg/struct-ret-1.c +++ /dev/null @@ -1,45 +0,0 @@ -/* { dg-do run { target hppa*-*-* } } */ -/* { dg-options { -O2 } { target hppa*-*-* } } */ -typedef struct { - int x; - int y; -} point_t; - -int main(int argc, char *argv[]); -int printPoints(point_t a, point_t b); -point_t toPoint(int x1, int y1); - -int -main(int argc, char *argv[]) -{ - - if (printPoints(toPoint(0, 0), toPoint(1000, 1000)) != 1) - abort(); - else - exit(); - - return 0; -} - -int -printPoints(point_t a, point_t b) -{ - if (a.x != 0 - || a.y != 0 - || b.x != 1000 - || b.y != 1000) - return 0; - else - return 1; -} - -point_t -toPoint(int x1, int y1) -{ - point_t p; - - p.x = x1; - p.y = y1; - - return p; -} diff --git a/gcc/testsuite/gcc.dg/switch-1.c b/gcc/testsuite/gcc.dg/switch-1.c deleted file mode 100644 index 457c5205388..00000000000 --- a/gcc/testsuite/gcc.dg/switch-1.c +++ /dev/null @@ -1,17 +0,0 @@ -/* { dg-do compile { target rs6000-*-linux* powerpc-*-linux*} } */ -/* { dg-options "-fpic -O2" } */ - -void f (char *s) -{ - for (;;) - { - int t = 6; - switch (t) - { - case 2: - *s = '2'; - case 6: case 4: case 3: case 1: - break; - } - } -} diff --git a/gcc/testsuite/gcc.dg/ultrasp1.c b/gcc/testsuite/gcc.dg/ultrasp1.c deleted file mode 100644 index 853c72d35ab..00000000000 --- a/gcc/testsuite/gcc.dg/ultrasp1.c +++ /dev/null @@ -1,9 +0,0 @@ -/* Simplified from testcase by David Staepelaere <staapa@ultimatech.com> */ - -/* { dg-do compile { xfail sparc-*-* } } */ -/* { dg-options "" } */ -/* { dg-options -mcpu=ultrasparc { target sparc-*-*-* } } */ - -int foo(long long y) { - return -1 * y; -} diff --git a/gcc/testsuite/gcc.dg/uninit-1.c b/gcc/testsuite/gcc.dg/uninit-1.c deleted file mode 100644 index 91838810fda..00000000000 --- a/gcc/testsuite/gcc.dg/uninit-1.c +++ /dev/null @@ -1,30 +0,0 @@ -/* Spurious uninitialized variable warnings, case 1. - Taken from cppfiles.c (merge_include_chains) */ -/* { dg-do compile } */ -/* { dg-options "-O -Wuninitialized" } */ - -struct list -{ - struct list *next; - int id; -}; - -extern void free (void *); - -void remove_dupes (struct list *el) -{ - struct list *p, *q, *r; /* { dg-bogus "r" "uninitialized variable warning" { xfail *-*-* } } */ - - for (p = el; p; p = p->next) - { - for (q = el; q != p; q = q->next) - if (q->id == p->id) - { - r->next = p->next; - free (p); - p = r; - break; - } - r = p; - } -} diff --git a/gcc/testsuite/gcc.dg/uninit-2.c b/gcc/testsuite/gcc.dg/uninit-2.c deleted file mode 100644 index 5035a309ebd..00000000000 --- a/gcc/testsuite/gcc.dg/uninit-2.c +++ /dev/null @@ -1,52 +0,0 @@ -/* Spurious uninitialized variable warnings, case 2. - Taken from cpphash.c (macroexpand) */ -/* { dg-do compile } */ -/* { dg-options "-O -Wuninitialized" } */ - -struct definition -{ - int nargs; - int rest_args; -}; - -struct cpp_reader; - -enum cpp_token -{ - CPP_EOF, CPP_POP, CPP_COMMA, CPP_RPAREN -}; - -extern enum cpp_token macarg (struct cpp_reader *, int); - -void -macroexpand (struct cpp_reader *pfile, struct definition *defn) -{ - int nargs = defn->nargs; - - if (nargs >= 0) - { - enum cpp_token token; /* { dg-bogus "token" "uninitialized variable warning" { xfail *-*-* } } */ - int i, rest_args; - i = 0; - rest_args = 0; - do - { - if (rest_args) - continue; - if (i < nargs || (nargs == 0 && i == 0)) - { - /* if we are working on last arg which absorbs rest of args... */ - if (i == nargs - 1 && defn->rest_args) - rest_args = 1; - token = macarg (pfile, rest_args); - } - else - token = macarg (pfile, 0); - if (token == CPP_EOF || token == CPP_POP) - return; - - i++; - } - while (token == CPP_COMMA); - } -} diff --git a/gcc/testsuite/gcc.dg/uninit-3.c b/gcc/testsuite/gcc.dg/uninit-3.c deleted file mode 100644 index 78c4254dea5..00000000000 --- a/gcc/testsuite/gcc.dg/uninit-3.c +++ /dev/null @@ -1,33 +0,0 @@ -/* Spurious uninit variable warnings, case 3. - Inspired by cppexp.c (parse_charconst) */ -/* { dg-do compile } */ -/* { dg-options "-O -Wuninitialized" } */ - -extern void error (char *); - -int -parse_charconst (const char *start, const char *end) -{ - int c; /* { dg-bogus "c" "uninitialized variable warning" { xfail *-*-* } } */ - int nchars, retval; - - nchars = 0; - retval = 0; - while (start < end) - { - c = *start++; - if (c == '\'') - break; - nchars++; - retval += c; - retval <<= 8; - } - - if (nchars == 0) - return 0; - - if (c != '\'') - error ("malformed character constant"); - - return retval; -} diff --git a/gcc/testsuite/gcc.dg/uninit-4.c b/gcc/testsuite/gcc.dg/uninit-4.c deleted file mode 100644 index 34973532c57..00000000000 --- a/gcc/testsuite/gcc.dg/uninit-4.c +++ /dev/null @@ -1,50 +0,0 @@ -/* Spurious uninit variable warnings, case 4. - Simplified version of cppexp.c (cpp_parse_expr). - - This one is really fragile, it gets it right if you take out case - 1, or if the structure is replaced by an int, or if the structure - has fewer members (!) */ - -/* { dg-do compile } */ -/* { dg-options "-O -Wuninitialized" } */ - -struct operation { - short op; - char rprio; - char flags; - char unsignedp; - long value; -}; - -extern struct operation cpp_lex (void); - -void -cpp_parse_expr (void) -{ - int rprio; /* { dg-bogus "rprio" "uninitialized variable warning" { xfail *-*-* } } */ - struct operation op; - - for (;;) - { - op = cpp_lex (); - - switch (op.op) - { - case 0: - break; - case 1: - return; - case 2: - rprio = 1; - break; - default: - return; - } - - if (op.op == 0) - return; - - if (rprio != 1) - abort(); - } -} diff --git a/gcc/testsuite/gcc.dg/uninit-5.c b/gcc/testsuite/gcc.dg/uninit-5.c deleted file mode 100644 index ac760d69e03..00000000000 --- a/gcc/testsuite/gcc.dg/uninit-5.c +++ /dev/null @@ -1,40 +0,0 @@ -/* Spurious uninitialized-variable warnings. - These cases are documented as not working in the gcc manual. */ - -/* { dg-do compile } */ -/* { dg-options "-O -Wuninitialized" } */ - -extern void use(int); -extern void foo(void); - -void -func1(int cond) -{ - int x; /* { dg-bogus "x" "uninitialized variable warning" { xfail *-*-* } } */ - - if(cond) - x = 1; - - foo(); - - if(cond) - use(x); -} - -void -func2 (int cond) -{ - int x; /* { dg-bogus "x" "uninitialized variable warning" { xfail *-*-* } } */ - int flag = 0; - - if(cond) - { - x = 1; - flag = 1; - } - - foo(); - - if(flag) - use(x); -} diff --git a/gcc/testsuite/gcc.dg/uninit-6.c b/gcc/testsuite/gcc.dg/uninit-6.c deleted file mode 100644 index 2c428df79b6..00000000000 --- a/gcc/testsuite/gcc.dg/uninit-6.c +++ /dev/null @@ -1,47 +0,0 @@ -/* Spurious uninitialized variable warnings. - This one inspired by java/class.c:build_utf8_ref. */ - -/* { dg-do compile } */ -/* { dg-options "-O -Wuninitialized" } */ - -#include <stddef.h> - -struct tree -{ - struct tree *car; - struct tree *cdr; - int type, data; -}; - -extern void *malloc(size_t); - -#define INTEGER_T 1 -#define PTR_T 2 - -#define APPEND(TREE, LAST, TYPE, VALUE) \ -do { \ - struct tree *tmp = malloc (sizeof (struct tree)); \ - tmp->car = 0; tmp->cdr = 0; tmp->type = TYPE; \ - tmp->data = VALUE; \ - if (TREE->car) \ - LAST->cdr = tmp; \ - else \ - TREE->car = tmp; \ - LAST = tmp; \ -} while(0) - -struct tree * -make_something(int a, int b, int c) -{ - struct tree *rv; - struct tree *field; /* { dg-bogus "field" "uninitialized variable warning" { xfail *-*-* } } */ - - rv = malloc (sizeof (struct tree)); - rv->car = 0; - - APPEND(rv, field, INTEGER_T, a); - APPEND(rv, field, PTR_T, b); - APPEND(rv, field, INTEGER_T, c); - - return rv; -} diff --git a/gcc/testsuite/gcc.dg/uninit-8.c b/gcc/testsuite/gcc.dg/uninit-8.c deleted file mode 100644 index 94117da37c9..00000000000 --- a/gcc/testsuite/gcc.dg/uninit-8.c +++ /dev/null @@ -1,32 +0,0 @@ -/* Uninitialized variable warning tests... - Inspired by part of optabs.c:expand_binop. - May be the same as uninit-1.c. */ - -/* { dg-do compile } */ -/* { dg-options "-O -Wuninitialized" } */ - -#include <limits.h> - -void -add_bignums (int *out, int *x, int *y) -{ - int p, sum; - int carry; /* { dg-bogus "carry" "uninitialized variable warning" { xfail *-*-* } } */ - - p = 0; - for (; *x; x++, y++, out++, p++) - { - if (p) - sum = *x + *y + carry; - else - sum = *x + *y; - - if (sum < 0) - { - carry = 1; - sum -= INT_MAX; - } - else - carry = 0; - } -} diff --git a/gcc/testsuite/gcc.dg/uninit-9.c b/gcc/testsuite/gcc.dg/uninit-9.c deleted file mode 100644 index 62681f9e0fd..00000000000 --- a/gcc/testsuite/gcc.dg/uninit-9.c +++ /dev/null @@ -1,41 +0,0 @@ -/* Spurious uninitialized variable warnings. Slight variant on the - documented case, inspired by reg-stack.c:record_asm_reg_life. */ - -/* { dg-do compile } */ -/* { dg-options "-O -Wuninitialized" } */ - -struct foo -{ - int type; - struct foo *car; - struct foo *cdr; - char *data; - int data2; -}; - -extern void use(struct foo *); - -#define CLOBBER 6 -#define PARALLEL 3 - -void -func(struct foo *list, int count) -{ - int n_clobbers = 0; - int i; - struct foo **clob_list; /* { dg-bogus "clob_list" "uninitialized variable warning" { xfail *-*-* } } */ - - if(list[0].type == PARALLEL) - { - clob_list = __builtin_alloca(count * sizeof(struct foo *)); - - for(i = 1; i < count; i++) - { - if(list[i].type == CLOBBER) - clob_list[n_clobbers++] = &list[i]; - } - } - - for(i = 0; i < n_clobbers; i++) - use(clob_list[i]); -} diff --git a/gcc/testsuite/gcc.dg/uninit-A.c b/gcc/testsuite/gcc.dg/uninit-A.c deleted file mode 100644 index 119ed6902aa..00000000000 --- a/gcc/testsuite/gcc.dg/uninit-A.c +++ /dev/null @@ -1,115 +0,0 @@ -/* Inspired by part of java/parse.y. - May be a real bug in CSE. */ - -/* { dg-do compile } */ -/* { dg-options "-O2 -Wall" } */ - -struct tree -{ - struct tree *car, *cdr, *wfl; - int code; - struct { int renp:1; int rtnp:1; int rpnp:1; } flags; -}; -typedef struct tree *tree; -#define NULL_TREE ((tree)0) - -/* Codes */ -enum -{ - CALL_EXPR, NEW_ARRAY_EXPR, NEW_CLASS_EXPR, CONVERT_EXPR, - ARRAY_REF, CONDITIONAL_EXPR, STRING_CST, EXPR_WITH_FILE_LOCATION -}; - -/* Flags */ -#define RESOLVE_EXPRESSION_NAME_P(t) ((t)->flags.renp) -#define RESOLVE_TYPE_NAME_P(t) ((t)->flags.rtnp) -#define RESOLVE_PACKAGE_NAME_P(t) ((t)->flags.rpnp) - -/* Macros */ -#define EXPR_WFL_QUALIFICATION(t) ((t)->wfl) -#define QUAL_WFL(t) ((t)->wfl) -#define EXPR_WFL_NODE(t) ((t)->wfl) -#define TREE_CODE(t) ((t)->code) -#define TREE_OPERAND(t,x) ((t)->car) -#define CLASSTYPE_SUPER(t) ((t)->car) -#define IDENTIFIER_LOCAL_VALUE(t) ((t)->car) -#define TREE_CHAIN(t) ((t)->cdr) -#define QUAL_RESOLUTION(t) ((t)->cdr) - -extern tree current_class, this_identifier_node; -extern tree super_identifier_node, length_identifier_node; - -tree resolve_and_layout (tree, tree); -tree lookup_field_wrapper (tree, tree); - -void -qualify_ambiguous_name (id) - tree id; -{ - tree qual, qual_wfl, decl; - tree name; /* { dg-bogus "name" "uninitialized variable warning" { xfail *-*-* } } */ - tree ptr_type; /* { dg-bogus "ptr_type" "uninitialized variable warning" { xfail *-*-* } } */ - int again, new_array_found = 0; - int super_found = 0, this_found = 0; - - qual = EXPR_WFL_QUALIFICATION (id); - do { - qual_wfl = QUAL_WFL (qual); - switch (TREE_CODE (qual_wfl)) - { - case CALL_EXPR: - qual_wfl = TREE_OPERAND (qual_wfl, 0); - if (TREE_CODE (qual_wfl) != EXPR_WITH_FILE_LOCATION) - { - qual = EXPR_WFL_QUALIFICATION (qual_wfl); - qual_wfl = QUAL_WFL (qual); - } - break; - case NEW_ARRAY_EXPR: - qual = TREE_CHAIN (qual); - new_array_found = again = 1; - continue; - case NEW_CLASS_EXPR: - case CONVERT_EXPR: - qual_wfl = TREE_OPERAND (qual_wfl, 0); - break; - case ARRAY_REF: - while (TREE_CODE (qual_wfl) == ARRAY_REF) - qual_wfl = TREE_OPERAND (qual_wfl, 0); - break; - default: - break; - } - - name = EXPR_WFL_NODE (qual_wfl); - ptr_type = current_class; - again = 0; - - } while (again); - - /* If you put straightforward uses of name and ptr_type here - instead of the if-else sequence below, the warnings go away. - Therefore I suspect a real bug. */ - - if (!this_found && !super_found && (decl = IDENTIFIER_LOCAL_VALUE (name))) - { - RESOLVE_EXPRESSION_NAME_P (qual_wfl) = 1; - QUAL_RESOLUTION (qual) = decl; - } - else if ((decl = lookup_field_wrapper (ptr_type, name)) - || (new_array_found && name == length_identifier_node)) - { - RESOLVE_EXPRESSION_NAME_P (qual_wfl) = 1; - QUAL_RESOLUTION (qual) = (new_array_found ? NULL_TREE : decl); - } - else if ((decl = resolve_and_layout (name, NULL_TREE))) - { - RESOLVE_TYPE_NAME_P (qual_wfl) = 1; - QUAL_RESOLUTION (qual) = decl; - } - else if (TREE_CODE (QUAL_WFL (qual)) == CALL_EXPR - || TREE_CODE (QUAL_WFL (qual)) == ARRAY_REF) - RESOLVE_EXPRESSION_NAME_P (qual_wfl) = 1; - else - RESOLVE_PACKAGE_NAME_P (qual_wfl) = 1; -} diff --git a/gcc/testsuite/gcc.dg/unused-1.c b/gcc/testsuite/gcc.dg/unused-1.c deleted file mode 100644 index be941860e49..00000000000 --- a/gcc/testsuite/gcc.dg/unused-1.c +++ /dev/null @@ -1,11 +0,0 @@ -/* Missing `unused parameter' warning. - egcs-1.1.2 fails, egcs-ss-19990418 passes. - http://www.cygnus.com/ml/egcs-bugs/1998-Sep/0199.html */ -/* { dg-do compile } */ -/* { dg-options "-O -Wall -W" } */ -int -f(c) - char c; /* { dg-warning "unused parameter" "unused parameter warning" } */ -{ - return 0; -} |