]> gcc.gnu.org Git - gcc.git/blob - gcc/testsuite/gcc.dg/cpp-as1.c
cppinit.c (cpp_start_read): Turn off -Wtraditional if processing C++.
[gcc.git] / gcc / testsuite / gcc.dg / cpp-as1.c
1 /* Basic tests of the #assert preprocessor extension. */
2 /* { dg-do compile } */
3 /* { dg-options "" } */
4
5 #define fail int fail
6
7 #assert abc (def)
8 #assert abc (ghi)
9 #assert abc (jkl)
10 #assert space ( s p a c e )
11
12 /* Basic: */
13 #if !#abc (def) || !#abc (ghi) || !#abc (jkl)
14 fail
15 #endif
16
17 /* any answer for #abc */
18 #if !#abc
19 fail
20 #endif
21
22 /* internal whitespace is collapsed,
23 external whitespace is deleted */
24 #if !#space (s p a c e) || !#space ( s p a c e ) || #space (space)
25 fail
26 #endif
27
28 /* removing assertions */
29 #unassert abc (jkl)
30 #if !#abc || !#abc (def) || !#abc (ghi) || #abc (jkl)
31 fail
32 #endif
33
34 #unassert abc
35 #if #abc || #abc (def) || #abc (ghi) || #abc (jkl)
36 fail
37 #endif
38
39 int gobble
40
41 /* make sure it can succeed too.
42 also check space before open paren isn't significant */
43 #if #space(s p a c e)
44 ;
45 #endif
This page took 0.036447 seconds and 5 git commands to generate.