summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/cpp/trad/recurse-2.c
blob: 5c6550fae2acdc529379c52d698cc1c52ca52ec0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/* Test for warning of and recovery from recursion in function-like
   macros.  */

/* { dg-do preprocess } */

#define foo() foo()
foo();				/* { dg-error "detected recursion" } */

#define bar() bar baz() bar
bar();				/* { dg-bogus "detected recursion" } */

#define baz() foo()
baz();			       /* { dg-error "detected recursion" } */

#define a(x) x(a)
a(a);			       /* { dg-error "detected recursion" } */