aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/cpp/defined-Wno-expansion-to-defined.c
blob: ddd015b75accaa2340c59758ea5801dfa5b08504 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/* Copyright (C) 2000 Free Software Foundation, Inc.  */

/* { dg-do preprocess } */
/* { dg-options "-ansi -pedantic-errors -Wno-expansion-to-defined" } */

/* Use of defined in different contexts.  */

/*  Source: Neil Booth, 29 Oct 2000, Zack Weinberg 11 Dec 2000.  */

#define Z

#define bad0 defined Z
#if !bad0                       /* { dg-bogus "may not be portable" } */
#error Z is defined
#endif

#define bad1 defined
#if !bad1 Z			/* { dg-bogus "may not be portable" } */
#error Z is defined
#endif 

#if !bad1 (Z)			/* { dg-bogus "may not be portable" } */
#error Z is defined
#endif 

#define bad2 defined (Z
#if !bad2)			/* { dg-bogus "may not be portable" } */
#error Z is defined
#endif