OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.dg/] [cpp/] [trad/] [macroargs.c] - Blame information for rev 154

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
/* Test that whitespace in arguments is preserved, and that each
2
   newline in macro arguments become a space.  */
3
 
4
/* { dg-do run } */
5
 
6
#define f(x, y) "x y"
7
#define g(x) x
8
 
9
extern void abort (void);
10
 
11
int main ()
12
{
13
  const char *str1 = f( foo ,bar);
14
  const char *str2 = f(
15
foo
16
,bar);
17
 
18
  if (strcmp (str1, " foo  bar"))
19
    abort ();
20
 
21
  if (strcmp (str1, str2))
22
    abort ();
23
 
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 ();
28
 
29
  return 0;
30
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.