2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / gcc.dg / cpp / mi1.c
blob9f08a64aba9a677bb19288c5743828f85c932e28
1 /* Test "ignore redundant include" facility.
3 We must test with C and C++ comments, and null directives, outside
4 the guard conditional; also, we test guarding with #ifndef and #if
5 !defined. -H is used because cpp might confuse the issue by
6 optimizing out #line markers. This test only passes if each of the
7 headers is read exactly once.
9 The disgusting regexp in the dg-error line, when stuck into
10 dg.exp's compiler-output regexp, matches the correct -H output and
11 only the correct -H output. It has to be all on one line because
12 otherwise it will not be interpreted all in one unit. */
14 /* { dg-do compile }
15 { dg-options "-H" }
16 { dg-error "mi1c\.h\n\[^\n\]*mi1cc\.h\n\[^\n\]*mi1nd\.h\n\[^\n\]*mi1ndp\.h\n\[^\n\]*mi1x\.h" "redundant include check" { target *-*-* } 0 } */
18 #include "mi1c.h"
19 #include "mi1c.h"
20 #include "mi1c.h"
22 #include "mi1cc.h"
23 #include "mi1cc.h"
25 #include "mi1nd.h"
26 #include "mi1nd.h"
28 #include "mi1ndp.h"
29 #include "mi1ndp.h"
31 #define MIX_H
32 #include "mi1x.h"
33 #include "mi1x.h"
35 int
36 main (void)
38 return a + b + c + d;