aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/cpp/c99-empty-macro-args.c
diff options
context:
space:
mode:
authorAndrew Haley <aph@redhat.com>2008-07-03 10:13:48 +0000
committerAndrew Haley <aph@gcc.gnu.org>2008-07-03 10:13:48 +0000
commitd92007910f9e9033056d558dd4a49e4828cc0067 (patch)
treeb3b421ec3934a5398bb571a7badfd6d17cee0eb7 /gcc/testsuite/gcc.dg/cpp/c99-empty-macro-args.c
parentd07660ccf3063d1155df32ce320f101bafca04a2 (diff)
downloadgcc-d92007910f9e9033056d558dd4a49e4828cc0067.zip
gcc-d92007910f9e9033056d558dd4a49e4828cc0067.tar.gz
gcc-d92007910f9e9033056d558dd4a49e4828cc0067.tar.bz2
re PR preprocessor/33305 (We should warn about empty macro arguments)
2008-07-03 Andrew Haley <aph@redhat.com> PR preprocessor/33305 * gcc.dg/cpp/avoidpaste1.c: Use dg-options "-ansi" to avoid "-pedantic". * gcc.dg/cpp/avoidpaste2.c: Likewise * gcc.dg/cpp/20000519-1.c: Likewise. * g++.dg/ext/gnu-inline-global-reject.C: Likewise. * gcc.dg/cpp/c99-empty-macro-args.c: New test. * gcc.dg/cpp/c90-empty-macro-args.c: New test. From-SVN: r137411
Diffstat (limited to 'gcc/testsuite/gcc.dg/cpp/c99-empty-macro-args.c')
-rw-r--r--gcc/testsuite/gcc.dg/cpp/c99-empty-macro-args.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/cpp/c99-empty-macro-args.c b/gcc/testsuite/gcc.dg/cpp/c99-empty-macro-args.c
new file mode 100644
index 0000000..e1e0c61
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/cpp/c99-empty-macro-args.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-std=c99 -pedantic" } */
+
+#define f(a,b) f2(a,,b)
+#define f2(a,b,c) a; b; c;
+#define f3(a) a
+
+#define g() p()
+
+void p(void) {}
+
+
+void foo(void)
+{
+ f(p(),p());
+ f2(p(),,p());
+ f3();
+ g();
+}