]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/testsuite/gcc.dg/tree-ssa/minmax-15.c
Fix profile update in tree_transform_and_unroll_loop
[thirdparty/gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / minmax-15.c
CommitLineData
37ebaabd 1/* { dg-do run } */
9bb19e14
TC
2/* { dg-options "-O -fdump-tree-phiopt" } */
3
4#include <stdint.h>
5#include <stdbool.h>
6
37ebaabd
TC
7__attribute__ ((noinline, noipa))
8uint8_t three_min (uint8_t xc, uint8_t xm, uint8_t xy) {
9bb19e14
TC
9 uint8_t xk;
10 if (xc)
11 {
12 if (xc < xm) {
13 xk = (uint8_t) (xc < xy ? xc : xy);
14 } else {
15 xk = (uint8_t) (xm < xy ? xm : xy);
16 }
17 }
18
19 return xk;
20}
37ebaabd
TC
21
22int
23main (void)
24{
25 volatile uint8_t xy = 255;
26 volatile uint8_t xm = 0;
27 volatile uint8_t xc = 127;
28 if (three_min (xc, xm, xy) != 0)
29 __builtin_abort ();
30 return 0;
31}
32
d256dc28
AP
33/* There should only be two MIN_EXPR left, the 3rd one was removed. */
34/* { dg-final { scan-tree-dump-times "MIN_EXPR" 2 "phiopt1" } } */
9bb19e14 35/* { dg-final { scan-tree-dump-times "MAX_EXPR" 0 "phiopt1" } } */