111
|
1 /* Test for redefining traditional macros with insignificant
|
|
2 (i.e. whitespace) differences. */
|
|
3
|
|
4 /* { dg-do preprocess } */
|
|
5
|
|
6
|
|
7 #define foo bar
|
|
8 #define /* x */ foo /* x */ bar /* x */
|
|
9 /* { dg-bogus "redefined" "foo redefined" { target *-*-* } .-1 } */
|
|
10 /* { dg-bogus "previous def" "foo prev def" { target *-*-* } .-3 } */
|
|
11
|
|
12 #define quux(thud) a one and a thud and a two /* { dg-line quux_def_1 } */
|
|
13 #define /**/ quux( thud ) /**/ a one and a /**/ thud /**/ and /**/ a two /* { dg-line quux_def_2 } */
|
|
14 /* { dg-bogus "redefined" "quux redefined" { target *-*-* } quux_def_2 } */
|
|
15 /* { dg-bogus "previous def" "quux prev def" { target *-*-* } quux_def_1 } */
|
|
16
|
|
17 #define quux(thud) a one and a thud and a two /* bah */ /* { dg-line quux_def_3 } */
|
|
18 /* { dg-bogus "redefined" "quux redefined" { target *-*-* } quux_def_3 } */
|
|
19 /* { dg-bogus "previous def" "quux prev def" { target *-*-* } quux_def_2 } */
|
|
20
|
|
21 #define f(x, y)x "x y z" y
|
|
22 #define f(x, y) x "x y z" y
|
|
23 /* { dg-bogus "redefined" "f redefined" { target *-*-* } .-1 } */
|
|
24 /* { dg-bogus "previous def" "f prev def" { target *-*-* } .-3 } */
|
|
25
|
|
26 #define baz() whiz bang
|
|
27 #define baz() whiz bang
|
|
28 /* { dg-bogus "redefined" "baz redefined" { target *-*-* } .-1 } */
|
|
29 /* { dg-bogus "previous def" "baz prev def" { target *-*-* } .-3 } */
|
|
30
|
|
31 #define g foo
|
|
32 #undef g
|
|
33 #define g
|
|
34 /* { dg-bogus "redefined" "g redefined" { target *-*-* } .-1 } */
|
|
35 /* { dg-bogus "previous def" "g prev def" { target *-*-* } .-4 } */
|