summaryrefslogtreecommitdiffstats
path: root/gcc/testsuite/gcc.dg/cpp/undef1.c
blob: 821d65453119e67e3a7e2c67216566fe2ab8ed20 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/* { dg-do preprocess } */

/* 6.9.3.11: ...If there  are sequences of preprocessing tokens within
   the list of arguments  that  would  otherwise  act  as  preprocessing
   directives, the behavior is undefined.

   I choose to make this a hard error.  It definitely should not cause
   a core dump.  */

#define foo(bar) bar

foo( blah	/* { dg-error "unterminated" "" { target *-*-* } 13 } */
#undef foo	/* { dg-error "may not be used inside" "foo(#undef foo)" } */
     blah )
OpenPOWER on IntegriCloud