aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/funlike.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/funlike.c')
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/funlike.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/funlike.c b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/funlike.c
new file mode 100644
index 000000000..db550d53c
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/cpp/trad/funlike.c
@@ -0,0 +1,25 @@
+/* Test that undefined names evaluate to zero, that macros after a
+ funlike macro are expanded, and that if it is a '(' the funlike
+ macro is not treated as such. */
+
+/* { dg-do preprocess } */
+
+#define f(x) x
+#define h != 0
+#define i
+#define paren (
+
+#if f != 0
+# error /* { dg-bogus "error" "undefined name" } */
+#endif
+
+#if f h
+# error /* { dg-bogus "error" "h not expanded" } */
+#endif
+
+#if f i
+# error /* { dg-bogus "error" "empty macro" } */
+#endif
+
+#if f paren 6) /* { dg-error "missing binary" "macro-expanded parenthesis" } */
+#endif