summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr45105.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/pr45105.c')
-rw-r--r--gcc/testsuite/gcc.dg/pr45105.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/pr45105.c b/gcc/testsuite/gcc.dg/pr45105.c
new file mode 100644
index 00000000000..a93a21f9ee5
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr45105.c
@@ -0,0 +1,27 @@
+/* PR debug/45105 */
+/* { dg-do compile } */
+/* { dg-options "-Os -fcompare-debug" } */
+
+extern int *baz (int *, int *);
+
+void
+bar (int *p1, int *p2)
+{
+ int n = *baz (0, 0);
+ p1[n] = p2[n];
+}
+
+void
+foo (int *p, int l)
+{
+ int a1[32];
+ int a2[32];
+ baz (a1, a2);
+ while (l)
+ {
+ if (l & 1)
+ p = baz (a2, p);
+ l--;
+ bar (a1, a2);
+ }
+}