OSDN Git Service

gcc/testsuite
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / cpp / if-unary.c
1 /* Copyright (C) 2000 Free Software Foundation, Inc.  */
2
3 /* { dg-do preprocess } */
4
5 /* Test the various unary operators.  */
6
7 #if 1 + + + 1   /* allow multiple unary sign operators :) */
8 #endif
9
10 #if 8 - +3 != +4 + +1
11 #error          /* { dg-bogus "error" "unary +" } */
12 #endif
13
14 #if -2 - -1 != -1
15 #error          /* { dg-bogus "error" "unary -" } */
16 #endif
17
18 #if ~0 != -1
19 #error          /* { dg-bogus "error" "unary ~" } */
20 #endif
21
22 #if !0 && (!1 == 0) && !!1 != 1
23 #error          /* { dg-bogus "error" "unary !" } */
24 #endif
25
26 #if ~~8 != 8
27 #error          /* { dg-bogus "error" "double unary ~" } */
28 #endif
29
30 #if 5 + +!-4 != 5
31 #error          /* { dg-bogus "error" "compound unary +, !, -" } */
32 #endif