diff --git a/test/evaluators.cpp b/test/evaluators.cpp index ec000f1eb..2810cd265 100644 --- a/test/evaluators.cpp +++ b/test/evaluators.cpp @@ -503,6 +503,7 @@ EIGEN_DECLARE_TEST(evaluators) VERIFY_IS_EQUAL( get_cost(a.lazyProduct(a+b)), 15); } + // regression test for PR 544 and bug 1622 (introduced in #71609c4) { // test restricted_packet_assignment with an unaligned destination const size_t M = 2; diff --git a/test/product_large.cpp b/test/product_large.cpp index ae14b714c..578dfb54b 100644 --- a/test/product_large.cpp +++ b/test/product_large.cpp @@ -8,6 +8,7 @@ // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. #include "product.h" +#include template void test_aliasing() @@ -87,6 +88,16 @@ void product_large_regressions() } } +template +void bug_1622() { + typedef Matrix Mat2X; + Mat2X x(2,2); x.setRandom(); + MatrixXd y(2,2); y.setRandom(); + const Mat2X K1 = x * y.inverse(); + const Matrix2d K2 = x * y.inverse(); + VERIFY_IS_APPROX(K1,K2); +} + EIGEN_DECLARE_TEST(product_large) { for(int i = 0; i < g_repeat; i++) { @@ -99,6 +110,8 @@ EIGEN_DECLARE_TEST(product_large) CALL_SUBTEST_5( product(Matrix(internal::random(1,EIGEN_TEST_MAX_SIZE), internal::random(1,EIGEN_TEST_MAX_SIZE))) ); CALL_SUBTEST_1( test_aliasing() ); + + CALL_SUBTEST_6( bug_1622<1>() ); } CALL_SUBTEST_6( product_large_regressions<0>() );