summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.other/array6.C
blob: 1ffc42a59d1ecd864896f5d3d67c839b2ec23fa2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// { dg-do run  }
// { dg-options "-O1" }

int count = 0;

double foo () {
  count++;
  return 0;
}

double bar () {
  const double x[1] = { foo() };
  return x[0];
}

int main () 
{
  bar();
  if (count != 1)
    return 1;
}