aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/guality/pr54519-2.c
blob: 4ee3c9e2f84acf940ceebd1c2e2b682bdae65c53 (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
/* 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;
}

__attribute__((noinline, noclone)) int
fn3 (int x, int y)
{
  return fn2 (x, y) + y;
}

__attribute__((noinline, noclone)) int
fn4 (int x, int y)
{
  return fn2 (x, y) + y;
}

int
main ()
{
  fn3 (6, 25);
  fn4 (4, 117);
  return 0;
}