URL
https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 149 |
Rev 154 |
/* { dg-do run } */
|
/* { dg-do run } */
|
|
|
/* Regression test for stringizing and token pasting.
|
/* Regression test for stringizing and token pasting.
|
We got internal escape markers in the strings. */
|
We got internal escape markers in the strings. */
|
|
|
#include <string.h>
|
#include <string.h>
|
#include <stdlib.h>
|
#include <stdlib.h>
|
|
|
#define S(x) _S(x)
|
#define S(x) _S(x)
|
#define _S(x) #x
|
#define _S(x) #x
|
|
|
#define I 1
|
#define I 1
|
static const char s1[] = S(I.1);
|
static const char s1[] = S(I.1);
|
static const char t1[] = "1.1";
|
static const char t1[] = "1.1";
|
|
|
#define f h
|
#define f h
|
#define h(a) a+f
|
#define h(a) a+f
|
static const char s2[] = S( f(1)(2) );
|
static const char s2[] = S( f(1)(2) );
|
static const char t2[] = "1+h(2)";
|
static const char t2[] = "1+h(2)";
|
|
|
#undef I
|
#undef I
|
#undef f
|
#undef f
|
#undef h
|
#undef h
|
|
|
int
|
int
|
main(void)
|
main(void)
|
{
|
{
|
if (strcmp (s1, t1))
|
if (strcmp (s1, t1))
|
abort ();
|
abort ();
|
|
|
if (strcmp (s2, t2))
|
if (strcmp (s2, t2))
|
abort ();
|
abort ();
|
|
|
return 0;
|
return 0;
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.