From d6b017c2637cc23e8dc0e22974edf3c28c9ce569 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20=C5=81oskot?= Date: Mon, 22 Oct 2018 19:35:48 +0200 Subject: [PATCH] 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 --- test/ubsan_undefined_bug/Jamfile | 18 ++++++++++++++++++ test/ubsan_undefined_bug/test.cpp | 11 +++++++++++ 2 files changed, 29 insertions(+) create mode 100644 test/ubsan_undefined_bug/Jamfile create mode 100644 test/ubsan_undefined_bug/test.cpp diff --git a/test/ubsan_undefined_bug/Jamfile b/test/ubsan_undefined_bug/Jamfile new file mode 100644 index 0000000..0fdf2c9 --- /dev/null +++ b/test/ubsan_undefined_bug/Jamfile @@ -0,0 +1,18 @@ +import testing ; + +variant ubsan_undefined + : release + : + "-std=c++11 -Wno-unused -fstrict-aliasing -fno-omit-frame-pointer -fsanitize=undefined -fno-sanitize-recover=undefined" + "-fsanitize=undefined" + on + BOOST_USE_ASAN=1 + ; + +project + : requirements + $(BOOST_ROOT) + /boost/test//boost_unit_test_framework + ; + +run test.cpp ; \ No newline at end of file diff --git a/test/ubsan_undefined_bug/test.cpp b/test/ubsan_undefined_bug/test.cpp new file mode 100644 index 0000000..befc7b4 --- /dev/null +++ b/test/ubsan_undefined_bug/test.cpp @@ -0,0 +1,11 @@ +#define BOOST_TEST_MAIN +#include + +BOOST_AUTO_TEST_SUITE( ubsan_tests ) + +BOOST_AUTO_TEST_CASE( test1 ) +{ + BOOST_CHECK(true); +} + +BOOST_AUTO_TEST_SUITE_END()