diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg/cpp-mi.c')
| -rw-r--r-- | gcc/testsuite/gcc.dg/cpp-mi.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/gcc/testsuite/gcc.dg/cpp-mi.c b/gcc/testsuite/gcc.dg/cpp-mi.c index 1fb62788925..a05b279558b 100644 --- a/gcc/testsuite/gcc.dg/cpp-mi.c +++ b/gcc/testsuite/gcc.dg/cpp-mi.c @@ -1,10 +1,6 @@ /* Test "ignore redundant include" facility. - This doesn't test for the case where the file is opened, and then ignored - (the file shouldn't have even been opened). That would require tracing - system calls. It could be done on some systems however. */ - -/* We have to test two cases: C comments at the top and C++ comments - at the top. */ + We must test with C and C++ comments outside the guard conditional; + also, we test guarding with #ifndef and #if !defined. */ /* { dg-do preprocess } { dg-options "" } */ @@ -15,16 +11,24 @@ #include "cpp-micc.h" #include "cpp-micc.h" -main () +#include "cpp-mind.h" +#include "cpp-mind.h" + +#include "cpp-mindp.h" +#include "cpp-mindp.h" + +int +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-micc? line] } } + { 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} {\[0-9\]+ cpp-micc}$" $tmp] \{ } } + { dg-final { if [regexp "^{\[0-9\]+ cpp-mic\.h} {\[0-9\]+ cpp-micc\.h} {\[0-9\]+ cpp-mind\.h} {\[0-9\]+ cpp-mindp\.h}$" $tmp] \{ } } { dg-final { pass "cpp-mi.c: redundant include check" } } { dg-final { \} else \{ } } { dg-final { fail "cpp-mi.c: redundant include check" } } |

