2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / gcc.dg / cpp / if-sc.c
blob1607669f0b889c8b0375c85fa74fe94a0376f2be
1 /* Copyright (C) 2000 Free Software Foundation, Inc. */
3 /* { dg-do preprocess } */
5 /* Test that all operators correctly short circuit. */
7 #if (2 || 3 / 0) != 1
8 #error /* { dg-bogus "error" "|| short circuit" } */
9 #endif
11 #if 0 && 3 / 0
12 #error /* { dg-bogus "error" "&& short circuit" } */
13 #endif
15 #if 1 ? 0 : 3 / 0
16 #error /* { dg-bogus "error" "? : right short circuit" } */
17 #endif
19 #if 0 ? 3 / 0 : 2
20 #else
21 #error /* { dg-bogus "error" "? : left short circuit" } */
22 #endif
24 #if -1 ? 0 && 3 / 0 : 3 / 0 + 5 == 5
25 #error /* { dg-bogus "error" "nested short circuiting" } */
26 #endif