aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/cpp/vararg1.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/cpp/vararg1.c')
-rw-r--r--gcc/testsuite/gcc.dg/cpp/vararg1.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/cpp/vararg1.c b/gcc/testsuite/gcc.dg/cpp/vararg1.c
new file mode 100644
index 0000000..aa8ed79
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/cpp/vararg1.c
@@ -0,0 +1,19 @@
+/* Test for changed behavior of the GNU varargs extension.
+ ##args, where args is a rest argument which received zero tokens,
+ used to delete the previous sequence of nonwhitespace characters.
+ Now it deletes the previous token. */
+
+/* { dg-do run } */
+/* { dg-options -w } */
+
+#include <string.h>
+
+#define S(str, args...) " " str "\n", ##args
+
+int
+main()
+{
+ const char *s = S("foo");
+ return strchr (s, '\n') == NULL;
+}
+