Fix all tests that fail with -sanitize=return.
[official-gcc.git] / gcc / testsuite / g++.dg / tree-ssa / pr21463.C
blob0aed8482e6f92e750a9109c8c82879b540355b0f
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 {
10         T a0, a1;
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));
13         }
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" } } */