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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [cpp/] [strify3.c] - Blame information for rev 689

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 689 jeremybenn
/* Copyright (C) 2001 Free Software Foundation, Inc.  */
2
 
3
/* { dg-do run } */
4
 
5
/* Tests we stringify without inserting a space.  GCC 2.95.x and
6
   earlier would insert a bogus space before bar in the string, simply
7
   because a space was there in the invocation.
8
 
9
   Neil Booth, 24 Sep 2001.  */
10
 
11
extern int strcmp (const char *, const char *);
12
extern int puts (const char *);
13
extern void abort (void);
14
#define err(str) do { puts(str); abort(); } while (0)
15
 
16
#define str(x) #x
17
#define xstr(x) str(x)
18
#define glibc_hack(x, y) x@y
19
 
20
int main (int argc, char *argv[])
21
{
22
  /* The space before "bar" here is vital.  */
23
  char a[] = xstr(glibc_hack(foo, bar));
24
 
25
  if (strcmp (a, "foo@bar"))
26
    err ("stringification without spaces");
27
 
28
  return 0;
29
}

powered by: WebSVN 2.1.0

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