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