gcc/testsuite/gcc.dg/pr103845.c
raw| 1 | /* { dg-do compile } */ |
| 2 | /* { dg-options "-O1 -fharden-compares -fno-ipa-pure-const" } */ |
| 3 | |
| 4 | int |
| 5 | baz (void); |
| 6 | |
| 7 | __attribute__ ((returns_twice)) void |
| 8 | bar (void) |
| 9 | { |
| 10 | } |
| 11 | |
| 12 | int |
| 13 | quux (int y, int z) |
| 14 | { |
| 15 | return (y || z >= 0) ? y : z; |
| 16 | } |
| 17 | |
| 18 | int |
| 19 | foo (int x) |
| 20 | { |
| 21 | int a = 0, b = x == a; |
| 22 | |
| 23 | bar (); |
| 24 | |
| 25 | if (!!baz () < quux (b, a)) |
| 26 | ++x; |
| 27 | |
| 28 | return x; |
| 29 | } |