summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/gcov/gcov-6.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/gcov/gcov-6.C')
-rw-r--r--gcc/testsuite/g++.dg/gcov/gcov-6.C29
1 files changed, 29 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/gcov/gcov-6.C b/gcc/testsuite/g++.dg/gcov/gcov-6.C
new file mode 100644
index 000000000..53a2b20bf
--- /dev/null
+++ b/gcc/testsuite/g++.dg/gcov/gcov-6.C
@@ -0,0 +1,29 @@
+// PR gcov-profile/34609
+// { dg-do compile }
+// { dg-options "-O -ftest-coverage" }
+
+struct A
+{
+ int i;
+ int &get () { return i; }
+};
+
+inline A foo ()
+{
+ A a;
+ a.get ();
+ return a;
+}
+
+inline A bar ()
+{
+ return foo ();
+}
+
+void baz ()
+{
+ A a;
+ a = bar ();
+}
+
+// { dg-final { cleanup-coverage-files } }