| 1 |
/* PR tree-optimization/81588 */ |
| 2 |
|
| 3 |
__attribute__((noinline, noclone)) int |
| 4 |
bar (int x) |
| 5 |
{ |
| 6 |
__asm volatile ("" : : "g" (x) : "memory"); |
| 7 |
} |
| 8 |
|
| 9 |
__attribute__((noinline, noclone)) int |
| 10 |
foo (unsigned x, long long y) |
| 11 |
{ |
| 12 |
if (y < 0) |
| 13 |
return 0; |
| 14 |
if (y < (long long) (4 * x)) |
| 15 |
{ |
| 16 |
bar (y); |
| 17 |
return 1; |
| 18 |
} |
| 19 |
return 0; |
| 20 |
} |
| 21 |
|
| 22 |
int |
| 23 |
main () |
| 24 |
{ |
| 25 |
volatile unsigned x = 10; |
| 26 |
volatile long long y = -10000; |
| 27 |
if (foo (x, y) != 0) |
| 28 |
__builtin_abort (); |
| 29 |
y = -1; |
| 30 |
if (foo (x, y) != 0) |
| 31 |
__builtin_abort (); |
| 32 |
y = 0; |
| 33 |
if (foo (x, y) != 1) |
| 34 |
__builtin_abort (); |
| 35 |
y = 39; |
| 36 |
if (foo (x, y) != 1) |
| 37 |
__builtin_abort (); |
| 38 |
y = 40; |
| 39 |
if (foo (x, y) != 0) |
| 40 |
__builtin_abort (); |
| 41 |
y = 10000; |
| 42 |
if (foo (x, y) != 0) |
| 43 |
__builtin_abort (); |
| 44 |
return 0; |
| 45 |
} |