diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg/tree-ssa/minmax-12.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/tree-ssa/minmax-12.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/minmax-12.c b/gcc/testsuite/gcc.dg/tree-ssa/minmax-12.c new file mode 100644 index 00000000000..3d0c07d9b57 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/minmax-12.c @@ -0,0 +1,20 @@ +/* { dg-do compile } */ +/* { dg-options "-O -fdump-tree-phiopt" } */ + +#include <stdint.h> + +uint8_t three_minmax3 (uint8_t xc, uint8_t xm, uint8_t xy) { + uint8_t xk; + xc=~xc; + xm=~xm; + xy=~xy; + if (xc > xm) { + xk = (uint8_t) (xy < xc ? xc : xy); + } else { + xk = (uint8_t) (xm < xy ? xm : xy); + } + return xk; +} + +/* { dg-final { scan-tree-dump-times "MIN_EXPR" 1 "phiopt1" } } */ +/* { dg-final { scan-tree-dump-times "MAX_EXPR" 1 "phiopt1" } } */ |