PR testsuite/52641
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / slsr-10.c
blobf131dae3b48fc5ce335a2e875d23d84f6c26ba27
1 /* Verify straight-line strength reduction for simple integer addition
2 with stride reversed on 1st and 3rd instances. */
4 /* { dg-do compile } */
5 /* { dg-options "-O3 -fdump-tree-optimized" } */
7 int
8 f (int s, int c)
10 int a1, a2, a3, x1, x2, x3, x;
12 a1 = 2 * s;
13 x1 = a1 + c;
14 a2 = 4 * s;
15 x2 = c + a2;
16 a3 = 6 * s;
17 x3 = a3 + c;
18 x = x1 + x2 + x3;
19 return x;
22 /* { dg-final { scan-tree-dump-times " \\* " 1 "optimized" } } */
23 /* { dg-final { cleanup-tree-dump "optimized" } } */