diff options
Diffstat (limited to 'gcc/testsuite/g++.dg/debug/pr47106.C')
-rw-r--r-- | gcc/testsuite/g++.dg/debug/pr47106.C | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/debug/pr47106.C b/gcc/testsuite/g++.dg/debug/pr47106.C new file mode 100644 index 000000000..3a8100f8c --- /dev/null +++ b/gcc/testsuite/g++.dg/debug/pr47106.C @@ -0,0 +1,38 @@ +// { dg-do compile } +// { dg-options "-O -fpartial-inlining -flto -fconserve-stack -fcompare-debug" } +// { dg-require-effective-target lto } + +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)); +} + +inline bool +bar (S s1, S s2, S) +{ + baz (s1, s2); +} + +S getS (); + +bool +foo () +{ + bar (getS (), getS (), getS ()); +} |