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

Subversion Repositories openrisc

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

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

Line No. Rev Author Line
1 689 jeremybenn
/* { dg-do run } */
2
 
3
/* Regression test for stringizing and token pasting.
4
   We got internal escape markers in the strings.  */
5
 
6
#include <string.h>
7
#include <stdlib.h>
8
 
9
#define S(x) _S(x)
10
#define _S(x) #x
11
 
12
#define I 1
13
static const char s1[] = S(I.1);
14
static const char t1[] = "1.1";
15
 
16
#define f h
17
#define h(a) a+f
18
static const char s2[] = S( f(1)(2) );
19
static const char t2[] = "1+h(2)";
20
 
21
#undef I
22
#undef f
23
#undef h
24
 
25
int
26
main(void)
27
{
28
  if (strcmp (s1, t1))
29
    abort ();
30
 
31
  if (strcmp (s2, t2))
32
    abort ();
33
 
34
  return 0;
35
}

powered by: WebSVN 2.1.0

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