aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi7.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi7.c')
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi7.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi7.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi7.c
new file mode 100644
index 000000000..415186cba
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/mi7.c
@@ -0,0 +1,19 @@
+/* Test "ignore redundant include" facility.
+
+ -H is used because cpp might confuse the issue by optimizing out
+ #line markers. This test only passes if the headers is read
+ twice.
+
+ The disgusting regexp in the dg-error line, when stuck into
+ dg.exp's compiler-output regexp, matches the correct -H output and
+ only the correct -H output. It has to be all on one line because
+ otherwise it will not be interpreted all in one unit. */
+
+/* { dg-do preprocess }
+ { dg-options "-H" }
+ { dg-message "mi7a\.h\n\[^\n\]*mi7a\.h\n\[^\n\]*mi7b\.h\n\[^\n\]*mi7b\.h" "redundant include check" { target *-*-* } 0 } */
+
+#include "mi7a.h"
+#include "mi7a.h"
+#include "mi7b.h"
+#include "mi7b.h"