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; }