aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/torture/pr69951.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/torture/pr69951.c')
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr69951.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/torture/pr69951.c b/gcc/testsuite/gcc.dg/torture/pr69951.c
new file mode 100644
index 00000000000..cb46fefccdb
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr69951.c
@@ -0,0 +1,21 @@
+/* { dg-do run } */
+/* { dg-require-alias "" } */
+
+extern void abort (void);
+
+int a = 1, c = 1;
+extern int b __attribute__((alias("a")));
+extern int d __attribute__((alias("c")));
+int main(int argc)
+{
+ int *p, *q;
+ if (argc)
+ p = &c, q = &d;
+ else
+ p = &b, q = &d;
+ *p = 1;
+ *q = 2;
+ if (*p == 1)
+ abort();
+ return 0;
+}