summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/torture/pr45869.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/torture/pr45869.c')
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr45869.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/torture/pr45869.c b/gcc/testsuite/gcc.dg/torture/pr45869.c
new file mode 100644
index 000000000..e01977bf9
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr45869.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+
+char *
+foo (unsigned int count, void **list)
+{
+ char *minaddr = (char *) list[0];
+ unsigned int i; /* NOTE: change of type to "int" eliminates the ICE */
+ for (i = 1; i < count; i++)
+ {
+ char *addr = (char *) list[i];
+ if (addr < minaddr)
+ minaddr = addr;
+ }
+ return minaddr;
+}