aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/alias-1.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/tree-ssa/alias-1.c')
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/alias-1.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/alias-1.c b/gcc/testsuite/gcc.dg/tree-ssa/alias-1.c
new file mode 100644
index 00000000000..6e88eb1ce23
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/alias-1.c
@@ -0,0 +1,17 @@
+/* { dg-options "-O2 -fargument-noalias-global -fdump-tree-optimized" } */
+int f;
+void link_error ();
+
+void g(int *i)
+{
+ *i = 0;
+ f = 1;
+ if (*i != 0)
+ link_error ();
+}
+
+
+/* We should have removed the link_error on the tree level as we told GCC
+ that *i cannot point to f via the option -fargument-noalias-global. */
+/* { dg-final { scan-tree-dump-times "link_error" 0 "optimized"} } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */