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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [cpp/] [mac-dir-1.c] - Blame information for rev 801

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

Line No. Rev Author Line
1 689 jeremybenn
/* Copyright (C) 2002 Free Software Foundation, Inc.  */
2
 
3
/* { dg-do preprocess } */
4
 
5
/* Source: Neil Booth, 26 Feb 2002.
6
 
7
   Test that we allow directives in macro arguments.  */
8
 
9
/* { dg-do run } */
10
/* { dg-options "" } */
11
 
12
#define f(x) x
13
extern void abort (void);
14
 
15
int main ()
16
{
17
  if (f (
18
#if f(1)                        /* True.  */
19
        0))                      /* False. */
20
#else
21
        1))
22
#endif
23
     abort ();
24
 
25
     /* Outer f expands to original definition, f in argument expands
26
        to new definition, so result is: if (1 != 2 - 1).  */
27
     if (1 != f(2
28
#undef f
29
#define f - 1
30
     f))
31
     abort ();
32
 
33
     return 0;
34
}

powered by: WebSVN 2.1.0

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