mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-04-16 14:49:39 +08:00
Fix gcc-6 bug in the rand test.
This commit is contained in:
parent
d626762e3f
commit
128c8abf44
@ -10,8 +10,11 @@
|
||||
#include <cstdlib>
|
||||
#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 <typename Scalar>
|
||||
Scalar check_in_range(Scalar x, Scalar y) {
|
||||
EIGEN_DONT_INLINE Scalar check_in_range(Scalar x, Scalar y) {
|
||||
Scalar r = internal::random<Scalar>(x, y);
|
||||
VERIFY(r >= x);
|
||||
if (y >= x) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user