diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index f9adee2..b4af148 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -130,5 +130,13 @@ run empty_value_size_test.cpp ; run quick_exit_test.cpp ; run-fail quick_exit_fail.cpp ; +lib lib_typeid : lib_typeid.cpp : shared:LIB_TYPEID_DYN_LINK=1 ; + +run test_lib_typeid.cpp lib_typeid : : : shared : test_lib_typeid_shared ; +run test_lib_typeid.cpp lib_typeid : : : static : test_lib_typeid_static ; + +run test_lib_typeid.cpp lib_typeid : : : shared off : test_lib_typeid_shared_no_rtti ; +run test_lib_typeid.cpp lib_typeid : : : static off : test_lib_typeid_static_no_rtti ; + use-project /boost/core/swap : ./swap ; build-project ./swap ; diff --git a/test/lib_typeid.cpp b/test/lib_typeid.cpp new file mode 100644 index 0000000..c74c856 --- /dev/null +++ b/test/lib_typeid.cpp @@ -0,0 +1,17 @@ + +// Copyright 2018 Peter Dimov. +// Distributed under the Boost Software License, Version 1.0. + +#include +#include + +#if defined(LIB_TYPEID_DYN_LINK) +# define EXPORT BOOST_SYMBOL_EXPORT +#else +# define EXPORT +#endif + +EXPORT boost::core::typeinfo const * get_typeid_int() +{ + return &BOOST_CORE_TYPEID( int ); +} diff --git a/test/test_lib_typeid.cpp b/test/test_lib_typeid.cpp new file mode 100644 index 0000000..762ed26 --- /dev/null +++ b/test/test_lib_typeid.cpp @@ -0,0 +1,14 @@ + +// Copyright 2018 Peter Dimov. +// Distributed under the Boost Software License, Version 1.0. + +#include +#include + +boost::core::typeinfo const * get_typeid_int(); + +int main() +{ + BOOST_TEST_EQ( get_typeid_int(), &BOOST_CORE_TYPEID( int ) ); + return boost::report_errors(); +}