aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/cpp-mi.c
diff options
context:
space:
mode:
authorZack Weinberg <zack@wolery.cumb.org>2000-06-25 23:31:02 +0000
committerZack Weinberg <zack@gcc.gnu.org>2000-06-25 23:31:02 +0000
commitb42115f711f164a05b1e9f3ca5565eb74ab3964b (patch)
tree22d911bf83ddfad4e54cbaf87ad503050300c2c8 /gcc/testsuite/gcc.dg/cpp-mi.c
parent1a03d9675e10d1d69754966c2b5329dc0d1d04db (diff)
downloadgcc-b42115f711f164a05b1e9f3ca5565eb74ab3964b.zip
gcc-b42115f711f164a05b1e9f3ca5565eb74ab3964b.tar.gz
gcc-b42115f711f164a05b1e9f3ca5565eb74ab3964b.tar.bz2
20000625-1.c, [...]: New tests.
* gcc.dg/20000625-1.c, gcc.dg/20000625-2.c, gcc.dg/cpp-mi3.c: New tests. * gcc.dg/cpp-mi3.def: New file. * gcc.dg/cpp-as1.c: Also test that macro expansion does not occur inside assertions. * gcc.dg/cpp-as2.c: Make error regexps match either old or new lexer's error messages. * gcc.dg/cpp-mi.c: Use -H and examine the output, don't try to divine anything from the linemarkers. * gcc.dg/cpp-micc.h: Fix typo (declare int b, not int a); * gcc.dg/poison-1.c: Preprocess only; apply -fno-show-column. From-SVN: r34701
Diffstat (limited to 'gcc/testsuite/gcc.dg/cpp-mi.c')
-rw-r--r--gcc/testsuite/gcc.dg/cpp-mi.c27
1 files changed, 12 insertions, 15 deletions
diff --git a/gcc/testsuite/gcc.dg/cpp-mi.c b/gcc/testsuite/gcc.dg/cpp-mi.c
index f83a64d..3d05587 100644
--- a/gcc/testsuite/gcc.dg/cpp-mi.c
+++ b/gcc/testsuite/gcc.dg/cpp-mi.c
@@ -1,9 +1,18 @@
/* Test "ignore redundant include" facility.
We must test with C and C++ comments outside the guard conditional;
- also, we test guarding with #ifndef and #if !defined. */
+ also, we test guarding with #ifndef and #if !defined.
+ -H is used because cpp might confuse the issue by optimizing out
+ #line markers. This test only passes if each of the headers is
+ read exactly once.
-/* { dg-do preprocess }
- { dg-options "" } */
+ 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 compile }
+ { dg-options "-H" }
+ { dg-error "mic\.h\n\[^\n\]*micc\.h\n\[^\n\]*mind\.h\n\[^\n\]*mindp\.h\n\[^\n\]*mix\.h" "redundant include check" { target native } 0 } */
#include "cpp-mic.h"
#include "cpp-mic.h"
@@ -26,15 +35,3 @@ main (void)
{
return a + b + c + d;
}
-
-/*
- { dg-final { if ![file exists cpp-mi.i] { return } } }
-
- { dg-final { set tmp [grep cpp-mi.i {cpp-mi.*\.h} line] } }
- { dg-final { # send_user "$tmp\n" } }
- { dg-final { if [regexp "^{\[0-9\]+ cpp-mic\.h} {\[0-9\]+ cpp-micc\.h} {\[0-9\]+ cpp-mind\.h} {\[0-9\]+ cpp-mindp\.h} {\[0-9]+ cpp-mix\.h}$" $tmp] \{ } }
- { dg-final { pass "cpp-mi.c: redundant include check" } }
- { dg-final { \} else \{ } }
- { dg-final { fail "cpp-mi.c: redundant include check" } }
- { dg-final { \} } }
-*/