mirror of
https://github.com/boostorg/function.git
synced 2025-07-25 10:27:14 +02:00
Add minimal test for UBSan failures
Reproduced with clang 5.0 and 6.0 on Linux using Boost super-project at master as well as Function at develop: cd libs/function/test/ubsan_undefined_bug b2 toolset=clang variant=ubsan_undefined
This commit is contained in:
18
test/ubsan_undefined_bug/Jamfile
Normal file
18
test/ubsan_undefined_bug/Jamfile
Normal file
@ -0,0 +1,18 @@
|
||||
import testing ;
|
||||
|
||||
variant ubsan_undefined
|
||||
: release
|
||||
:
|
||||
<cxxflags>"-std=c++11 -Wno-unused -fstrict-aliasing -fno-omit-frame-pointer -fsanitize=undefined -fno-sanitize-recover=undefined"
|
||||
<linkflags>"-fsanitize=undefined"
|
||||
<debug-symbols>on
|
||||
<define>BOOST_USE_ASAN=1
|
||||
;
|
||||
|
||||
project
|
||||
: requirements
|
||||
<include>$(BOOST_ROOT)
|
||||
<library>/boost/test//boost_unit_test_framework
|
||||
;
|
||||
|
||||
run test.cpp ;
|
11
test/ubsan_undefined_bug/test.cpp
Normal file
11
test/ubsan_undefined_bug/test.cpp
Normal file
@ -0,0 +1,11 @@
|
||||
#define BOOST_TEST_MAIN
|
||||
#include <boost/test/unit_test.hpp>
|
||||
|
||||
BOOST_AUTO_TEST_SUITE( ubsan_tests )
|
||||
|
||||
BOOST_AUTO_TEST_CASE( test1 )
|
||||
{
|
||||
BOOST_CHECK(true);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_SUITE_END()
|
Reference in New Issue
Block a user