aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr49518.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.dg/torture/pr49518.c')
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/torture/pr49518.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr49518.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr49518.c
new file mode 100644
index 000000000..55761fd61
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr49518.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-Wno-aggressive-loop-optimizations" } */
+
+int a, b;
+struct S { unsigned int s, t, u; } c, d = { 0, 1, 0 };
+
+void
+test (unsigned char z)
+{
+ char e[] = {0, 0, 0, 0, 1};
+ for (c.s = 1; c.s; c.s++)
+ {
+ b = e[c.s];
+ if (a)
+ break;
+ b = z >= c.u;
+ if (d.t)
+ break;
+ }
+}