]>
Commit | Line | Data |
---|---|---|
37ebaabd | 1 | /* { dg-do run } */ |
9bb19e14 TC |
2 | /* { dg-options "-O -fdump-tree-phiopt" } */ |
3 | ||
4 | #include <stdint.h> | |
5 | ||
37ebaabd | 6 | __attribute__ ((noipa, noinline)) |
9bb19e14 TC |
7 | uint8_t three_max (uint8_t xc, uint8_t xm, uint8_t xy) { |
8 | uint8_t xk; | |
9 | if (xc > xm) { | |
10 | xk = (uint8_t) (xc > xy ? xc : xy); | |
11 | } else { | |
12 | xk = (uint8_t) (xm > xy ? xm : xy); | |
13 | } | |
14 | return xk; | |
15 | } | |
16 | ||
37ebaabd TC |
17 | int |
18 | main (void) | |
19 | { | |
20 | volatile uint8_t xy = 255; | |
21 | volatile uint8_t xm = 0; | |
22 | volatile uint8_t xc = 127; | |
23 | if (three_max (xc, xm, xy) != 255) | |
24 | __builtin_abort (); | |
25 | return 0; | |
26 | } | |
27 | ||
9bb19e14 | 28 | /* { dg-final { scan-tree-dump-times "MIN_EXPR" 0 "phiopt1" } } */ |
d256dc28 | 29 | /* { dg-final { scan-tree-dump-times "MAX_EXPR" 2 "phiopt1" } } */ |