Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / gcc / testsuite / gcc.dg / cpp / vararg1.c
blob38bf56bd047ce45e50f76041347f10f96b71b2db
1 /* { dg-do run } */
2 /* { dg-options -w } */
4 /* count() used to give 1 owing to a buggy test for varargs. */
5 #define count(y...) count1 ( , ##y)
6 #define count1(y...) count2 (y,1,0)
7 #define count2(_,x0,n,y...) n
8 #if count() != 0 || count(A) != 1
9 #error Incorrect vararg argument counts
10 #endif
12 /* Test for changed behavior of the GNU varargs extension.
13 ##args, where args is a rest argument which received zero tokens,
14 used to delete the previous sequence of nonwhitespace characters.
15 Now it deletes the previous token. */
17 #include <string.h>
19 #define S(str, args...) " " str "\n", ##args
21 int
22 main()
24 const char *s = S("foo");
25 return strchr (s, '\n') == NULL;