aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.target/arm/ivopts-4.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.target/arm/ivopts-4.c')
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.target/arm/ivopts-4.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.target/arm/ivopts-4.c b/gcc-4.9/gcc/testsuite/gcc.target/arm/ivopts-4.c
new file mode 100644
index 000000000..0c476b874
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.target/arm/ivopts-4.c
@@ -0,0 +1,22 @@
+/* { dg-do assemble } */
+/* { dg-options "-Os -fdump-tree-ivopts -save-temps" } */
+
+extern unsigned int foo (int*) __attribute__((pure));
+
+unsigned int
+tr2 (int array[], int n)
+{
+ unsigned int sum = 0;
+ int x;
+ if (n > 0)
+ for (x = 0; x < n; x++)
+ sum += foo (&array[x]);
+ return sum;
+}
+
+/* { dg-final { scan-tree-dump-times "PHI <ivtmp" 1 "ivopts"} } */
+/* { dg-final { scan-tree-dump-times "PHI <x" 0 "ivopts"} } */
+/* { dg-final { scan-tree-dump-times ", x" 0 "ivopts"} } */
+/* { dg-final { object-size text <= 36 { target arm_thumb2 } } } */
+/* { dg-final { cleanup-tree-dump "ivopts" } } */
+/* { dg-final { cleanup-saved-temps "ivopts" } } */