aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/torture/pr42952.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/torture/pr42952.c')
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr42952.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/torture/pr42952.c b/gcc/testsuite/gcc.dg/torture/pr42952.c
new file mode 100644
index 00000000000..db8782af3b9
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr42952.c
@@ -0,0 +1,19 @@
+/* { dg-do run } */
+/* { dg-options "-fno-tree-ccp -fno-tree-fre" } */
+
+extern void abort (void);
+
+static int g[1];
+
+static int * const p = &g[0];
+static int * const q = &g[0];
+
+int main(void)
+{
+ g[0] = 1;
+ *p = 0;
+ *p = *q;
+ if (g[0] != 0)
+ abort ();
+ return 0;
+}