1 /* { dg-do compile } */
2 /* { dg-options "-O1 -ffinite-math-only -fdump-tree-phiopt1" } */
4 float repl1 (float varx
)
14 /* Should be turned to
16 varx_4 = MIN_EXPR <1.0e+0, varx_2>;
17 varx_5 = MAX_EXPR <varx_4, 0.0>; */
19 /* { dg-final { scan-tree-dump "varx.*MIN_EXPR.*1\\.0" "phiopt1"} } */
20 /* { dg-final { scan-tree-dump "varx.*MAX_EXPR.*0\\.0" "phiopt1"} } */
22 float repl2 (float vary
)
32 /* Should be turned to
34 vary_4 = MAX_EXPR <0.0, vary_2>;
35 vary_5 = MIN_EXPR <vary_4, 1.0e+0>; */
37 /* { dg-final { scan-tree-dump "vary.*MAX_EXPR.*0\\.0" "phiopt1"} } */
38 /* { dg-final { scan-tree-dump "vary.*MIN_EXPR.*1\\.0" "phiopt1"} } */
40 float repl3 (float varz
, float vara
, float varb
)
50 /* Should be turned to
52 if (varz_2 > vara_3) goto <L4>; else goto <L1>;
55 vara_6 = MAX_EXPR <varb_5, varz_2>; */
57 /* { dg-final { scan-tree-dump "if .*varz" "phiopt1"} } */
58 /* { dg-final { scan-tree-dump "vara.*MAX_EXPR" "phiopt1"} } */
59 /* { dg-final { cleanup-tree-dump "phiopt1" } } */