New testcase
authorDaniel Berlin <dberlin@gcc.gnu.org>
Wed, 13 Jul 2005 14:24:59 +0000 (14:24 +0000)
committerDaniel Berlin <dberlin@gcc.gnu.org>
Wed, 13 Jul 2005 14:24:59 +0000 (14:24 +0000)
From-SVN: r101968

gcc/testsuite/gcc.c-torture/compile/pr22422.c [new file with mode: 0644]

diff --git a/gcc/testsuite/gcc.c-torture/compile/pr22422.c b/gcc/testsuite/gcc.c-torture/compile/pr22422.c
new file mode 100644 (file)
index 0000000..bc176f9
--- /dev/null
@@ -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;
+}
+