gcc/testsuite/g++.dg/expr/for8.C
raw| 1 | // PR c++/86769 |
| 2 | // { dg-do run } |
| 3 | // { dg-options "-O1" } |
| 4 | |
| 5 | __attribute__((noipa)) void |
| 6 | foo (int) |
| 7 | { |
| 8 | static int a = 0; |
| 9 | if (++a == 3) |
| 10 | __builtin_abort (); |
| 11 | } |
| 12 | |
| 13 | int |
| 14 | main () |
| 15 | { |
| 16 | volatile int x = 10; |
| 17 | for (int l = 1; int d = x - l; l = d + 1) |
| 18 | { |
| 19 | int &z = d; |
| 20 | foo (z); |
| 21 | } |
| 22 | } |