summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/cpp/19921210-1.c
blob: 32d2a816ece7adbcca438fe0944a3e2cba76e77d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
/* Test for proper disabling of macros within their own expansions.  */
/* { dg-do compile } */

/* The following is a trick to evaluate a complex boolean expression
   at compile time, inspired by autoconf 2.13's sizeof-detection.  */

enum { a = 4, f = 3 };

#define a1(y) (y+2)
#define a2(y) a1(y)+1
#define f a+f

char array[(a2(f)) == 10 ? 1 : -1];