aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/cpp/19921210-1.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.dg/cpp/19921210-1.c')
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/19921210-1.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/19921210-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/19921210-1.c
new file mode 100644
index 000000000..32d2a816e
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/19921210-1.c
@@ -0,0 +1,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];