Add new test to verify that the array index, limit, and stride are
[official-gcc.git] / gcc / testsuite / gcc.dg / fold-div-1.c
blob533908c300cd06f5b14873109fd7e768e62481d6
1 /* { dg-do compile } */
2 /* { dg-options "-funsafe-math-optimizations -fdump-tree-gimple" } */
4 float f(float x)
6 return x/2 + x/3;
9 float g(float x)
11 return 2/x + 3/x;
14 float h(float x)
16 return x/2 - x/3;
19 float i(float x)
21 return 2/x - 3/x;
24 /* f and h should be turned into multiplications,
25 the divisions in g and i should be grouped together. */
27 /* { dg-final { scan-tree-dump-times " \\* " 2 "gimple" } } */
28 /* { dg-final { scan-tree-dump-times " / " 2 "gimple" } } */
29 /* { dg-final { cleanup-tree-dump "gimple" } } */