1 /* PR debug/54519 */
2 /* { dg-do run } */
3 /* { dg-options "-g" } */
4
5 __attribute__((noinline, noclone)) void
fn1(int x)6 fn1 (int x)
7 {
8 __asm volatile ("" : "+r" (x) : : "memory");
9 }
10
11 static int
fn2(int x,int y,int z)12 fn2 (int x, int y, int z)
13 {
14 int a = 8;
15 if (x != z)
16 {
17 fn1 (x);
18 fn1 (x); /* { dg-final { gdb-test 20 "x" "36" } } */
19 if (x == 36) /* { dg-final { gdb-test 20 "y" "25" } } */
20 fn1 (x); /* { dg-final { gdb-test 20 "z" "6" } } */
21 fn1 (x); /* { dg-final { gdb-test 23 "x" "98" } } */
22 if (x == 98) /* { dg-final { gdb-test 23 "y" "117" } } */
23 fn1 (x); /* { dg-final { gdb-test 23 "z" "8" } } */
24 fn1 (x);
25 fn1 (x + a);
26 }
27 return y;
28 }
29
30 int (*p) (int, int, int) = fn2;
31
32 int
main()33 main ()
34 {
35 __asm volatile ("" : : : "memory");
36 int (*q) (int, int, int) = p;
37 __asm volatile ("" : : : "memory");
38 q (36, 25, 6);
39 q (98, 117, 8);
40 q (0, 0, 0);
41 return 0;
42 }
43