| 1 |
/* { dg-do run } */ |
| 2 |
/* { dg-options "-g" } */ |
| 3 |
|
| 4 |
void __attribute__((noinline)) |
| 5 |
optimize_me_not () |
| 6 |
{ |
| 7 |
__asm__ volatile ("" : : : "memory"); |
| 8 |
} |
| 9 |
char c, d = 22, f; |
| 10 |
short e, g; |
| 11 |
int h; |
| 12 |
char(a)() {} |
| 13 |
char(b)() { return 0; } |
| 14 |
void i() { |
| 15 |
char j; |
| 16 |
for (; h < 1;) { |
| 17 |
short k[9] = {1, 1, 1, 1, 1, 1, 1, 1, 1}; |
| 18 |
int l, i = 5; |
| 19 |
short m[3] = {0, 0, 0}; |
| 20 |
for (; h < 7; h++) |
| 21 |
for (; d >= 33;) { |
| 22 |
++k[8]; |
| 23 |
f = (c || a()) && g; |
| 24 |
} |
| 25 |
i++; |
| 26 |
j = b() || m[2]; |
| 27 |
l = 0; |
| 28 |
for (; l <= 6; l = d) |
| 29 |
e = k[8]; |
| 30 |
/* i may very well be optimized out, so we cannot test for i == 6. |
| 31 |
Instead test i + 1 which will make the test UNSUPPORTED if i |
| 32 |
is optimized out. Since the test previously had wrong debug |
| 33 |
with i == 5 this is acceptable. Optimally we'd produce a |
| 34 |
debug stmt for the final value of the loop which would fix |
| 35 |
the UNSUPPORTED cases. */ |
| 36 |
optimize_me_not(); /* { dg-final { gdb-test . "i + 1" "7" } } */ |
| 37 |
} |
| 38 |
} |
| 39 |
int main() { i(); } |