aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/cpp-mi2.c12
-rw-r--r--gcc/testsuite/gcc.dg/cpp-mi2a.h5
-rw-r--r--gcc/testsuite/gcc.dg/cpp-mi2b.h6
-rw-r--r--gcc/testsuite/gcc.dg/cpp-mi2c.h15
5 files changed, 43 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index d5f6bbd..afce1fb 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2000-04-07 Zack Weinberg <zack@wolery.cumb.org>
+
+ * gcc.dg/cpp-mi2.c: New test.
+ * gcc.dg/cpp-mi2[abc].h: New files.
+
2000-04-07 Nathan Sidwell <nathan@codesourcery.com>
* g++.old-deja/g++.abi/vmihint.C: Adjust __vmi_class_type_info
diff --git a/gcc/testsuite/gcc.dg/cpp-mi2.c b/gcc/testsuite/gcc.dg/cpp-mi2.c
new file mode 100644
index 0000000..d5c814c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/cpp-mi2.c
@@ -0,0 +1,12 @@
+/* Test for overly eager multiple include optimization.
+ Problem distilled from glibc 2.0.7's time.h, sys/time.h, timebits.h.
+ Problem noted by Tom Tromey <tromey@cygnus.com>. */
+/* { dg-do compile } */
+
+#include "cpp-mi2a.h"
+#include "cpp-mi2b.h"
+
+int main (void)
+{
+ return x;
+}
diff --git a/gcc/testsuite/gcc.dg/cpp-mi2a.h b/gcc/testsuite/gcc.dg/cpp-mi2a.h
new file mode 100644
index 0000000..c86838c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/cpp-mi2a.h
@@ -0,0 +1,5 @@
+/* Test for overly eager multiple include optimization.
+ Problem distilled from glibc 2.0.7's time.h, sys/time.h, timebits.h.
+ Problem noted by Tom Tromey <tromey@cygnus.com>. */
+
+#include "cpp-mi2c.h"
diff --git a/gcc/testsuite/gcc.dg/cpp-mi2b.h b/gcc/testsuite/gcc.dg/cpp-mi2b.h
new file mode 100644
index 0000000..8d1970c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/cpp-mi2b.h
@@ -0,0 +1,6 @@
+/* Test for overly eager multiple include optimization.
+ Problem distilled from glibc 2.0.7's time.h, sys/time.h, timebits.h.
+ Problem noted by Tom Tromey <tromey@cygnus.com>. */
+
+#define need_x
+#include "cpp-mi2c.h"
diff --git a/gcc/testsuite/gcc.dg/cpp-mi2c.h b/gcc/testsuite/gcc.dg/cpp-mi2c.h
new file mode 100644
index 0000000..521792b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/cpp-mi2c.h
@@ -0,0 +1,15 @@
+/* Test for overly eager multiple include optimization.
+ Problem distilled from glibc 2.0.7's time.h, sys/time.h, timebits.h.
+ Problem noted by Tom Tromey <tromey@cygnus.com>. */
+#ifdef need_x
+#undef need_x
+#ifndef have_x
+#define have_x
+extern int x;
+#endif
+#endif
+
+#ifndef t_h
+#define t_h
+extern int y;
+#endif