gcc/testsuite/g++.dg/torture/pr108166.C
raw| 1 | // PR tree-optimization/108166 |
| 2 | // { dg-do run } |
| 3 | |
| 4 | bool a, b; |
| 5 | int d, c; |
| 6 | |
| 7 | const int & |
| 8 | foo (const int &f, const int &g) |
| 9 | { |
| 10 | return !f ? f : g; |
| 11 | } |
| 12 | |
| 13 | __attribute__((noipa)) void |
| 14 | bar (int) |
| 15 | { |
| 16 | } |
| 17 | |
| 18 | int |
| 19 | main () |
| 20 | { |
| 21 | c = foo (b, 0) > ((b ? d : b) ?: 8); |
| 22 | a = b ? d : b; |
| 23 | bar (a); |
| 24 | if (a != 0) |
| 25 | __builtin_abort (); |
| 26 | } |