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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.dg/] [cpp/] [macro6.c] - Blame information for rev 328

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

Line No. Rev Author Line
1 298 jeremybenn
/* { dg-do run } */
2
 
3
/* Test that, when a macro expansion spills into the source file, we
4
   expand macros we suck in from there, as the standard clearly states
5
   they are not nested.
6
 
7
   Submitter: Neil Booth, with minor modifications to the originals. 3
8
   Dec 2000.
9
   Source: PR 962 and Thomas Pornin.  */
10
 
11
extern void abort (void);
12
int e = 10, f = 100;
13
 
14
#define e(n) 4 + n
15
#define X e
16
#define f(x) x
17
#define h(x) x + f
18
 
19
int
20
main ()
21
{
22
  if (X(X) != 14)               /* Should expand to "4 + e".  */
23
    abort ();
24
 
25
  if (X(X(f)) != 108)           /* Should expand to "4 + 4 + f".  */
26
    abort ();
27
 
28
  if (h(e)(h(e)) != 120)        /* Should expand to "e + e + f".  */
29
    abort ();
30
 
31
  return 0;
32
}

powered by: WebSVN 2.1.0

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