summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/debug/pr47106.C
blob: 84c6e3f87be49d113e9c7a3f2748db14970960ca (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
// { dg-do compile }
// { dg-options "-O -fpartial-inlining -flto -fconserve-stack -fcompare-debug" }
// { dg-require-effective-target lto }
// { dg-xfail-if "" { powerpc-ibm-aix* } }

void end (int, int) __attribute__ ((__noreturn__));

struct S
{
  int i;
  S *s;
};

inline bool f (S *s)
{
  if (!s->s)
    end (0, 0);
  return s->s == s;
}

inline bool
baz (S s1, S)
{
  while (f (&s1));

  return true;
}

inline bool
bar (S s1, S s2, S)
{
  return baz (s1, s2);
}

S getS ();

bool
foo ()
{
  return bar (getS (), getS (), getS ());
}