aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.c-torture/compile/pr22422.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.c-torture/compile/pr22422.c')
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.c-torture/compile/pr22422.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.c-torture/compile/pr22422.c b/gcc-4.9/gcc/testsuite/gcc.c-torture/compile/pr22422.c
new file mode 100644
index 000000000..bc176f969
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.c-torture/compile/pr22422.c
@@ -0,0 +1,30 @@
+/* We should not crash trying to figure out the points-to sets for the below. We used to because we
+ ended up adding pointers to the points-to set of the ANYTHING variable. */
+struct D
+{
+ int n;
+ int c [8];
+};
+
+struct A
+{
+ int i;
+ char *p;
+};
+
+struct B
+{
+ struct A *a;
+ struct D *d;
+};
+
+int dtInsert1 (struct B *b)
+{
+ struct A a = { 0, 0 };
+ struct D *d;
+ b->a = &a;
+ d = b->d;
+ &d->c [d->n];
+ return 0;
+}
+