Imported Upstream version 4.8.1
[platform/upstream/gcc48.git] / gcc / testsuite / gcc.dg / guality / pr54519-5.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 __attribute__((noinline, noclone)) int
28 fn3 (int x, int y)
29 {
30   return fn2 (x, y);
31 }
32
33 __attribute__((noinline, noclone)) int
34 fn4 (int x, int y)
35 {
36   return fn2 (x, y);
37 }
38
39 int
40 main ()
41 {
42   fn3 (6, 25);
43   fn4 (4, 117);
44   return 0;
45 }