gcc/testsuite/gcc.target/sh/torture/pr63783-1.c
raw| 1 | /* { dg-do run } */ |
| 2 | /* { dg-additional-options "-std=c99" } */ |
| 3 | |
| 4 | #include <assert.h> |
| 5 | |
| 6 | int decision_result; |
| 7 | int val; |
| 8 | int truecount = 0; |
| 9 | |
| 10 | static void __attribute__((noinline)) |
| 11 | buggy (int flag) |
| 12 | { |
| 13 | int condition; |
| 14 | if(flag == 0) |
| 15 | condition = val != 0; |
| 16 | else |
| 17 | condition = !decision_result; |
| 18 | if (condition) |
| 19 | truecount++; |
| 20 | } |
| 21 | |
| 22 | int |
| 23 | main (void) |
| 24 | { |
| 25 | decision_result = 1; |
| 26 | buggy(1); |
| 27 | assert (truecount == 0); |
| 28 | return 0; |
| 29 | } |