| 1 |
/* { dg-do run } */ |
| 2 |
|
| 3 |
__attribute__((noinline, noclone)) void |
| 4 |
bar (int *b) |
| 5 |
{ |
| 6 |
b[0] = b[1] = b[2] = 1; |
| 7 |
} |
| 8 |
|
| 9 |
__attribute__((noinline, noclone)) int |
| 10 |
baz (int x) |
| 11 |
{ |
| 12 |
if (x != 1) |
| 13 |
__builtin_abort (); |
| 14 |
} |
| 15 |
|
| 16 |
void |
| 17 |
foo (int x) |
| 18 |
{ |
| 19 |
if (x == 0) |
| 20 |
{ |
| 21 |
int *b = __builtin_malloc (3 * sizeof (int)); |
| 22 |
while (b[0]) |
| 23 |
; |
| 24 |
} |
| 25 |
else if (x == 1) |
| 26 |
{ |
| 27 |
int i, j; |
| 28 |
int *b = __builtin_malloc (3 * sizeof (int)); |
| 29 |
for (i = 0; i < 2; i++) |
| 30 |
{ |
| 31 |
bar (b); |
| 32 |
for (j = 0; j < 3; ++j) |
| 33 |
baz (b[j]); |
| 34 |
baz (b[0]); |
| 35 |
} |
| 36 |
} |
| 37 |
} |
| 38 |
|
| 39 |
int |
| 40 |
main () |
| 41 |
{ |
| 42 |
int x = 1; |
| 43 |
asm volatile ("" : "+r" (x)); |
| 44 |
foo (x); |
| 45 |
return 0; |
| 46 |
} |