1 /* { dg-do compile } */
2 /* { dg-options "-O -fdump-tree-phiopt1" } */
4 template<class T> static inline const T &ref_max(const T &a, const T &b)
5 { return a<b ? b : a; }
6 template<class T> static inline const T &ref_min(const T &a, const T &b)
7 { return a<b ? a : b; }
9 template<class T> struct foo_t {
11 T bar_ref(const T b, const T c) {
12 return ref_max(ref_min(a0, c), ref_min(ref_max(a1, c), b));
16 template struct foo_t<int>;
18 /* { dg-final { scan-tree-dump-times "MIN_EXPR" 2 "phiopt1" } } */
19 /* { dg-final { scan-tree-dump-times "MAX_EXPR" 2 "phiopt1" } } */
20 /* { dg-final { cleanup-tree-dump "phiopt1" } } */