1 /* n_13_7.c: Short-circuit evaluation of #if expression. */ 2 3 /* 13.7: 10/0 or 10/MACRO_0 are never evaluated, "divide by zero" error 4 cannot occur. */ 5 #define MACRO_0 0 6 7 /* Valid block */ 8 #if 0 && 10 / 0 9 Block to be skipped 10 #endif 11 #if not_defined && 10 / not_defined 12 Block to be skipped 13 #endif 14 #if MACRO_0 && 10 / MACRO_0 > 1 15 Block to be skipped 16 #endif 17 #if MACRO_0 ? 10 / MACRO_0 : 0 18 Block to be skipped 19 #endif 20 #if MACRO_0 == 0 || 10 / MACRO_0 > 1 21 Valid block 22 #else 23 Block to be skipped 24 #endif 25 26 /* { dg-do preprocess } 27 { dg-options "-ansi -w" } 28 { dg-final { if ![file exist n_13_7.i] { return } } } 29 { dg-final { if \{ [grep n_13_7.i "Valid block"] != "" \} \{ } } 30 { dg-final { return \} } } 31 { dg-final { fail "n_13_7.c: short-circuit evaluation of #if expression" } } 32 */ 33 34