Sync usage with man page.
[netbsd-mini2440.git] / gnu / dist / gcc4 / gcc / testsuite / gcc.dg / tree-ssa / loop-2.c
blob589de3630027651d42d22727328c7c93638e0431
1 /* A test for strength reduction and induction variable elimination. */
3 /* { dg-do compile } */
4 /* { dg-options "-O1 -fdump-tree-vars" } */
6 /* Size of this structure should be sufficiently weird so that no memory
7 addressing mode applies. */
9 struct bla
11 char x[187];
12 int y;
13 char z[253];
14 } arr_base[100];
16 void xxx(void)
18 int iter;
20 for (iter = 0; iter < 100; iter++)
21 arr_base[iter].y = 17 * iter;
24 /* Access to arr_base[iter].y should be strength reduced, i.e., there should
25 be no multiplication. */
27 /* { dg-final { scan-tree-dump-times " \\* \[^\\n\\r\]*=" 0 "vars" } } */
28 /* { dg-final { scan-tree-dump-times "\[^\\n\\r\]*= \\* " 0 "vars" } } */
29 /* { dg-final { scan-tree-dump-times "MEM" 1 "vars" } } */
31 /* 17 * iter should be strength reduced. */
33 /* { dg-final { scan-tree-dump-times " \\* 17" 0 "vars" } } */
34 /* { dg-final { scan-tree-dump-times " \\+ 17" 1 "vars" } } */
36 /* The induction variable comparison with 99 should be eliminated
37 and replaced by comparison of one of the newly created ivs. */
39 /* { dg-final { scan-tree-dump-times "iter" 0 "vars" } } */
40 /* { dg-final { scan-tree-dump-times "99" 0 "vars" } } */
41 /* { dg-final { scan-tree-dump-times "100" 0 "vars" } } */
43 /* { dg-final { cleanup-tree-dump "vars" } } */