2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / gcc.dg / cpp / trad / macroargs.c
blobce28cccf99501def7483bb27567b55f39440fb3a
1 /* Test that whitespace in arguments is preserved, and that each
2 newline in macro arguments become a space. */
4 /* { dg-do run } */
6 #define f(x, y) "x y"
7 #define g(x) x
9 extern void abort (void);
11 int main ()
13 const char *str1 = f( foo ,bar);
14 const char *str2 = f(
15 foo
16 ,bar);
18 if (strcmp (str1, " foo bar"))
19 abort ();
21 if (strcmp (str1, str2))
22 abort ();
24 /* Verify that quoted state is preserved over a newline. */
25 if (strcmp (g /* { dg-bogus "unterminated 2" } */ ("1
26 , 2"), "1 , 2"))
27 abort ();
29 return 0;