Imported Upstream version 4.8.1
[platform/upstream/gcc48.git] / gcc / testsuite / gcc.dg / guality / pr54519-4.c
1 /* PR debug/54519 */
2 /* { dg-do run } */
3 /* { dg-options "-g" } */
4
5 __attribute__((noinline, noclone)) void
6 fn1 (int x)
7 {
8   __asm volatile ("" : "+r" (x) : : "memory");
9 }
10
11 static int
12 fn2 (int x, int y)
13 {
14   if (y)
15     {
16       fn1 (x);          /* { dg-final { gdb-test 17 "x" "6" } } */
17       fn1 (x);          /* { dg-final { gdb-test 17 "y" "25" } } */
18       fn1 (x);
19       fn1 (x);
20       y = -2 + x;
21       y = y * y * y + y;
22       fn1 (x + y);      /* { dg-final { gdb-test 22 "y" "68" } } */
23     }
24   return x;
25 }
26
27 int (*p) (int, int) = fn2;
28
29 int
30 main ()
31 {
32   __asm volatile ("" : : : "memory");
33   int (*q) (int, int) = p;
34   __asm volatile ("" : : : "memory");
35   q (6, 25);
36   q (4, 117);
37   q (0, 0);
38   return 0;
39 }