1 /* { dg-do compile } */
2 /* { dg-options "-O3 -fdump-tree-slsr -fdump-tree-optimized" } */
3 
4 void foo (int);
5 
6 int
f(int i)7 f (int i)
8 {
9   int x, y;
10 
11   x = i * 4;
12   y = x * 10;
13   foo (y);
14 
15   i = i + 5;
16   x = i * 4;
17   y = x * 10;
18   foo (y);
19 
20   i = i - 4;
21   x = i * 4;
22   y = x * 10;
23   foo (y);
24 }
25 
26 /* { dg-final { scan-tree-dump-times "\\* 40" 1 "slsr" } } */
27 /* { dg-final { scan-tree-dump-times "\\+ 200" 1 "slsr" } } */
28 /* { dg-final { scan-tree-dump-times "\\- 160" 1 "slsr" } } */
29 /* { dg-final { scan-tree-dump-times "\\* 40" 1 "optimized" } } */
30 /* { dg-final { scan-tree-dump-times "\\+ 200" 1 "optimized" } } */
31 /* { dg-final { scan-tree-dump-times "\\+ 40" 1 "optimized" } } */
32