summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.c-torture/compile/pr30338.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.c-torture/compile/pr30338.c')
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr30338.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr30338.c b/gcc/testsuite/gcc.c-torture/compile/pr30338.c
new file mode 100644
index 000000000..2d6245d01
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr30338.c
@@ -0,0 +1,14 @@
+/* We used to do folding with mismatched types which caused us to
+ infinitely loop in comparison foldings. */
+
+extern char *grub_scratch_mem;
+int testload_func (char *arg, int flags)
+{
+ int i;
+ for (i = 0; i < 0x10ac0; i++)
+ if (*((unsigned char *) ((0x200000 + i + (int) grub_scratch_mem)))
+ != *((unsigned char *) ((0x300000 + i + (int) grub_scratch_mem))))
+ return 0;
+ return 1;
+}
+