This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: More multiple-include testcases
- To: gcc-patches at gcc dot gnu dot org
- Subject: Re: More multiple-include testcases
- From: Neil Booth <neil at daikokuya dot demon dot co dot uk>
- Date: Mon, 1 Oct 2001 09:05:29 +0100
- References: <20010930130034.A21104@daikokuya.demon.co.uk>
The test wasn't quite testing what I thought; since the header guard
was never defined it was easy for even a broken CPP to pass the test.
This patch fixes it.
Neil.
* mi6.c, mi6a.h, mi6b.h, mi6d.h, mi6e.h: Correct tests.
Index: mi6.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/cpp/mi6.c,v
retrieving revision 1.1
diff -u -p -r1.1 mi6.c
--- mi6.c 2001/09/30 12:02:21 1.1
+++ mi6.c 2001/10/01 08:02:43
@@ -14,16 +14,26 @@
increment VAR, since none of the initial set should have been
flagged as optimizable. */
-#define EMPTY
+#define EMPTYL
+#define EMPTYR
#define NOT !
-#define DEFINED defined (macro)
-#define IND ! defined (macro)
+#define DEFINED defined (guard)
+#define NOT_DEFINED ! defined (guard)
#include "mi6a.h"
#include "mi6b.h"
#include "mi6c.h"
#include "mi6d.h"
#include "mi6e.h"
+
+/* Define the macro guard, and redefine the macros to something that
+ forces compilation of the conditional blocks. */
+#define guard
+#define EMPTYL 1 ||
+#define EMPTYR || 1
+#define NOT
+#define DEFINED 0
+#define NOT_DEFINED 1
#define VAR five
Index: mi6a.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/cpp/mi6a.h,v
retrieving revision 1.1
diff -u -p -r1.1 mi6a.h
--- mi6a.h 2001/09/30 12:02:21 1.1
+++ mi6a.h 2001/10/01 08:02:43
@@ -1,4 +1,4 @@
-#if IND
+#if NOT_DEFINED
#ifdef VAR
VAR++;
#endif
Index: mi6b.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/cpp/mi6b.h,v
retrieving revision 1.1
diff -u -p -r1.1 mi6b.h
--- mi6b.h 2001/09/30 12:02:21 1.1
+++ mi6b.h 2001/10/01 08:02:43
@@ -1,4 +1,4 @@
-#if NOT defined (macro)
+#if NOT defined (guard)
#ifdef VAR
VAR++;
#endif
Index: mi6d.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/cpp/mi6d.h,v
retrieving revision 1.1
diff -u -p -r1.1 mi6d.h
--- mi6d.h 2001/09/30 12:02:22 1.1
+++ mi6d.h 2001/10/01 08:02:43
@@ -1,4 +1,4 @@
-#if EMPTY !defined (macro)
+#if EMPTYL !defined (guard)
#ifdef VAR
VAR++;
#endif
Index: mi6e.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/cpp/mi6e.h,v
retrieving revision 1.1
diff -u -p -r1.1 mi6e.h
--- mi6e.h 2001/09/30 12:02:22 1.1
+++ mi6e.h 2001/10/01 08:02:43
@@ -1,4 +1,4 @@
-#if !defined (macro) EMPTY
+#if !defined (guard) EMPTYR
#ifdef VAR
VAR++;
#endif