work around dejagnu bug causing spurious failures

Zack Weinberg zack@wolery.cumb.org
Mon Apr 3 16:03:00 GMT 2000


A number of the cpp tests are failing spuriously because of a bug in
dejagnu.  The new preprocessor issues error messages with column
numbers.  That can confuse the error-matching regexp in dg.exp, causing
it to match lines it shouldn't, which are then unavailable to be
matched by other tests.

This patch works around the bug, by disabling column numbers in all
the test cases where it makes a difference.  The changes to the specs
are necessary so that the driver propagates -fno-show-column to the
preprocessor.

zw

	* gcc.c (C specs): Pass -f(no-)show-column to the
          preprocessor.
	* ch/lang-specs.h, cp/lang-specs.h, f/lang-specs.h,
	objc/lang-specs.h: Likewise.

	* gcc.dg/cpp-redef-2.c, gcc.dg/cpp-tradwarn1.c,
	gcc.dg/cpp-unc.c: Add -fno-show-column to compiler options.

===================================================================
Index: gcc.c
--- gcc.c	2000/03/28 18:06:15	1.136
+++ gcc.c	2000/04/03 22:51:28
@@ -631,6 +631,7 @@ static struct compiler default_compilers
         %{traditional} %{ftraditional:-traditional}\
         %{traditional-cpp:-traditional}\
 	%{fleading-underscore} %{fno-leading-underscore}\
