This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] compare-[19].c: Don't mention target names.


Hi,

Attached is a patch to remove dependence on target names.

With this patch, gcc.dg/compare1.c will test warnings with
-fno-short-enums.  gcc.dg/compare9.c will test warnings with
-fshort-enums.

Tested on x86_64-pc-linux-gnu and cross to arm-none-eabi.  Committed
as obvious.

Kazu Hirata

2005-07-05  Kazu Hirata  <kazu@codesourcery.com>

	* gcc.dg/compare1.c: Add -fno-short-enums.  Don't skip on any
	target.
	* gcc.dg/compare9.c: Use -fshort-enums instead of
	-fshort-enums.  Change the last test to dg-bogus.

Index: testsuite/gcc.dg/compare1.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/compare1.c,v
retrieving revision 1.4
diff -u -d -p -r1.4 compare1.c
--- testsuite/gcc.dg/compare1.c	4 Jul 2005 18:17:26 -0000	1.4
+++ testsuite/gcc.dg/compare1.c	4 Jul 2005 18:59:06 -0000
@@ -1,11 +1,10 @@
 /* Test for a bogus warning on comparison between signed and unsigned.
-   This was inspired by code in gcc. */
+   This was inspired by code in gcc.  This testcase is identical to
+   compare9.c except that we use -fno-short-enums here and expect a
+   warning from case 4.  */
 
 /* { dg-do compile } */
-/* { dg-options "-Wsign-compare" } */
-/* This test would fail on targets with short enums being default.  See
-   compare9.c.  */
-/* { dg-skip-if "" { arm*-*-eabi* arm*-*-symbianelf* }  { "*" } { "" } } */
+/* { dg-options "-fno-short-enums -Wsign-compare" } */
 
 int tf = 1;
 
Index: testsuite/gcc.dg/compare9.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/compare9.c,v
retrieving revision 1.1
diff -u -d -p -r1.1 compare9.c
--- testsuite/gcc.dg/compare9.c	4 Jul 2005 18:17:26 -0000	1.1
+++ testsuite/gcc.dg/compare9.c	4 Jul 2005 18:59:06 -0000
@@ -1,11 +1,10 @@
 /* Test for a bogus warning on comparison between signed and unsigned.
    This was inspired by code in gcc.  This testcase is identical to
-   compare1.c except that we add -fno-short-enums to accomodate
-   targets with short enums being default, such as arm*-*-eabi* and
-   arm*-*-symbianelf*.  */
+   compare1.c except that we use -fshort-enums here and do not expect
+   a warning from case 4.  */
 
 /* { dg-do compile } */
-/* { dg-options "-fno-short-enums -Wsign-compare" } */
+/* { dg-options "-fshort-enums -Wsign-compare" } */
 
 int tf = 1;
 
@@ -38,5 +37,5 @@ int h(enum mm2 x)
 
 int i(enum mm2 x)
 {
-  return x == (tf?DI2:-1); /* { dg-warning "signed and unsigned" "case 4" } */
+  return x == (tf?DI2:-1); /* { dg-bogus "signed and unsigned" "case 4" } */
 }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]