diff --git a/test/geo_transformations.cpp b/test/geo_transformations.cpp index 48393a5c6b..2e3a7169ad 100644 --- a/test/geo_transformations.cpp +++ b/test/geo_transformations.cpp @@ -18,6 +18,10 @@ Matrix angleToVec(T a) return Matrix(std::cos(a), std::sin(a)); } +// This permits to workaround a bug in clang/llvm code generation. +EIGEN_DONT_INLINE +void dont_over_optimize(void* x) { *(int*)(x) = (*(int*)(x))&0xFFFF000 | (*(int*)(x))&0x0000FFFF; } + template void non_projective_only() { /* this test covers the following files: @@ -224,12 +228,13 @@ template void transformations() do { v3 = Vector3::Random(); + dont_over_optimize(&v3); } while (v3.cwiseAbs().minCoeff()::epsilon()); Translation3 tv3(v3); Transform3 t5(tv3); t4 = tv3; VERIFY_IS_APPROX(t5.matrix(), t4.matrix()); - t4.translate(-v3); + t4.translate((-v3).eval()); VERIFY_IS_APPROX(t4.matrix(), MatrixType::Identity()); t4 *= tv3; VERIFY_IS_APPROX(t5.matrix(), t4.matrix());