| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O2 -fdisable-tree-ethread" } */ |
| 3 |
|
| 4 |
/* Note: Threader will collapse loop. */ |
| 5 |
|
| 6 |
typedef int int32_t __attribute__((mode (__SI__))); |
| 7 |
|
| 8 |
void bar (int32_t); |
| 9 |
|
| 10 |
void |
| 11 |
foo () |
| 12 |
{ |
| 13 |
int32_t index = 0; |
| 14 |
|
| 15 |
for (index; index <= 10; index--) // expected warning here |
| 16 |
/* Result of the following multiply will overflow |
| 17 |
when converted to signed int32_t. */ |
| 18 |
bar ((0xcafe + index) * 0xdead); /* { dg-warning "iteration \[0-9\]+ invokes undefined behavior" } */ |
| 19 |
} |