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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.dg/] [cpp/] [strp2.c] - Blame information for rev 867

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
/* { dg-do run } */
2
 
3
/* Test for odd corner cases in stringizing/pasting.
4
   Taken more or less verbatim from C99 section 6.10.3.3.  */
5
 
6
#include <stdlib.h>
7
#include <string.h>
8
 
9
#define hash_hash # ## #
10
#define mkstr(a) # a
11
#define in_between(a) mkstr(a)
12
#define join(c, d) in_between(c hash_hash d)
13
 
14
const char p[] = join(x, y);
15
const char q[] = "x ## y";
16
 
17
int
18
main (void)
19
{
20
  if (strcmp (p, q))
21
    abort ();
22
  return 0;
23
}

powered by: WebSVN 2.1.0

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