aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/restrict-4.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/tree-ssa/restrict-4.c')
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/restrict-4.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/restrict-4.c b/gcc/testsuite/gcc.dg/tree-ssa/restrict-4.c
new file mode 100644
index 0000000..a307c89
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/restrict-4.c
@@ -0,0 +1,26 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+int
+foo (int *x, int y)
+{
+ int *__restrict p1 = x;
+ int *__restrict p2 = x + 32;
+ p1[y] = 1;
+ p2[4] = 2;
+ return p1[y];
+}
+
+int
+bar (int *x, int y)
+{
+ int *__restrict p1 = x;
+ int *p3 = x + 32;
+ int *__restrict p2 = p3;
+ p1[y] = 1;
+ p2[4] = 2;
+ return p1[y];
+}
+
+/* { dg-final { scan-tree-dump-times "return 1;" 2 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */