No empty .Rs/.Re
[netbsd-mini2440.git] / gnu / dist / gcc4 / gcc / testsuite / gcc.dg / tree-ssa / loop-3.c
blobc71791480c65bf0bc4235310d93ec2581519e861
1 /* A test for strength reduction and induction variable elimination.
2 Target is restricted to x86 type architectures, so that we may
3 assume something about memory addressing modes. */
5 /* { dg-do compile { target i?86-*-* x86_64-*-* } } */
6 /* { dg-skip-if "" { i?86-*-* x86_64-*-* } { "-fpic" "-fPIC" } { "" } } */
7 /* { dg-options "-O1 -fno-pic -fno-PIC -fdump-tree-vars" } */
9 int arr_base[100];
11 int foo(int);
13 void xxx(void)
15 long iter;
17 for (iter = 0; iter < 100; iter++)
18 arr_base[iter] = foo (iter);
21 /* Access to arr_base[iter].y should not be strength reduced, since
22 we have a memory mode including multiplication by 4. */
24 /* { dg-final { scan-tree-dump-times "MEM" 1 "vars" } } */
25 /* { dg-final { scan-tree-dump-times "step:" 1 "vars" } } */
27 /* And original induction variable should be preserved. */
29 /* { dg-final { scan-tree-dump-times "int iter" 1 "vars" } } */
31 /* { dg-final { cleanup-tree-dump "vars" } } */