+	%{fshow-column} %{fno-show-column}\
 	%{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C %{D*} %{U*} %{i*} %Z\
         %i %{E:%W{o*}}%{M:%W{o*}}%{MM:%W{o*}}\n}\
       %{!E:%{!M:%{!MM:cc1 %i %1 \
@@ -667,6 +668,7 @@ static struct compiler default_compilers
 	%{fshort-wchar:-D__WCHAR_TYPE__=short\\ unsigned\\ int}\
         %{traditional} %{ftraditional:-traditional}\
         %{traditional-cpp:-traditional}\
+	%{fshow-column} %{fno-show-column}\
 	%{fleading-underscore} %{fno-leading-underscore}\
 	%{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C %{D*} %{U*} %{i*} %Z\
         %i %{!M:%{!MM:%{!E:%{!pipe:%g.i}}}}%{E:%W{o*}}%{M:%W{o*}}%{MM:%W{o*}} |\n",
@@ -695,6 +697,7 @@ static struct compiler default_compilers
 	%{fshort-wchar:-D__WCHAR_TYPE__=short\\ unsigned\\ int}\
         %{traditional} %{ftraditional:-traditional}\
         %{traditional-cpp:-traditional}\
+	%{fshow-column} %{fno-show-column}\
 	%{fleading-underscore} %{fno-leading-underscore}\
 	%{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C %{D*} %{U*} %{i*} %Z\
         %i %W{o*}}\
@@ -713,6 +716,7 @@ static struct compiler default_compilers
 	%{fshort-wchar:-D__WCHAR_TYPE__=short\\ unsigned\\ int}\
         %{traditional} %{ftraditional:-traditional}\
         %{traditional-cpp:-traditional}\
+	%{fshow-column} %{fno-show-column}\
 	%{fleading-underscore} %{fno-leading-underscore}\
 	%{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C %{D*} %{U*} %{i*} %Z\
         %i %W{o*}"}},
@@ -743,6 +747,7 @@ static struct compiler default_compilers
 	%{fshort-wchar:-D__WCHAR_TYPE__=short\\ unsigned\\ int}\
         %{traditional} %{ftraditional:-traditional}\
         %{traditional-cpp:-traditional}\
+	%{fshow-column} %{fno-show-column}\
 	%{fleading-underscore} %{fno-leading-underscore}\
 	%{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C %{D*} %{U*} %{i*} %Z\
         %i %{!M:%{!MM:%{!E:%{!pipe:%g.s}}}}%{E:%W{o*}}%{M:%W{o*}}%{MM:%W{o*}} |\n",
===================================================================
Index: ch/lang-specs.h
--- ch/lang-specs.h	2000/02/16 07:54:51	1.10
+++ ch/lang-specs.h	2000/04/03 22:51:28
@@ -29,6 +29,7 @@ Boston, MA 02111-1307, USA.  */
         %{!no-gcc:-D__GNUCHILL__=%v1 -D__GNUC_MINOR__=%v2 -D__GNUC_PATCHLEVEL__=%v3}\
         %c %{Os:-D__OPTIMIZE_SIZE__} %{O*:-D__OPTIMIZE__} %{traditional} %{ftraditional:-traditional}\
         %{traditional-cpp:-traditional} %{!undef:%{!ansi:%p} %P} %{trigraphs}\
+	%{fshow-column} %{fno-show-column}\
 	%{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C %{D*} %{U*} %{i*} %Z\
         %i %{!E:%g.i}%{E:%W{o*}} \n",
    "%{!E:cc1chill %g.i %1 \
===================================================================
Index: cp/lang-specs.h
--- cp/lang-specs.h	2000/03/06 13:37:50	1.23
+++ cp/lang-specs.h	2000/04/03 22:51:28
@@ -78,6 +78,7 @@ Boston, MA 02111-1307, USA.  */
         %c %{Os:-D__OPTIMIZE_SIZE__} %{O*:%{!O0:-D__OPTIMIZE__}} %{trigraphs}\
 	%{ffast-math:-D__FAST_MATH__}\
 	%{fshort-wchar:-D__WCHAR_TYPE__=short\\ unsigned\\ int}\
+	%{fshow-column} %{fno-show-column}\
 	%{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C %{D*} %{U*} %{i*} %Z\
         %i %{!M:%{!MM:%{!E:%{!pipe:%g.ii}}}}%{E:%W{o*}}%{M:%W{o*}}%{MM:%W{o*}} |\n",
     "%{!M:%{!MM:%{!E:cc1plus %{!pipe:%g.ii} %1 %2\
===================================================================
Index: f/lang-specs.h
--- f/lang-specs.h	2000/02/26 20:02:01	1.19
+++ f/lang-specs.h	2000/04/03 22:51:28
@@ -43,6 +43,7 @@ the Free Software Foundation, 59 Temple 
 	%{!undef:%P} -D_LANGUAGE_FORTRAN %{trigraphs} \
 	%c %{Os:-D__OPTIMIZE_SIZE__} %{O*:%{!O0:-D__OPTIMIZE__}} -traditional\
 	%{ffast-math:-D__FAST_MATH__}\
+	%{fshow-column} %{fno-show-column}\
 	%{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C %{D*} %{U*} %{i*} %Z\
 	%i %{!M:%{!MM:%{!E:%{!pipe:%g.i}}}}%{E:%W{o*}}%{M:%W{o*}}%{MM:%W{o*}} |\n",
     "%{!M:%{!MM:%{!E:f771 %{!pipe:%g.i} %1 %(f771) \
===================================================================
Index: objc/lang-specs.h
--- objc/lang-specs.h	2000/02/17 06:07:20	1.10
+++ objc/lang-specs.h	2000/04/03 22:51:28
@@ -35,6 +35,7 @@ Boston, MA 02111-1307, USA.  */
         %{traditional} %{ftraditional:-traditional}\
         %{traditional-cpp:-traditional}\
 	%{fleading-underscore} %{fno-leading-underscore}\
+	%{fshow-column} %{fno-show-column}\
 	%{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C %{D*} %{U*} %{i*} %Z\
         %i %{E:%W{o*}}%{M:%W{o*}}%{MM:%W{o*}}\n}",
     "%{!M:%{!MM:%{!E:cc1obj %i %1 \
@@ -68,6 +69,7 @@ Boston, MA 02111-1307, USA.  */
         %{traditional} %{ftraditional:-traditional}\
         %{traditional-cpp:-traditional}\
 	%{fleading-underscore} %{fno-leading-underscore}\
+	%{fshow-column} %{fno-show-column}\
 	%{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C %{D*} %{U*} %{i*} %Z\
         %i %{!M:%{!MM:%{!E:%{!pipe:%g.mi}}}}%{E:%W{o*}}%{M:%W{o*}}%{MM:%W{o*}} |\n",
     "%{!M:%{!MM:%{!E:cc1obj %{!pipe:%g.mi} %1 \
===================================================================
Index: testsuite/gcc.dg/cpp-redef-2.c
--- testsuite/gcc.dg/cpp-redef-2.c	2000/03/09 23:04:50	1.3
+++ testsuite/gcc.dg/cpp-redef-2.c	2000/04/03 22:51:28
@@ -1,7 +1,7 @@
 /* Test for redefining macros with significant differences.  */
 
 /* { dg-do preprocess }
-   { dg-options "-ansi -pedantic -Wall" } */
+   { dg-options "-ansi -pedantic -Wall -fno-show-column" } */
 
 #define mac(a, b) (a) + (b)
 #define mac(a, b) (a) * (b)
===================================================================
Index: testsuite/gcc.dg/cpp-tradwarn1.c
--- testsuite/gcc.dg/cpp-tradwarn1.c	2000/04/02 22:50:55	1.2
+++ testsuite/gcc.dg/cpp-tradwarn1.c	2000/04/03 22:51:28
@@ -1,6 +1,6 @@
 /* Test for warnings about nontraditional directives.  */
 /* { dg-do preprocess } */
-/* { dg-options "-pedantic -Wtraditional" } */
+/* { dg-options "-pedantic -Wtraditional -fno-show-column" } */
 
 /* Block 1: K+R directives should have the # indented.  */
 
===================================================================
Index: testsuite/gcc.dg/cpp-unc.c
--- testsuite/gcc.dg/cpp-unc.c	1999/09/04 15:09:14	1.2
+++ testsuite/gcc.dg/cpp-unc.c	2000/04/03 22:51:28
@@ -1,4 +1,5 @@
 /* { dg-do preprocess } */
+/* { dg-options "-fno-show-column" } */
 
 /* Tests for un-terminated conditional diagnostics.
    Copyright (c) 1999 Free Software Foundation.


More information about the Gcc-patches mailing list