aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/geo_transformations.cpp
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2016-05-24 21:55:46 +0200
committerGravatar Gael Guennebaud <g.gael@free.fr>2016-05-24 21:55:46 +0200
commit0fd953c217d4cb042ea9521a2bfce7683eb6e915 (patch)
tree41960a58ccd7061ea624d3799a50dbab707628de /test/geo_transformations.cpp
parente68e165a2331e21004b61de689231a68e4b7e9d1 (diff)
Workaround clang/llvm bug in code generation.
Diffstat (limited to 'test/geo_transformations.cpp')
-rw-r--r--test/geo_transformations.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/test/geo_transformations.cpp b/test/geo_transformations.cpp
index 48393a5c6..2e3a7169a 100644
--- a/test/geo_transformations.cpp
+++ b/test/geo_transformations.cpp
@@ -18,6 +18,10 @@ Matrix<T,2,1> angleToVec(T a)
return Matrix<T,2,1>(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<typename Scalar, int Mode, int Options> void non_projective_only()
{
/* this test covers the following files:
@@ -224,12 +228,13 @@ template<typename Scalar, int Mode, int Options> void transformations()
do {
v3 = Vector3::Random();
+ dont_over_optimize(&v3);
} while (v3.cwiseAbs().minCoeff()<NumTraits<Scalar>::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());