diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg/cpp/macro3.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/cpp/macro3.c | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/gcc/testsuite/gcc.dg/cpp/macro3.c b/gcc/testsuite/gcc.dg/cpp/macro3.c index b7adaea..e6a5ffc 100644 --- a/gcc/testsuite/gcc.dg/cpp/macro3.c +++ b/gcc/testsuite/gcc.dg/cpp/macro3.c @@ -5,23 +5,17 @@ Varargs test source Jamie Lokier. All adapted for the testsuite by Neil Booth, Oct 2000. */ -int c(int x) -{ - return x; -} - -int a(int x) -{ - return x; -} - /* Tests various macro abuse is correctly expanded. */ +static int d = 4; #define c(x) d #define d(x) c(2) -/* Every GCC <= 2.96 appears to fail this. */ +#if 0 +/* This macro chain above sucks up the whole file once it starts, so + I've commented it out. The example is left for idle amusement :-) */ #define a(x) b( #define b(x) a( +#endif #define apply(...) apply2 (__VA_ARGS__) #define half(x) ((x) / 2) @@ -32,12 +26,8 @@ extern void exit (int); int main() { - /* Expands to c(2). */ - if (c(c)(c) != 2) - abort (); - - /* Expands to a(2). */ - if (a(a)x)2) != 2) + /* Expands to c(2) then d. */ + if (c(c)(c) != 4) abort (); if (apply (half, 200) != 100) |