OSDN Git Service

2008-10-21 Richard Guenther <rguenther@suse.de>
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 21 Oct 2008 12:15:55 +0000 (12:15 +0000)
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 21 Oct 2008 12:15:55 +0000 (12:15 +0000)
* gcc.dg/tree-ssa/alias-19.c: New testcase.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@141261 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/tree-ssa/alias-19.c [new file with mode: 0644]

index 3075046..e65e725 100644 (file)
@@ -1,3 +1,7 @@
+2008-10-21  Richard Guenther  <rguenther@suse.de>
+
+       * gcc.dg/tree-ssa/alias-19.c: New testcase.
+
 2008-10-20  Manuel López-Ibáñez  <manu@gcc.gnu.org>
         
        PR 12603
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/alias-19.c b/gcc/testsuite/gcc.dg/tree-ssa/alias-19.c
new file mode 100644 (file)
index 0000000..b92df43
--- /dev/null
@@ -0,0 +1,31 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -fdump-tree-alias-vops" } */
+
+const static int a;
+
+int __attribute__((noinline))
+foo(int i)
+{
+  const int *q;
+  int b;
+  if (i)
+    q = &a;
+  else
+    q = &b;
+  b = 1;
+  /* We should not prune a from the points-to set of q.  */
+  return *q;
+}
+
+extern void abort (void);
+int main()
+{
+  if (foo(1) != 0)
+    abort ();
+  return 0;
+}
+
+/* { dg-final { scan-tree-dump "q_. = { a b }" "alias" } } */
+/* { dg-final { scan-tree-dump "q_., name memory tag: NMT..., is dereferenced, points-to vars: { a b }" "alias" } } */
+/* { dg-final { scan-tree-dump "# VUSE <a_.\\\(D\\\), b_.>" "alias" } } */
+/* { dg-final { cleanup-tree-dump "alias" } } */