summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/cpp/if-paren.c
blob: 407a302b20ed4e5eb1f2edd3ea7c7065502079e0 (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
31
/* Copyright (C) 2000 Free Software Foundation, Inc.  */

/* { dg-do preprocess } */

/* These now use "!=" rather than "<" to increase chance of failure.  */
#if 16 * (1) + 4 != 20
#error		/* { dg-bogus "error" "with paren" } */
#endif

#if 16 * 1 + 4 != 20
#error		/* { dg-bogus "error" "without paren" } */
#endif

#if ()	        /* { dg-error "expression between" "empty paren" } */
#endif

#if (1) == 1
#error		/* { dg-error "" "simple parens no. 1" } */
#endif

#if (2)
#error		/* { dg-error "" "simple parens no. 2" } */
#endif

#if 3 == (3)
#error		/* { dg-error "" "simple parens no. 3" } */
#endif

#if (((-1) + 8)) == ((+2) * ((3)) - -1)
#error		/* { dg-error "" "nested parentheses" } */
#endif