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 } */
|
|
|
/* Test that, when a macro expansion spills into the source file, we
|
/* Test that, when a macro expansion spills into the source file, we
|
expand macros we suck in from there, as the standard clearly states
|
expand macros we suck in from there, as the standard clearly states
|
they are not nested.
|
they are not nested.
|
|
|
Submitter: Neil Booth, with minor modifications to the originals. 3
|
Submitter: Neil Booth, with minor modifications to the originals. 3
|
Dec 2000.
|
Dec 2000.
|
Source: PR 962 and Thomas Pornin. */
|
Source: PR 962 and Thomas Pornin. */
|
|
|
extern void abort (void);
|
extern void abort (void);
|
int e = 10, f = 100;
|
int e = 10, f = 100;
|
|
|
#define e(n) 4 + n
|
#define e(n) 4 + n
|
#define X e
|
#define X e
|
#define f(x) x
|
#define f(x) x
|
#define h(x) x + f
|
#define h(x) x + f
|
|
|
int
|
int
|
main ()
|
main ()
|
{
|
{
|
if (X(X) != 14) /* Should expand to "4 + e". */
|
if (X(X) != 14) /* Should expand to "4 + e". */
|
abort ();
|
abort ();
|
|
|
if (X(X(f)) != 108) /* Should expand to "4 + 4 + f". */
|
if (X(X(f)) != 108) /* Should expand to "4 + 4 + f". */
|
abort ();
|
abort ();
|
|
|
if (h(e)(h(e)) != 120) /* Should expand to "e + e + f". */
|
if (h(e)(h(e)) != 120) /* Should expand to "e + e + f". */
|
abort ();
|
abort ();
|
|
|
return 0;
|
return 0;
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.