1 /* Verify straight-line strength reduction for simple integer addition
2 with stride reversed. */
3
4 /* { dg-do compile } */
5 /* { dg-options "-O3 -fdump-tree-optimized" } */
6
7 int
f(int s,int c)8 f (int s, int c)
9 {
10 int a1, a2, a3, x1, x2, x3, x;
11
12 a1 = 2 * s;
13 x1 = a1 + c;
14 a2 = 4 * s;
15 x2 = a2 + c;
16 a3 = 6 * s;
17 x3 = a3 + c;
18 x = x1 + x2 + x3;
19 return x;
20 }
21
22 /* { dg-final { scan-tree-dump-times " \\* " 1 "optimized" } } */
23 /* { dg-final { cleanup-tree-dump "optimized" } } */
24