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

/* { dg-do preprocess } */

/* Test the various unary operators.  */

#if 1 + + + 1   /* allow multiple unary sign operators :) */
#endif

#if 8 - +3 != +4 + +1
#error		/* { dg-bogus "error" "unary +" } */
#endif

#if -2 - -1 != -1
#error		/* { dg-bogus "error" "unary -" } */
#endif

#if ~0 != -1
#error		/* { dg-bogus "error" "unary ~" } */
#endif

#if !0 && (!1 == 0) && !!1 != 1
#error		/* { dg-bogus "error" "unary !" } */
#endif

#if ~~8 != 8
#error		/* { dg-bogus "error" "double unary ~" } */
#endif

#if 5 + +!-4 != 5
#error		/* { dg-bogus "error" "compound unary +, !, -" } */
#endif