mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-03-25 18:50:40 +08:00
Big 1213: add regression unit test.
This commit is contained in:
parent
747e3290c0
commit
5a71eb5985
@ -259,6 +259,8 @@ ei_add_test(dense_storage)
|
||||
ei_add_test(ctorleak)
|
||||
ei_add_test(mpl2only)
|
||||
|
||||
add_executable(bug1213 bug1213.cpp bug1213_main.cpp)
|
||||
|
||||
check_cxx_compiler_flag("-ffast-math" COMPILER_SUPPORT_FASTMATH)
|
||||
if(COMPILER_SUPPORT_FASTMATH)
|
||||
set(EIGEN_FASTMATH_FLAGS "-ffast-math")
|
||||
|
13
test/bug1213.cpp
Normal file
13
test/bug1213.cpp
Normal file
@ -0,0 +1,13 @@
|
||||
|
||||
// This anonymous enum is essential to trigger the linking issue
|
||||
enum {
|
||||
Foo
|
||||
};
|
||||
|
||||
#include "bug1213.h"
|
||||
|
||||
bool bug1213_1(const Eigen::Vector3f& x)
|
||||
{
|
||||
return bug1213_2(x);
|
||||
}
|
||||
|
8
test/bug1213.h
Normal file
8
test/bug1213.h
Normal file
@ -0,0 +1,8 @@
|
||||
|
||||
#include <Eigen/Core>
|
||||
|
||||
template<typename T, int dim>
|
||||
bool bug1213_2(const Eigen::Matrix<T,dim,1>& x);
|
||||
|
||||
bool bug1213_1(const Eigen::Vector3f& x);
|
||||
|
18
test/bug1213_main.cpp
Normal file
18
test/bug1213_main.cpp
Normal file
@ -0,0 +1,18 @@
|
||||
|
||||
// This is a regression unit regarding a weird linking issue with gcc.
|
||||
|
||||
#include "bug1213.h"
|
||||
|
||||
int main()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
template<typename T, int dim>
|
||||
bool bug1213_2(const Eigen::Matrix<T,dim,1>& )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
template bool bug1213_2<float,3>(const Eigen::Vector3f&);
|
Loading…
x
Reference in New Issue
Block a user