More test-suite rearrangement
Zack Weinberg
zack@wolery.cumb.org
Wed Jun 28 13:14:00 GMT 2000
This patch eliminates the gcc.failure, gcc.c-torture/code_quality, and
gcc.c-torture/special test directories. All the test cases work just
as well in one of c-torture/compile, c-torture/execute, gcc.dg, or
gcc.misc-tests (in extremis).
Bootstrapped and tested on i386-linux.
I'm not clear on the protocol for approving this sort of change to the
test suite. I know you can add tests at will, and you're never
supposed to delete anything, but structural changes fall in the gap.
I need a subset of this for cpplib work; if no one objects I'll
probably commit the whole thing later this afternoon.
zw
Rearrange lots of files, removing entirely the
c-torture/special, c-torture/code-quality, and failure
directories. All paths below have 'gcc.' prefix.
* Deleted files:
c-torture/code_quality/code_quality.exp
c-torture/special/special.exp
failure/failure.exp
failure/940409-1.x
c-torture/compile/961203-1.x
* New files:
misc-tests/linkage.exp
c-torture/execute/920730-1t.c
c-torture/execute/920730-1t.x
c-torture/compile/920520-1.x
c-torture/compile/920521-1.x
c-torture/compile/981006-1.x
c-torture/execute/eeprof-1.x
* Moved files (possibly with modifications to fit a new harness):
Old name New name
c-torture/code_quality/920608-1.c c-torture/compile/920608-1.c
c-torture/special/920413-1.c dg/920413-1.c
c-torture/special/920520-1.c c-torture/compile/920520-1.c
c-torture/special/920521-1.c c-torture/compile/920521-1.c
c-torture/special/920717-x.c misc-tests/linkage-x.c
c-torture/special/920717-y.c misc-tests/linkage-y.c
c-torture/special/920730-1.c c-torture/execute/920730-1.c
c-torture/special/930510-1.c dg/cpp/19930510-1.c
c-torture/special/951130-1.c dg/951130-1.c
c-torture/special/960224-1.c dg/cpp/19960224-1.c
c-torture/special/960224-2.c dg/cpp/19960224-2.c
c-torture/special/981006-1.c c-torture/compile/981006-1.c
c-torture/special/eeprof-1.c c-torture/execute/eeprof-1.c
failure/940409-1.c dg/940409-1.c
===================================================================
Index: testsuite/gcc.c-torture/code_quality/920608-1.c
--- testsuite/gcc.c-torture/code_quality/920608-1.c Wed Jun 28 13:00:02 2000
+++ testsuite/gcc.c-torture/code_quality/920608-1.c Tue May 5 13:32:27 1998
@@ -1,25 +0,0 @@
-foo (p)
- int *p;
-{
- int x;
- int a;
-
- a = p[0];
- x = a + 5;
- a = -1;
- p[0] = x - 5;
- return a;
-}
-
-bar (p)
-{
- short x;
- int a;
-
- x = ((short *) p)[1];
-#if INHIBIT_COMBINE
- ((short *) p)[0] = x;
-#endif
-
- return (x < 45);
-}
===================================================================
Index: testsuite/gcc.c-torture/code_quality/code_quality.exp
--- testsuite/gcc.c-torture/code_quality/code_quality.exp Wed Jun 28 13:00:02 2000
+++ testsuite/gcc.c-torture/code_quality/code_quality.exp Tue May 5 13:32:27 1998
@@ -1,55 +0,0 @@
-#
-# Expect driver script for GCC Regression Tests
-# Copyright (C) 1993, 1997 Free Software Foundation
-#
-# This file 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., 675 Mass Ave, Cambridge, MA 02139, USA.
-#
-# Written by Jeffrey Wheat (cassidy@cygnus.com)
-#
-
-#
-# These tests come from Torbjorn Granlund's (tege@cygnus.com)
-# C torture test suite, and other contributors.
-#
-
-if $tracelevel then {
- strace $tracelevel
-}
-
-# load support procs
-load_lib c-torture.exp
-
-#
-# This loop will run c-torture on any *.c file found in this directory.
-# If a *.c has a corresponding *.exp file, then the test is skipped as
-# as the *.exp will drive the test itself. I did things this way so that
-# generic tests did not need a seperate .exp for it. Only the tests that
-# required unique options would need it's own .exp file.
-#
-
-foreach testcase [glob -nocomplain $srcdir/$subdir/*.c] {
- if [file exists [file rootname $testcase].exp] then {
- verbose "INFO:\"[file rootname $testcase].exp\" exists, skipping test" 3
- continue
- }
-
- # If we're only testing specific files and this isn't one of them, skip it.
- if ![runtest_file_p $runtests $testcase] then {
- continue
- }
-
- c-torture $testcase
-}
-
===================================================================
Index: testsuite/gcc.c-torture/compile/920520-1.c
--- testsuite/gcc.c-torture/compile/920520-1.c Tue May 5 13:32:27 1998
+++ testsuite/gcc.c-torture/compile/920520-1.c Wed Jun 28 12:59:59 2000
@@ -0,0 +1 @@
+f(){asm("%0"::"r"(1.5F));}g(){asm("%0"::"r"(1.5));}
===================================================================
Index: testsuite/gcc.c-torture/compile/920520-1.x
--- testsuite/gcc.c-torture/compile/920520-1.x Tue May 5 13:32:27 1998
+++ testsuite/gcc.c-torture/compile/920520-1.x Wed Jun 28 12:59:59 2000
@@ -0,0 +1,2 @@
+set options "-S"
+return 0
===================================================================
Index: testsuite/gcc.c-torture/compile/920521-1.c
--- testsuite/gcc.c-torture/compile/920521-1.c Tue May 5 13:32:27 1998
+++ testsuite/gcc.c-torture/compile/920521-1.c Wed Jun 28 12:59:59 2000
@@ -0,0 +1 @@
+f(){asm("f":::"cc");}g(x,y){asm("g"::"%r"(x), "r"(y));}
===================================================================
Index: testsuite/gcc.c-torture/compile/920521-1.x
--- testsuite/gcc.c-torture/compile/920521-1.x Tue May 5 13:32:27 1998
+++ testsuite/gcc.c-torture/compile/920521-1.x Wed Jun 28 12:59:59 2000
@@ -0,0 +1,2 @@
+set options "-S"
+return 0
===================================================================
Index: testsuite/gcc.c-torture/compile/920608-1.c
--- testsuite/gcc.c-torture/compile/920608-1.c Tue May 5 13:32:27 1998
+++ testsuite/gcc.c-torture/compile/920608-1.c Wed Jun 28 12:59:59 2000
@@ -0,0 +1,25 @@
+foo (p)
+ int *p;
+{
+ int x;
+ int a;
+
+ a = p[0];
+ x = a + 5;
+ a = -1;
+ p[0] = x - 5;
+ return a;
+}
+
+bar (p)
+{
+ short x;
+ int a;
+
+ x = ((short *) p)[1];
+#if INHIBIT_COMBINE
+ ((short *) p)[0] = x;
+#endif
+
+ return (x < 45);
+}
===================================================================
Index: testsuite/gcc.c-torture/compile/961203-1.x
--- testsuite/gcc.c-torture/compile/961203-1.x Wed Jun 28 13:00:02 2000
+++ testsuite/gcc.c-torture/compile/961203-1.x Tue May 5 13:32:27 1998
@@ -1,7 +0,0 @@
-# This doesn't work on any host with 32 bit int or smaller.
-
-# Because this test tends to consume lots of system resources and doesn't
-# currently work, don't actually run it. Just report a failure.
-setup_xfail "*-*-*"
-fail "gcc.c-torture/compile/961203-1.c"
-return 1 ;# `1' says we handled the testcase ourselves
===================================================================
Index: testsuite/gcc.c-torture/compile/981006-1.c
--- testsuite/gcc.c-torture/compile/981006-1.c Tue May 5 13:32:27 1998
+++ testsuite/gcc.c-torture/compile/981006-1.c Wed Jun 28 12:59:59 2000
@@ -0,0 +1,50 @@
+/* Test that tablejump insns are correctly handled. If the compiler
+ loses track of the jump targets, it will report that x and y can be
+ used uninitialized.
+
+ This is broken in egcs 1998/10/06 for mips in pic mode. */
+/* { dg-do compile } */
+
+int foo (int a, int b)
+{
+ __label__ z;
+ int x; /* { dg-bogus "warning: `.' might be used uninitialized in this function" } */
+ int y; /* { dg-bogus "warning: `.' might be used uninitialized in this function" } */
+ static void *p;
+
+ switch (a) {
+ case 2:
+ x = 4;
+ break;
+ case 4:
+ x = 6;
+ break;
+ case 8: case 10: case 13: case 11: case 17: case 19:
+ x = 7;
+ break;
+ default:
+ x = -1;
+ break;
+ }
+ switch (b) {
+ case 2:
+ y = 4;
+ break;
+ case 4:
+ y = 6;
+ break;
+ case 8: case 10: case 13: case 11: case 17: case 19:
+ y = 7;
+ break;
+ default:
+ y = -1;
+ break;
+ }
+ z:
+ p = &&z;
+ return x * y;
+}
+int main (int argc, char *argv[])
+{
+ return 1 == foo (argc, argc + 1);
+}
===================================================================
Index: testsuite/gcc.c-torture/compile/981006-1.x
--- testsuite/gcc.c-torture/compile/981006-1.x Tue May 5 13:32:27 1998
+++ testsuite/gcc.c-torture/compile/981006-1.x Wed Jun 28 12:59:59 2000
@@ -0,0 +1,12 @@
+# For MIPS at least, pic is needed to trigger the problem.
+if { [istarget rs6000-*-aix*]
+ || [istarget powerpc*-*-aix*]
+ || [istarget arm*-*-*]
+ || [istarget strongarm*-*-*]
+ || [istarget fr30-*-*]
+} {
+ set options "-Wuninitialized -Werror"
+} else {
+ set options "-Wuninitialized -Werror -fpic"
+}
+return 0
===================================================================
Index: testsuite/gcc.c-torture/execute/920730-1.c
--- testsuite/gcc.c-torture/execute/920730-1.c Tue May 5 13:32:27 1998
+++ testsuite/gcc.c-torture/execute/920730-1.c Wed Jun 28 12:59:59 2000
@@ -0,0 +1,32 @@
+/* 920730-1.c */
+
+f1()
+{
+ int b=0x80000000;
+ return b>=0x80000000;
+}
+
+f2()
+{
+ int b=0x80000001;
+ return b>=0x80000001;
+}
+
+f3()
+{
+ int b=0x7fffffff;
+ return b>=0x7fffffff;
+}
+
+f4()
+{
+ int b=0xffffffff;
+ return b>=0xffffffff;
+}
+
+main ()
+{
+ if((f1()&f2()&f3()&f4())!=1)
+ abort();
+ exit(0);
+}
===================================================================
Index: testsuite/gcc.c-torture/execute/920730-1t.c
--- testsuite/gcc.c-torture/execute/920730-1t.c Tue May 5 13:32:27 1998
+++ testsuite/gcc.c-torture/execute/920730-1t.c Wed Jun 28 12:59:59 2000
@@ -0,0 +1,3 @@
+/* This is just 920730-1.c compiled with -traditional.
+ See 920730-1t.x. */
+#include "920730-1.c"
===================================================================
Index: testsuite/gcc.c-torture/execute/920730-1t.x
--- testsuite/gcc.c-torture/execute/920730-1t.x Tue May 5 13:32:27 1998
+++ testsuite/gcc.c-torture/execute/920730-1t.x Wed Jun 28 12:59:59 2000
@@ -0,0 +1,2 @@
+set additional_flags "-traditional"
+return 0
===================================================================
Index: testsuite/gcc.c-torture/execute/eeprof-1.c
--- testsuite/gcc.c-torture/execute/eeprof-1.c Tue May 5 13:32:27 1998
+++ testsuite/gcc.c-torture/execute/eeprof-1.c Wed Jun 28 12:59:59 2000
@@ -0,0 +1,67 @@
+#define ASSERT(X) if (!(X)) abort ();
+#define NOCHK __attribute__ ((no_instrument_function))
+
+int entry_calls, exit_calls;
+void (*last_fn_entered)();
+void (*last_fn_exited)();
+
+int main () NOCHK;
+
+void foo ()
+{
+ ASSERT (last_fn_entered == foo);
+}
+
+static void foo2 ()
+{
+ ASSERT (entry_calls == 1 && exit_calls == 0);
+ ASSERT (last_fn_entered == foo2);
+ foo ();
+ ASSERT (entry_calls == 2 && exit_calls == 1);
+ ASSERT (last_fn_entered == foo);
+ ASSERT (last_fn_exited == foo);
+}
+
+void nfoo (void) NOCHK;
+void nfoo ()
+{
+ ASSERT (entry_calls == 2 && exit_calls == 2);
+ ASSERT (last_fn_entered == foo);
+ ASSERT (last_fn_exited == foo2);
+ foo ();
+ ASSERT (entry_calls == 3 && exit_calls == 3);
+ ASSERT (last_fn_entered == foo);
+ ASSERT (last_fn_exited == foo);
+}
+
+int main ()
+{
+ ASSERT (entry_calls == 0 && exit_calls == 0);
+
+ foo2 ();
+
+ ASSERT (entry_calls == 2 && exit_calls == 2);
+ ASSERT (last_fn_entered == foo);
+ ASSERT (last_fn_exited == foo2);
+
+ nfoo ();
+
+ ASSERT (entry_calls == 3 && exit_calls == 3);
+ ASSERT (last_fn_entered == foo);
+
+ return 0;
+}
+
+void __cyg_profile_func_enter (void (*fn)(), void (*parent)()) NOCHK;
+void __cyg_profile_func_exit (void (*fn)(), void (*parent)()) NOCHK;
+
+void __cyg_profile_func_enter (void (*fn)(), void (*parent)())
+{
+ entry_calls++;
+ last_fn_entered = fn;
+}
+void __cyg_profile_func_exit (void (*fn)(), void (*parent)())
+{
+ exit_calls++;
+ last_fn_exited = fn;
+}
===================================================================
Index: testsuite/gcc.c-torture/execute/eeprof-1.x
--- testsuite/gcc.c-torture/execute/eeprof-1.x Tue May 5 13:32:27 1998
+++ testsuite/gcc.c-torture/execute/eeprof-1.x Wed Jun 28 12:59:59 2000
@@ -0,0 +1,2 @@
+set additional_flags "-finstrument-functions"
+return 0
===================================================================
Index: testsuite/gcc.c-torture/special/920413-1.c
--- testsuite/gcc.c-torture/special/920413-1.c Wed Jun 28 13:00:03 2000
+++ testsuite/gcc.c-torture/special/920413-1.c Tue May 5 13:32:27 1998
@@ -1 +0,0 @@
-x(b){unsigned long c;c=4294967295U/(unsigned long)b;}
===================================================================
Index: testsuite/gcc.c-torture/special/920520-1.c
--- testsuite/gcc.c-torture/special/920520-1.c Wed Jun 28 13:00:03 2000
+++ testsuite/gcc.c-torture/special/920520-1.c Tue May 5 13:32:27 1998
@@ -1 +0,0 @@
-f(){asm("%0"::"r"(1.5F));}g(){asm("%0"::"r"(1.5));}
===================================================================
Index: testsuite/gcc.c-torture/special/920521-1.c
--- testsuite/gcc.c-torture/special/920521-1.c Wed Jun 28 13:00:03 2000
+++ testsuite/gcc.c-torture/special/920521-1.c Tue May 5 13:32:27 1998
@@ -1 +0,0 @@
-f(){asm("f":::"cc");}g(x,y){asm("g"::"%r"(x), "r"(y));}
===================================================================
Index: testsuite/gcc.c-torture/special/920717-x.c
--- testsuite/gcc.c-torture/special/920717-x.c Wed Jun 28 13:00:03 2000
+++ testsuite/gcc.c-torture/special/920717-x.c Tue May 5 13:32:27 1998
@@ -1,3 +0,0 @@
-/* 920717-1.c */
-
-const char s[]="foo";
===================================================================
Index: testsuite/gcc.c-torture/special/920717-y.c
--- testsuite/gcc.c-torture/special/920717-y.c Wed Jun 28 13:00:03 2000
+++ testsuite/gcc.c-torture/special/920717-y.c Tue May 5 13:32:27 1998
@@ -1,8 +0,0 @@
-/* 920717-y.c */
-
-extern const char s[];
-
-main()
-{
- puts(s);
-}
===================================================================
Index: testsuite/gcc.c-torture/special/920730-1.c
--- testsuite/gcc.c-torture/special/920730-1.c Wed Jun 28 13:00:03 2000
+++ testsuite/gcc.c-torture/special/920730-1.c Tue May 5 13:32:27 1998
@@ -1,32 +0,0 @@
-/* 920730-1.c */
-
-f1()
-{
- int b=0x80000000;
- return b>=0x80000000;
-}
-
-f2()
-{
- int b=0x80000001;
- return b>=0x80000001;
-}
-
-f3()
-{
- int b=0x7fffffff;
- return b>=0x7fffffff;
-}
-
-f4()
-{
- int b=0xffffffff;
- return b>=0xffffffff;
-}
-
-main ()
-{
- if((f1()&f2()&f3()&f4())!=1)
- abort();
- exit(0);
-}
===================================================================
Index: testsuite/gcc.c-torture/special/930510-1.c
--- testsuite/gcc.c-torture/special/930510-1.c Wed Jun 28 13:00:03 2000
+++ testsuite/gcc.c-torture/special/930510-1.c Tue May 5 13:32:27 1998
@@ -1,3 +0,0 @@
-#define ugly 3
-#ugly "foobar" 3 /* { dg-error "invalid" "invalid directive" } */
-int main() { exit (0); }
===================================================================
Index: testsuite/gcc.c-torture/special/951130-1.c
--- testsuite/gcc.c-torture/special/951130-1.c Wed Jun 28 13:00:03 2000
+++ testsuite/gcc.c-torture/special/951130-1.c Tue May 5 13:32:27 1998
@@ -1,2 +0,0 @@
-unsigned long long x = -(unsigned long long)(-(long long)(((unsigned long
-long)0 - 1) >> 1) - 1);
===================================================================
Index: testsuite/gcc.c-torture/special/960224-1.c
--- testsuite/gcc.c-torture/special/960224-1.c Wed Jun 28 13:00:03 2000
+++ testsuite/gcc.c-torture/special/960224-1.c Tue May 5 13:32:27 1998
@@ -1,6 +0,0 @@
-#if 0
-#if 0
-#endif \
-\
-
-#endif
===================================================================
Index: testsuite/gcc.c-torture/special/960224-2.c
--- testsuite/gcc.c-torture/special/960224-2.c Wed Jun 28 13:00:03 2000
+++ testsuite/gcc.c-torture/special/960224-2.c Tue May 5 13:32:27 1998
@@ -1,4 +0,0 @@
-#if 0
-#if 0
-#endif /
-#endif
===================================================================
Index: testsuite/gcc.c-torture/special/981006-1.c
--- testsuite/gcc.c-torture/special/981006-1.c Wed Jun 28 13:00:03 2000
+++ testsuite/gcc.c-torture/special/981006-1.c Tue May 5 13:32:27 1998
@@ -1,50 +0,0 @@
-/* Test that tablejump insns are correctly handled. If the compiler
- loses track of the jump targets, it will report that x and y can be
- used uninitialized.
-
- This is broken in egcs 1998/10/06 for mips in pic mode. */
-/* { dg-do compile } */
-
-int foo (int a, int b)
-{
- __label__ z;
- int x; /* { dg-bogus "warning: `.' might be used uninitialized in this function" } */
- int y; /* { dg-bogus "warning: `.' might be used uninitialized in this function" } */
- static void *p;
-
- switch (a) {
- case 2:
- x = 4;
- break;
- case 4:
- x = 6;
- break;
- case 8: case 10: case 13: case 11: case 17: case 19:
- x = 7;
- break;
- default:
- x = -1;
- break;
- }
- switch (b) {
- case 2:
- y = 4;
- break;
- case 4:
- y = 6;
- break;
- case 8: case 10: case 13: case 11: case 17: case 19:
- y = 7;
- break;
- default:
- y = -1;
- break;
- }
- z:
- p = &&z;
- return x * y;
-}
-int main (int argc, char *argv[])
-{
- return 1 == foo (argc, argc + 1);
-}
===================================================================
Index: testsuite/gcc.c-torture/special/eeprof-1.c
--- testsuite/gcc.c-torture/special/eeprof-1.c Wed Jun 28 13:00:03 2000
+++ testsuite/gcc.c-torture/special/eeprof-1.c Tue May 5 13:32:27 1998
@@ -1,67 +0,0 @@
-#define ASSERT(X) if (!(X)) abort ();
-#define NOCHK __attribute__ ((no_instrument_function))
-
-int entry_calls, exit_calls;
-void (*last_fn_entered)();
-void (*last_fn_exited)();
-
-int main () NOCHK;
-
-void foo ()
-{
- ASSERT (last_fn_entered == foo);
-}
-
-static void foo2 ()
-{
- ASSERT (entry_calls == 1 && exit_calls == 0);
- ASSERT (last_fn_entered == foo2);
- foo ();
- ASSERT (entry_calls == 2 && exit_calls == 1);
- ASSERT (last_fn_entered == foo);
- ASSERT (last_fn_exited == foo);
-}
-
-void nfoo (void) NOCHK;
-void nfoo ()
-{
- ASSERT (entry_calls == 2 && exit_calls == 2);
- ASSERT (last_fn_entered == foo);
- ASSERT (last_fn_exited == foo2);
- foo ();
- ASSERT (entry_calls == 3 && exit_calls == 3);
- ASSERT (last_fn_entered == foo);
- ASSERT (last_fn_exited == foo);
-}
-
-int main ()
-{
- ASSERT (entry_calls == 0 && exit_calls == 0);
-
- foo2 ();
-
- ASSERT (entry_calls == 2 && exit_calls == 2);
- ASSERT (last_fn_entered == foo);
- ASSERT (last_fn_exited == foo2);
-
- nfoo ();
-
- ASSERT (entry_calls == 3 && exit_calls == 3);
- ASSERT (last_fn_entered == foo);
-
- return 0;
-}
-
-void __cyg_profile_func_enter (void (*fn)(), void (*parent)()) NOCHK;
-void __cyg_profile_func_exit (void (*fn)(), void (*parent)()) NOCHK;
-
-void __cyg_profile_func_enter (void (*fn)(), void (*parent)())
-{
- entry_calls++;
- last_fn_entered = fn;
-}
-void __cyg_profile_func_exit (void (*fn)(), void (*parent)())
-{
- exit_calls++;
- last_fn_exited = fn;
-}
===================================================================
Index: testsuite/gcc.c-torture/special/special.exp
--- testsuite/gcc.c-torture/special/special.exp Wed Jun 28 13:00:03 2000
+++ testsuite/gcc.c-torture/special/special.exp Tue May 5 13:32:27 1998
@@ -1,107 +0,0 @@
-# Copyright (C) 1988, 90-96, 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., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-# Please email any bugs, comments, and/or additions to this file to:
-# bug-gcc@prep.ai.mit.edu
-
-# This file was written by Rob Savoye. (rob@cygnus.com)
-
-#
-# These tests come from Torbjorn Granlund (tege@cygnus.com)
-# C torture test suite.
-#
-
-if $tracelevel then {
- strace $tracelevel
-}
-
-# load support procs
-load_lib c-torture.exp
-load_lib gcc-dg.exp
-
-################## ADD NEXT CASE HERE (NOT AT THE END) ##################
-
-# 981006-1
-# For MIPS at least, pic is needed to trigger the problem.
-dg-init
-if { [istarget rs6000-*-aix*]
- || [istarget powerpc*-*-aix*]
- || [istarget arm*-*-*]
- || [istarget strongarm*-*-*]
- || [istarget fr30-*-*]
-} {
- set extra_flags ""
-} else {
- set extra_flags "-fpic"
-}
-dg-runtest $srcdir/$subdir/981006-1.c "-Wuninitialized -O2 $extra_flags" ""
-dg-finish
-
-# 920521-1
-c-torture 920521-1.c "-S"
-
-# 920520-1
-c-torture 920520-1.c "-S"
-
-# 920717-1
-if [isnative] then {
- set lines [gcc_target_compile "$srcdir/$subdir/920717-x.c" "920717-x.o" object {additional_flags="-w"}]
- if ![string match "" $lines] then {
- fail "920717-x.c"
- } else {
- # This is a completely bogus test. Sorry.
- catch exec "rm -f 920717-y.o"
- send_log "cc -c $srcdir/$subdir/920717-y.c 2>/dev/null >/dev/null\n"
- catch exec "cc -c $srcdir/$subdir/920717-y.c 2>/dev/null >/dev/null"
- if ![file exists "920717-y.o"] then {
- send_log "c89 -c $srcdir/$subdir/920717-y.c 2>/dev/null >/dev/null\n"
- catch exec "c89 -c $srcdir/$subdir/920717-y.c 2>/dev/null >/dev/null"
- }
- if [file exists "920717-y.o"] then {
- set lines [gcc_target_compile "920717-y.o x.o" "x" executable ""]
- if [string match "" $lines] then {
- pass "920717-1.c"
- } else {
- fail "920717-1.c"
- }
- }
- }
-}
-
-# 920730-1
-if [isnative] then {
- c-torture "920730-1.c"
- c-torture "920730-1.c" "-traditional"
-}
-
-# 920413-1
-c-torture 920413-1.c "-Wtraditional"
-
-# 930510-1
-dg-init
-dg-runtest $srcdir/$subdir/930510-1.c "" ""
-dg-finish
-
-# 951130-1
-c-torture 951130-1.c "-Werror"
-
-# 960224-1
-c-torture 960224-1.c "-E -ansi -pedantic-errors"
-
-# 960224-2
-#c-torture 960224-2.c "-E -ansi -pedantic-errors"
-
-c-torture-execute $srcdir/$subdir/eeprof-1.c "-finstrument-functions"
===================================================================
Index: testsuite/gcc.dg/920413-1.c
--- testsuite/gcc.dg/920413-1.c Tue May 5 13:32:27 1998
+++ testsuite/gcc.dg/920413-1.c Wed Jun 28 12:59:59 2000
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-Wtraditional" } */
+
+int
+x (b)
+{
+ return
+ 4294967295U /* { dg-warning "width of integer constant may change" } */
+ / (unsigned long) b;
+}
===================================================================
Index: testsuite/gcc.dg/940409-1.c
--- testsuite/gcc.dg/940409-1.c Tue May 5 13:32:27 1998
+++ testsuite/gcc.dg/940409-1.c Wed Jun 28 12:59:59 2000
@@ -0,0 +1,8 @@
+/* GCC should allow struct S to be in a register, but it doesn't. This is
+ an obscure corner case, hasn't worked since 1994, and we don't expect it
+ to work anytime soon, hence XFAIL. */
+/* { dg-do compile } */
+
+struct S { volatile int field; };
+int f (register struct S arg); /* { dg-bogus "volatile field" "with arg" { xfail *-*-* } } */
+int g (register struct S); /* { dg-bogus "volatile field" "no arg" { xfail *-*-* } } */
===================================================================
Index: testsuite/gcc.dg/951130-1.c
--- testsuite/gcc.dg/951130-1.c Tue May 5 13:32:27 1998
+++ testsuite/gcc.dg/951130-1.c Wed Jun 28 12:59:59 2000
@@ -0,0 +1,5 @@
+/* { dg-do compile }
+ { dg-options "-Werror" } */
+
+unsigned long long x = -(unsigned long long)(-(long long)
+ (((unsigned long long)0 - 1) >> 1) - 1);
===================================================================
Index: testsuite/gcc.dg/cpp/19930510-1.c
--- testsuite/gcc.dg/cpp/19930510-1.c Tue May 5 13:32:27 1998
+++ testsuite/gcc.dg/cpp/19930510-1.c Wed Jun 28 12:59:59 2000
@@ -0,0 +1,5 @@
+/* { dg-do compile } */
+
+#define ugly 3
+#ugly "foobar" 3 /* { dg-error "invalid" "invalid directive" } */
+int main() { exit (0); }
===================================================================
Index: testsuite/gcc.dg/cpp/19960224-1.c
--- testsuite/gcc.dg/cpp/19960224-1.c Tue May 5 13:32:27 1998
+++ testsuite/gcc.dg/cpp/19960224-1.c Wed Jun 28 12:59:59 2000
@@ -0,0 +1,8 @@
+/* { dg-do preprocess } */
+
+#if 0
+#if 0
+#endif \
+\
+
+#endif
===================================================================
Index: testsuite/gcc.dg/cpp/19960224-2.c
--- testsuite/gcc.dg/cpp/19960224-2.c Tue May 5 13:32:27 1998
+++ testsuite/gcc.dg/cpp/19960224-2.c Wed Jun 28 12:59:59 2000
@@ -0,0 +1,6 @@
+/* { dg-do preprocess } */
+
+#if 0
+#if 0
+#endif / /* { dg-error "text after #endif" "text after #endif" } */
+#endif
===================================================================
Index: testsuite/gcc.failure/940409-1.c
--- testsuite/gcc.failure/940409-1.c Wed Jun 28 13:00:03 2000
+++ testsuite/gcc.failure/940409-1.c Tue May 5 13:32:27 1998
@@ -1,3 +0,0 @@
-struct S { volatile int field; };
-int f (register struct S arg);
-int g (register struct S);
===================================================================
Index: testsuite/gcc.failure/940409-1.x
--- testsuite/gcc.failure/940409-1.x Wed Jun 28 13:00:03 2000
+++ testsuite/gcc.failure/940409-1.x Tue May 5 13:32:27 1998
@@ -1,6 +0,0 @@
-# gcc doesn't handle compile/940409-1.cexp properly, but it's an obscure bug
-# so rather than constantly seeing it fail, just record it as expected to
-# fail.
-
-set torture_compile_xfail "*-*-*"
-return 0 ;# `0' says we didn't handle the testcase ourselves so continue
===================================================================
Index: testsuite/gcc.failure/failure.exp
--- testsuite/gcc.failure/failure.exp Wed Jun 28 13:00:03 2000
+++ testsuite/gcc.failure/failure.exp Tue May 5 13:32:27 1998
@@ -1,58 +0,0 @@
-#
-# Expect driver script for GCC Regression Tests
-# Copyright (C) 1993, 1997 Free Software Foundation
-#
-# This file 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., 675 Mass Ave, Cambridge, MA 02139, USA.
-#
-# Written by Jeffrey Wheat (cassidy@cygnus.com)
-#
-
-#
-# These tests come from Torbjorn Granlund's (tege@cygnus.com)
-# C torture test suite, and other contributors.
-#
-
-if $tracelevel then {
- strace $tracelevel
-}
-
-# load support procs
-load_lib c-torture.exp
-
-#
-# This loop will run c-torture on any *.c file found in this directory.
-# If a *.c has a corresponding *.exp file, then the test is skipped as
-# as the *.exp will drive the test itself. I did things this way so that
-# generic tests did not need a seperate .exp for it. Only the tests that
-# required unique options would need it's own .exp file.
-#
-
-#
-# The main logic is in ../lib/c-torture.exp. This was done to eliminate
-# redundant code that otherwise lived in each of these driver files.
-#
-foreach testcase [glob -nocomplain $srcdir/$subdir/*.c] {
-
- # let c-torture.exp figure out the path. this lets users add new
- # special tests without having to remeber to use $srcdir/$subdir
-
- if [file exists [file rootname $testcase].exp] then {
- verbose "INFO:\"[file rootname $testcase].exp\"exists, skipping test" 1
- continue
- } else {
- c-torture [file tail $testcase]
- }
-}
-
===================================================================
Index: testsuite/gcc.misc-tests/linkage-x.c
--- testsuite/gcc.misc-tests/linkage-x.c Tue May 5 13:32:27 1998
+++ testsuite/gcc.misc-tests/linkage-x.c Wed Jun 28 13:00:00 2000
@@ -0,0 +1,3 @@
+/* 920717-1.c */
+
+const char s[]="foo";
===================================================================
Index: testsuite/gcc.misc-tests/linkage-y.c
--- testsuite/gcc.misc-tests/linkage-y.c Tue May 5 13:32:27 1998
+++ testsuite/gcc.misc-tests/linkage-y.c Wed Jun 28 13:00:00 2000
@@ -0,0 +1,8 @@
+/* 920717-y.c */
+
+extern const char s[];
+
+main()
+{
+ puts(s);
+}
===================================================================
Index: testsuite/gcc.misc-tests/linkage.exp
--- testsuite/gcc.misc-tests/linkage.exp Tue May 5 13:32:27 1998
+++ testsuite/gcc.misc-tests/linkage.exp Wed Jun 28 13:00:00 2000
@@ -0,0 +1,46 @@
+# Copyright (C) 1988, 90-96, 1997, 2000 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gcc@prep.ai.mit.edu
+
+# This file used to be gcc.c-torture/special/special.exp, which
+# was written by Rob Savoye. (rob@cygnus.com)
+# All the other tests driven by that file have since been moved elsewhere.
+
+if [isnative] then {
+ set lines [gcc_target_compile "$srcdir/$subdir/linkage-x.c" "linkage-x.o" object {additional_flags="-w"}]
+ if ![string match "" $lines] then {
+ fail "linkage.c"
+ } else {
+ # This is a completely bogus test. Sorry.
+ catch { exec rm -f linkage-y.o }
+ send_log "cc -c $srcdir/$subdir/linkage-y.c >&/dev/null\n"
+ catch { exec cc -c "$srcdir/$subdir/linkage-y.c" >&/dev/null }
+ if ![file exists "linkage-y.o"] then {
+ send_log "c89 -c $srcdir/$subdir/linkage-y.c >&/dev/null\n"
+ catch { exec c89 -c "$srcdir/$subdir/linkage-y.c" >&/dev/null }
+ }
+ if [file exists "linkage-y.o"] then {
+ set lines [gcc_target_compile "linkage-y.o linkage-x.o" "x" executable ""]
+ if [string match "" $lines] then {
+ pass "linkage.c"
+ } else {
+ fail "linkage.c"
+ }
+ }
+ }
+}
More information about the Gcc-patches
mailing list