Index: gcc/testsuite/gcc.target/arm/ivopts-2.c =================================================================== --- /dev/null (new file) +++ gcc/testsuite/gcc.target/arm/ivopts-2.c (revision 0) @@ -0,0 +1,18 @@ +/* { dg-do assemble } */ +/* { dg-options "-Os -mthumb -fdump-tree-ivopts -save-temps" } */ + +extern void foo2 (short*); + +void +tr4 (short array[], int n) +{ + int x; + if (n > 0) + for (x = 0; x < n; x++) + foo2 (&array[x]); +} + +/* { dg-final { scan-tree-dump-times "PHI 0) + for (x = 0; x < n; x++) + array[x] = 0; +} + +/* { dg-final { scan-tree-dump-times "PHI <" 1 "ivopts"} } */ +/* { dg-final { object-size text <= 20 { target arm_thumb2_ok } } } */ +/* { dg-final { cleanup-tree-dump "ivopts" } } */