aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.8/gcc/testsuite/gcc.dg/torture/pr57488.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.8/gcc/testsuite/gcc.dg/torture/pr57488.c')
-rw-r--r--gcc-4.8/gcc/testsuite/gcc.dg/torture/pr57488.c58
1 files changed, 58 insertions, 0 deletions
diff --git a/gcc-4.8/gcc/testsuite/gcc.dg/torture/pr57488.c b/gcc-4.8/gcc/testsuite/gcc.dg/torture/pr57488.c
new file mode 100644
index 000000000..7eda36476
--- /dev/null
+++ b/gcc-4.8/gcc/testsuite/gcc.dg/torture/pr57488.c
@@ -0,0 +1,58 @@
+/* { dg-do run } */
+
+extern void abort (void);
+
+int i, j, *pj = &j, **ppj = &pj;
+int x, *px = &x;
+
+short s, *ps = &s, k;
+
+unsigned short u, *pu = &u, **ppu = &pu;
+
+char c, *pc = &c;
+
+unsigned char v = 48;
+
+static int
+bar (int p)
+{
+ p = k;
+ *px = **ppu = i;
+ *ppj = &p;
+ if (**ppj)
+ *pj = p;
+ return p;
+}
+
+void __attribute__((noinline))
+foo ()
+{
+ for (; i <= 3; i++)
+ for (; j; j--);
+
+ u ^= bar (*pj);
+
+ for (k = 1; k >= 0; k--)
+ {
+ int l;
+ bar (0);
+ for (l = 1; l < 5; l++)
+ {
+ int m;
+ for (m = 6; m; m--)
+ {
+ v--;
+ *ps = *pc;
+ }
+ }
+ }
+}
+
+int
+main ()
+{
+ foo ();
+ if (v != 0)
+ abort ();
+ return 0;
+}