aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/c-c++-common/restrict-4.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/c-c++-common/restrict-4.c')
-rw-r--r--gcc-4.9/gcc/testsuite/c-c++-common/restrict-4.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/c-c++-common/restrict-4.c b/gcc-4.9/gcc/testsuite/c-c++-common/restrict-4.c
new file mode 100644
index 000000000..3a36def25
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/c-c++-common/restrict-4.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-lim1-details" } */
+
+struct Foo
+{
+ int n;
+ int * __restrict__ p;
+};
+void bar(struct Foo f, int * __restrict__ q)
+{
+ int i;
+ for (i = 0; i < f.n; ++i)
+ {
+ *q += f.p[i];
+ }
+}
+
+/* { dg-final { scan-tree-dump "Executing store motion" "lim1" } } */
+/* { dg-final { cleanup-tree-dump "lim1" } } */