diff --git a/test/rand.cpp b/test/rand.cpp index bb90ad9c3..b5cf801f3 100644 --- a/test/rand.cpp +++ b/test/rand.cpp @@ -10,8 +10,11 @@ #include #include "main.h" +// For GCC-6, if this function is inlined then there seems to be an optimization +// bug that triggers a failure. This failure goes away if you access `r` in +// in any way, and for any other compiler. template -Scalar check_in_range(Scalar x, Scalar y) { +EIGEN_DONT_INLINE Scalar check_in_range(Scalar x, Scalar y) { Scalar r = internal::random(x, y); VERIFY(r >= x); if (y >= x) {