summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/other/pr42685.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/other/pr42685.C')
-rw-r--r--gcc/testsuite/g++.dg/other/pr42685.C10
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/other/pr42685.C b/gcc/testsuite/g++.dg/other/pr42685.C
new file mode 100644
index 000000000..b8b1ad63b
--- /dev/null
+++ b/gcc/testsuite/g++.dg/other/pr42685.C
@@ -0,0 +1,10 @@
+// { dg-do compile }
+// { dg-options "-O -funroll-loops -fcompare-debug" }
+
+void Remap(int n, int *src, int *dst, int *map)
+{
+ do {
+ int i = *src;
+ if (i != 0) *dst = map[i];
+ } while (--n != 0);
+}