summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/debug/pr46338.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/debug/pr46338.C')
-rw-r--r--gcc/testsuite/g++.dg/debug/pr46338.C24
1 files changed, 24 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/debug/pr46338.C b/gcc/testsuite/g++.dg/debug/pr46338.C
new file mode 100644
index 000000000..dfa92452d
--- /dev/null
+++ b/gcc/testsuite/g++.dg/debug/pr46338.C
@@ -0,0 +1,24 @@
+// PR debug/46338
+// { dg-do compile }
+// { dg-options "-O -fprofile-generate -fcompare-debug" }
+
+void bar ();
+
+struct S
+{
+ int f ()
+ {
+ }
+};
+
+S *s;
+
+void
+foo (int x)
+{
+ if (x)
+ return;
+ bar ();
+ for (int j = 0; j < s->f (); j++)
+ ;
+}