FSF GCC merge 02/23/03
[official-gcc.git] / gcc / testsuite / gcc.dg / cpp / assert1.c
blobff7cc620bec9d3504a9524b8998834d6b0010ef7
1 /* Basic tests of the #assert preprocessor extension. */
2 /* { dg-do compile } */
3 /* { dg-options "" } */
5 #define def unused expansion
6 #define fail int fail
8 #assert abc (def)
9 #assert abc (ghi)
10 #assert abc (jkl)
11 #assert space ( s p a c e )
13 /* Basic: */
14 #if !#abc (def) || !#abc (ghi) || !#abc (jkl)
15 fail
16 #endif
18 /* any answer for #abc */
19 #if !#abc
20 fail
21 #endif
23 /* internal whitespace is collapsed,
24 external whitespace is deleted */
25 #if !#space (s p a c e) || !#space ( s p a c e ) || #space (space)
26 fail
27 #endif
29 /* removing assertions */
30 #unassert abc (jkl)
31 #if !#abc || !#abc (def) || !#abc (ghi) || #abc (jkl)
32 fail
33 #endif
35 #unassert abc
36 #if #abc || #abc (def) || #abc (ghi) || #abc (jkl)
37 fail
38 #endif
40 int gobble
42 /* make sure it can succeed too.
43 also check space before open paren isn't significant */
44 #if #space(s p a c e)
46 #endif