aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/expr/for8.C
blob: bb41f0c72bb985875052bb59a273b2938a43608c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// PR c++/86769
// { dg-do run }
// { dg-options "-O1" }

__attribute__((noipa)) void
foo (int)
{
  static int a = 0;
  if (++a == 3)
    __builtin_abort ();
}

int
main ()
{
  volatile int x = 10;
  for (int l = 1; int d = x - l; l = d + 1)
    {
      int &z = d;
      foo (z);
    }
}