blob: d2765d148c2ff4146d49ca729d0b87f006281792 (
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
|
/* PR debug/54519 */
/* { dg-do run } */
/* { dg-options "-g" } */
__attribute__((noinline, noclone)) void
fn1 (int x)
{
__asm volatile ("" : "+r" (x) : : "memory");
}
static int
fn2 (int x, int y)
{
if (y)
{
fn1 (x); /* { dg-final { gdb-test 17 "x" "6" } } */
fn1 (x); /* { dg-final { gdb-test 17 "y" "25" } } */
fn1 (x);
fn1 (x);
y = -2 + x;
y = y * y * y + y;
fn1 (x + y); /* { dg-final { gdb-test 22 "y" "68" } } */
}
return x;
}
int (*p) (int, int) = fn2;
int
main ()
{
__asm volatile ("" : : : "memory");
int (*q) (int, int) = p;
__asm volatile ("" : : : "memory");
q (6, 25);
q (4, 117);
q (0, 0);
return 0;
}
|