2014-02-14 22:06:10 +08:00
|
|
|
set(ASAN_LIT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
|
|
|
|
|
|
|
|
set(ASAN_TESTSUITES)
|
2014-12-18 07:14:01 +08:00
|
|
|
set(ASAN_DYNAMIC_TESTSUITES)
|
2014-02-14 22:06:10 +08:00
|
|
|
|
2017-05-13 00:30:56 +08:00
|
|
|
# Before Windows 8 (CMAKE_SYSTEM_VERSION 6.2), reserving large regions of shadow
|
|
|
|
# memory allocated physical memory for page tables, which made it very
|
|
|
|
# unreliable. Remove the asan tests from check-all in this configuration.
|
|
|
|
set(SHADOW_MAPPING_UNRELIABLE FALSE)
|
|
|
|
if(OS_NAME MATCHES "Windows" AND CMAKE_SIZEOF_VOID_P EQUAL 8 AND
|
2018-01-04 05:29:49 +08:00
|
|
|
CMAKE_SYSTEM_VERSION LESS 6.2)
|
2017-05-13 00:30:56 +08:00
|
|
|
set(SHADOW_MAPPING_UNRELIABLE TRUE)
|
|
|
|
message(WARNING "Disabling ASan tests because they are unreliable on Windows 7 and earlier")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if (SHADOW_MAPPING_UNRELIABLE)
|
2017-03-22 06:07:06 +08:00
|
|
|
set(EXCLUDE_FROM_ALL TRUE)
|
|
|
|
endif()
|
|
|
|
|
2014-09-29 21:18:55 +08:00
|
|
|
macro(get_bits_for_arch arch bits)
|
2018-02-16 06:14:36 +08:00
|
|
|
if (${arch} MATCHES "x86_64|powerpc64|powerpc64le|aarch64|arm64|mips64|mips64el|s390x")
|
2015-03-05 08:33:11 +08:00
|
|
|
set(${bits} 64)
|
2018-02-16 06:14:36 +08:00
|
|
|
elseif (${arch} MATCHES "i386|arm|mips|mipsel")
|
|
|
|
set(${bits} 32)
|
2014-09-29 21:18:55 +08:00
|
|
|
else()
|
|
|
|
message(FATAL_ERROR "Unknown target architecture: ${arch}")
|
|
|
|
endif()
|
|
|
|
endmacro()
|
2014-02-14 22:06:10 +08:00
|
|
|
|
2015-08-11 23:51:40 +08:00
|
|
|
set(ASAN_TEST_DEPS ${SANITIZER_COMMON_LIT_TEST_DEPS})
|
|
|
|
if(NOT COMPILER_RT_STANDALONE_BUILD)
|
|
|
|
list(APPEND ASAN_TEST_DEPS asan)
|
2017-04-28 04:27:33 +08:00
|
|
|
if(NOT APPLE AND COMPILER_RT_HAS_LLD)
|
2017-09-16 11:26:03 +08:00
|
|
|
list(APPEND ASAN_TEST_DEPS lld)
|
2015-08-11 23:51:40 +08:00
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
set(ASAN_DYNAMIC_TEST_DEPS ${ASAN_TEST_DEPS})
|
|
|
|
|
2015-08-21 01:32:06 +08:00
|
|
|
set(ASAN_TEST_ARCH ${ASAN_SUPPORTED_ARCH})
|
|
|
|
if(APPLE)
|
|
|
|
darwin_filter_host_archs(ASAN_SUPPORTED_ARCH ASAN_TEST_ARCH)
|
|
|
|
endif()
|
[Sanitizers, test] Fix sanitizer tests on Solaris (PR 33274)
Summary:
This patch (on top of the previous two (https://reviews.llvm.org/D40898 and
https://reviews.llvm.org/D40899) complete the compiler-rt side of the the Solaris
sanitizer port.
It contains the following sets of changes:
* For the time being, the port is for 32-bit x86 only, so reject the various tests on
x86_64.
* When compiling as C++, <setjmp.h> resp. <iso/setjmp_iso.h> only declares
_setjmp and _longjmp inside namespace std.
* MAP_FILE is a Windows feature. While e.g. Linux <sys/mman.h> provides a
no-op compat define, Solaris does not.
* test/asan/TestCases/Posix/coverage.cc was initially failing like this:
/vol/gcc/src/llvm/llvm/local/projects/compiler-rt/lib/sanitizer_common/scripts/sancov.py: 4 files merged; 2 PCs total
rm: cannot remove '/var/gcc/llvm/local/projects/compiler-rt/test/asan/I386SunOSConfig/TestCases/Posix/Output/coverage': Invalid argument
Further digging revealed that the rm was trying to remove the running test's working
directory which failed as observed. cd'ing out of the dir before let the test pass.
* Two tests needed a declaration of alloca. I've now copied the existing code from
test/asan/TestCases/alloca_constant_size.cc, but it may be more profitable and
maintainable to have a common testsuite header where such code is collected.
* Similarly, Solaris' printf %p format doesn't include the leading 0x.
* In test/asan/TestCases/malloc-no-intercept.c, I had to undef __EXTENSIONS__
(predefined by clang for no apparent reason) to avoid conflicting declarations
for memalign.
* test/ubsan/TestCases/Float/cast-overflow.cpp has different platform dependent
ways to define BYTE_ORDER and friends. Why not just use __BYTE_ORDER__ and
friends as predefined by clang and gcc?
Patch by Rainer Orth.
Reviewers: kcc, alekseyshl
Reviewed By: alekseyshl
Subscribers: srhines, kubamracek, mgorny, krytarowski, fedor.sergeev, JDevlieghere, llvm-commits, #sanitizers
Tags: #sanitizers
Differential Revision: https://reviews.llvm.org/D40900
llvm-svn: 322635
2018-01-17 20:26:04 +08:00
|
|
|
if(OS_NAME MATCHES "SunOS")
|
|
|
|
list(REMOVE_ITEM ASAN_TEST_ARCH x86_64)
|
|
|
|
endif()
|
2015-08-21 01:32:06 +08:00
|
|
|
|
|
|
|
foreach(arch ${ASAN_TEST_ARCH})
|
[sanitizer] Remove "-android" from test_arch.
Summary:
ASan and Scudo tests are adding "-android" to test arch.
There are no tests that depend on it as far as I can see.
If necessary, do this instead:
REQUIRES: aarch64-target-arch && android
Reviewers: pcc, vitalybuka
Subscribers: srhines, kubamracek, mgorny, javed.absar, kristof.beyls, cryptoad, #sanitizers, llvm-commits
Tags: #sanitizers, #llvm
Differential Revision: https://reviews.llvm.org/D58532
llvm-svn: 354829
2019-02-26 06:32:30 +08:00
|
|
|
set(ASAN_TEST_TARGET_ARCH ${arch})
|
2018-06-20 21:33:42 +08:00
|
|
|
set(ASAN_TEST_APPLE_PLATFORM "osx")
|
2015-01-29 10:28:53 +08:00
|
|
|
string(TOLOWER "-${arch}-${OS_NAME}" ASAN_TEST_CONFIG_SUFFIX)
|
|
|
|
get_bits_for_arch(${arch} ASAN_TEST_BITS)
|
2016-11-30 03:25:53 +08:00
|
|
|
get_test_cc_for_arch(${arch} ASAN_TEST_TARGET_CC ASAN_TEST_TARGET_CFLAGS)
|
2018-10-12 10:36:19 +08:00
|
|
|
if(ANDROID OR APPLE)
|
2015-01-29 10:28:53 +08:00
|
|
|
set(ASAN_TEST_DYNAMIC True)
|
|
|
|
else()
|
2014-09-29 21:18:55 +08:00
|
|
|
set(ASAN_TEST_DYNAMIC False)
|
|
|
|
endif()
|
2015-01-29 10:28:53 +08:00
|
|
|
string(TOUPPER ${arch} ARCH_UPPER_CASE)
|
|
|
|
set(CONFIG_NAME ${ARCH_UPPER_CASE}${OS_NAME}Config)
|
|
|
|
configure_lit_site_cfg(
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}/lit.site.cfg
|
|
|
|
)
|
|
|
|
list(APPEND ASAN_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME})
|
2014-09-29 21:18:55 +08:00
|
|
|
|
2015-01-29 10:28:53 +08:00
|
|
|
if(COMPILER_RT_ASAN_HAS_STATIC_RUNTIME)
|
|
|
|
string(TOLOWER "-${arch}-${OS_NAME}-dynamic" ASAN_TEST_CONFIG_SUFFIX)
|
|
|
|
set(ASAN_TEST_DYNAMIC True)
|
|
|
|
set(CONFIG_NAME ${ARCH_UPPER_CASE}${OS_NAME}DynamicConfig)
|
2014-09-29 21:18:55 +08:00
|
|
|
configure_lit_site_cfg(
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in
|
2015-01-29 10:28:53 +08:00
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}/lit.site.cfg)
|
|
|
|
list(APPEND ASAN_DYNAMIC_TESTSUITES
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME})
|
2014-09-29 21:18:55 +08:00
|
|
|
endif()
|
2015-01-29 10:28:53 +08:00
|
|
|
endforeach()
|
2014-02-14 22:06:10 +08:00
|
|
|
|
2017-04-27 02:59:22 +08:00
|
|
|
# iOS and iOS simulator test suites
|
2017-07-13 05:02:48 +08:00
|
|
|
# These are not added into "check-all", in order to run these tests, use
|
|
|
|
# "check-asan-iossim-x86_64" and similar. They also require that an extra env
|
2017-04-27 02:59:22 +08:00
|
|
|
# variable to select which iOS device or simulator to use, e.g.:
|
2017-07-13 05:02:48 +08:00
|
|
|
# SANITIZER_IOSSIM_TEST_DEVICE_IDENTIFIER="iPhone 6"
|
2017-04-27 02:59:22 +08:00
|
|
|
if(APPLE)
|
2017-07-13 05:02:48 +08:00
|
|
|
set(EXCLUDE_FROM_ALL ON)
|
|
|
|
|
2017-04-27 02:59:22 +08:00
|
|
|
set(ASAN_TEST_TARGET_CC ${COMPILER_RT_TEST_COMPILER})
|
|
|
|
set(ASAN_TEST_DYNAMIC True)
|
|
|
|
|
Revert r363633 "[CMake] Fix the value of `config.target_cflags` for non-macOS Apple platforms. Attempt #2."
This caused Chromium's clang package to stop building, see comment on
https://reviews.llvm.org/D61242 for details.
> Summary:
> The main problem here is that `-*-version_min=` was not being passed to
> the compiler when building test cases. This can cause problems when
> testing on devices running older OSs because Clang would previously
> assume the minimum deployment target is the the latest OS in the SDK
> which could be much newer than what the device is running.
>
> Previously the generated value looked like this:
>
> `-arch arm64 -isysroot
> <path_to_xcode>/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.1.sdk`
>
> With this change it now looks like:
>
> `-arch arm64 -stdlib=libc++ -miphoneos-version-min=8.0 -isysroot
> <path_to_xcode>/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.1.sdk`
>
> This mirrors the setting of `config.target_cflags` on macOS.
>
> This change is made for ASan, LibFuzzer, TSan, and UBSan.
>
> To implement this a new `get_test_cflags_for_apple_platform()` function
> has been added that when given an Apple platform name and architecture
> returns a string containing the C compiler flags to use when building
> tests. This also calls a new helper function `is_valid_apple_platform()`
> that validates Apple platform names.
>
> This is the second attempt at landing the patch. The first attempt (r359305)
> had to be reverted (r359327) due to a buildbot failure. The problem was
> that calling `get_test_cflags_for_apple_platform()` can trigger a CMake
> error if the provided architecture is not supported by the current
> CMake configuration. Previously, this could be triggered by passing
> `-DCOMPILER_RT_ENABLE_IOS=OFF` to CMake. The root cause is that we were
> generating test configurations for a list of architectures without
> checking if the relevant Sanitizer actually supported that architecture.
> We now intersect the list of architectures for an Apple platform
> with `<SANITIZER>_SUPPORTED_ARCH` (where `<SANITIZER>` is a Sanitizer
> name) to iterate through the correct list of architectures.
>
> rdar://problem/50124489
>
> Reviewers: kubamracek, yln, vsk, juliehockett, phosek
>
> Subscribers: mgorny, javed.absar, kristof.beyls, #sanitizers, llvm-commits
>
> Tags: #llvm, #sanitizers
>
> Differential Revision: https://reviews.llvm.org/D61242
llvm-svn: 363779
2019-06-19 17:09:39 +08:00
|
|
|
foreach(arch ${DARWIN_iossim_ARCHS})
|
2018-06-20 21:33:42 +08:00
|
|
|
set(ASAN_TEST_APPLE_PLATFORM "iossim")
|
2017-04-27 02:59:22 +08:00
|
|
|
set(ASAN_TEST_TARGET_ARCH ${arch})
|
Revert r363633 "[CMake] Fix the value of `config.target_cflags` for non-macOS Apple platforms. Attempt #2."
This caused Chromium's clang package to stop building, see comment on
https://reviews.llvm.org/D61242 for details.
> Summary:
> The main problem here is that `-*-version_min=` was not being passed to
> the compiler when building test cases. This can cause problems when
> testing on devices running older OSs because Clang would previously
> assume the minimum deployment target is the the latest OS in the SDK
> which could be much newer than what the device is running.
>
> Previously the generated value looked like this:
>
> `-arch arm64 -isysroot
> <path_to_xcode>/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.1.sdk`
>
> With this change it now looks like:
>
> `-arch arm64 -stdlib=libc++ -miphoneos-version-min=8.0 -isysroot
> <path_to_xcode>/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.1.sdk`
>
> This mirrors the setting of `config.target_cflags` on macOS.
>
> This change is made for ASan, LibFuzzer, TSan, and UBSan.
>
> To implement this a new `get_test_cflags_for_apple_platform()` function
> has been added that when given an Apple platform name and architecture
> returns a string containing the C compiler flags to use when building
> tests. This also calls a new helper function `is_valid_apple_platform()`
> that validates Apple platform names.
>
> This is the second attempt at landing the patch. The first attempt (r359305)
> had to be reverted (r359327) due to a buildbot failure. The problem was
> that calling `get_test_cflags_for_apple_platform()` can trigger a CMake
> error if the provided architecture is not supported by the current
> CMake configuration. Previously, this could be triggered by passing
> `-DCOMPILER_RT_ENABLE_IOS=OFF` to CMake. The root cause is that we were
> generating test configurations for a list of architectures without
> checking if the relevant Sanitizer actually supported that architecture.
> We now intersect the list of architectures for an Apple platform
> with `<SANITIZER>_SUPPORTED_ARCH` (where `<SANITIZER>` is a Sanitizer
> name) to iterate through the correct list of architectures.
>
> rdar://problem/50124489
>
> Reviewers: kubamracek, yln, vsk, juliehockett, phosek
>
> Subscribers: mgorny, javed.absar, kristof.beyls, #sanitizers, llvm-commits
>
> Tags: #llvm, #sanitizers
>
> Differential Revision: https://reviews.llvm.org/D61242
llvm-svn: 363779
2019-06-19 17:09:39 +08:00
|
|
|
set(ASAN_TEST_TARGET_CFLAGS "-arch ${arch} -isysroot ${DARWIN_iossim_SYSROOT} ${COMPILER_RT_TEST_COMPILER_CFLAGS}")
|
2018-06-20 21:33:42 +08:00
|
|
|
set(ASAN_TEST_CONFIG_SUFFIX "-${arch}-${ASAN_TEST_APPLE_PLATFORM}")
|
2017-04-27 02:59:22 +08:00
|
|
|
get_bits_for_arch(${arch} ASAN_TEST_BITS)
|
|
|
|
string(TOUPPER ${arch} ARCH_UPPER_CASE)
|
|
|
|
set(CONFIG_NAME "IOSSim${ARCH_UPPER_CASE}Config")
|
|
|
|
configure_lit_site_cfg(
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}/lit.site.cfg
|
|
|
|
)
|
2017-07-13 05:02:48 +08:00
|
|
|
add_lit_testsuite(check-asan-iossim-${arch} "AddressSanitizer iOS Simulator ${arch} tests"
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}/
|
|
|
|
DEPENDS ${ASAN_TEST_DEPS})
|
2017-04-27 02:59:22 +08:00
|
|
|
endforeach()
|
|
|
|
|
Revert r363633 "[CMake] Fix the value of `config.target_cflags` for non-macOS Apple platforms. Attempt #2."
This caused Chromium's clang package to stop building, see comment on
https://reviews.llvm.org/D61242 for details.
> Summary:
> The main problem here is that `-*-version_min=` was not being passed to
> the compiler when building test cases. This can cause problems when
> testing on devices running older OSs because Clang would previously
> assume the minimum deployment target is the the latest OS in the SDK
> which could be much newer than what the device is running.
>
> Previously the generated value looked like this:
>
> `-arch arm64 -isysroot
> <path_to_xcode>/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.1.sdk`
>
> With this change it now looks like:
>
> `-arch arm64 -stdlib=libc++ -miphoneos-version-min=8.0 -isysroot
> <path_to_xcode>/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.1.sdk`
>
> This mirrors the setting of `config.target_cflags` on macOS.
>
> This change is made for ASan, LibFuzzer, TSan, and UBSan.
>
> To implement this a new `get_test_cflags_for_apple_platform()` function
> has been added that when given an Apple platform name and architecture
> returns a string containing the C compiler flags to use when building
> tests. This also calls a new helper function `is_valid_apple_platform()`
> that validates Apple platform names.
>
> This is the second attempt at landing the patch. The first attempt (r359305)
> had to be reverted (r359327) due to a buildbot failure. The problem was
> that calling `get_test_cflags_for_apple_platform()` can trigger a CMake
> error if the provided architecture is not supported by the current
> CMake configuration. Previously, this could be triggered by passing
> `-DCOMPILER_RT_ENABLE_IOS=OFF` to CMake. The root cause is that we were
> generating test configurations for a list of architectures without
> checking if the relevant Sanitizer actually supported that architecture.
> We now intersect the list of architectures for an Apple platform
> with `<SANITIZER>_SUPPORTED_ARCH` (where `<SANITIZER>` is a Sanitizer
> name) to iterate through the correct list of architectures.
>
> rdar://problem/50124489
>
> Reviewers: kubamracek, yln, vsk, juliehockett, phosek
>
> Subscribers: mgorny, javed.absar, kristof.beyls, #sanitizers, llvm-commits
>
> Tags: #llvm, #sanitizers
>
> Differential Revision: https://reviews.llvm.org/D61242
llvm-svn: 363779
2019-06-19 17:09:39 +08:00
|
|
|
foreach (arch ${DARWIN_ios_ARCHS})
|
2018-06-20 21:33:42 +08:00
|
|
|
set(ASAN_TEST_APPLE_PLATFORM "ios")
|
2017-04-27 02:59:22 +08:00
|
|
|
set(ASAN_TEST_TARGET_ARCH ${arch})
|
Revert r363633 "[CMake] Fix the value of `config.target_cflags` for non-macOS Apple platforms. Attempt #2."
This caused Chromium's clang package to stop building, see comment on
https://reviews.llvm.org/D61242 for details.
> Summary:
> The main problem here is that `-*-version_min=` was not being passed to
> the compiler when building test cases. This can cause problems when
> testing on devices running older OSs because Clang would previously
> assume the minimum deployment target is the the latest OS in the SDK
> which could be much newer than what the device is running.
>
> Previously the generated value looked like this:
>
> `-arch arm64 -isysroot
> <path_to_xcode>/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.1.sdk`
>
> With this change it now looks like:
>
> `-arch arm64 -stdlib=libc++ -miphoneos-version-min=8.0 -isysroot
> <path_to_xcode>/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.1.sdk`
>
> This mirrors the setting of `config.target_cflags` on macOS.
>
> This change is made for ASan, LibFuzzer, TSan, and UBSan.
>
> To implement this a new `get_test_cflags_for_apple_platform()` function
> has been added that when given an Apple platform name and architecture
> returns a string containing the C compiler flags to use when building
> tests. This also calls a new helper function `is_valid_apple_platform()`
> that validates Apple platform names.
>
> This is the second attempt at landing the patch. The first attempt (r359305)
> had to be reverted (r359327) due to a buildbot failure. The problem was
> that calling `get_test_cflags_for_apple_platform()` can trigger a CMake
> error if the provided architecture is not supported by the current
> CMake configuration. Previously, this could be triggered by passing
> `-DCOMPILER_RT_ENABLE_IOS=OFF` to CMake. The root cause is that we were
> generating test configurations for a list of architectures without
> checking if the relevant Sanitizer actually supported that architecture.
> We now intersect the list of architectures for an Apple platform
> with `<SANITIZER>_SUPPORTED_ARCH` (where `<SANITIZER>` is a Sanitizer
> name) to iterate through the correct list of architectures.
>
> rdar://problem/50124489
>
> Reviewers: kubamracek, yln, vsk, juliehockett, phosek
>
> Subscribers: mgorny, javed.absar, kristof.beyls, #sanitizers, llvm-commits
>
> Tags: #llvm, #sanitizers
>
> Differential Revision: https://reviews.llvm.org/D61242
llvm-svn: 363779
2019-06-19 17:09:39 +08:00
|
|
|
set(ASAN_TEST_TARGET_CFLAGS "-arch ${arch} -isysroot ${DARWIN_ios_SYSROOT} ${COMPILER_RT_TEST_COMPILER_CFLAGS}")
|
2018-06-20 21:33:42 +08:00
|
|
|
set(ASAN_TEST_CONFIG_SUFFIX "-${arch}-${ASAN_TEST_APPLE_PLATFORM}")
|
2017-04-27 02:59:22 +08:00
|
|
|
get_bits_for_arch(${arch} ASAN_TEST_BITS)
|
|
|
|
string(TOUPPER ${arch} ARCH_UPPER_CASE)
|
|
|
|
set(CONFIG_NAME "IOS${ARCH_UPPER_CASE}Config")
|
|
|
|
configure_lit_site_cfg(
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}/lit.site.cfg
|
|
|
|
)
|
2017-07-13 05:02:48 +08:00
|
|
|
add_lit_testsuite(check-asan-ios-${arch} "AddressSanitizer iOS ${arch} tests"
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}/
|
|
|
|
DEPENDS ${ASAN_TEST_DEPS})
|
2017-04-27 02:59:22 +08:00
|
|
|
endforeach()
|
2017-07-13 05:02:48 +08:00
|
|
|
|
|
|
|
set(EXCLUDE_FROM_ALL OFF)
|
2017-04-27 02:59:22 +08:00
|
|
|
endif()
|
|
|
|
|
2014-12-18 07:14:01 +08:00
|
|
|
# Add unit tests.
|
|
|
|
if(COMPILER_RT_INCLUDE_TESTS)
|
|
|
|
set(ASAN_TEST_DYNAMIC False)
|
|
|
|
configure_lit_site_cfg(
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.site.cfg.in
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg)
|
|
|
|
if(COMPILER_RT_ASAN_HAS_STATIC_RUNTIME)
|
|
|
|
set(ASAN_TEST_DYNAMIC True)
|
|
|
|
configure_lit_site_cfg(
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.site.cfg.in
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/Unit/dynamic/lit.site.cfg)
|
|
|
|
endif()
|
|
|
|
# FIXME: support unit test in the android test runner
|
|
|
|
if (NOT ANDROID)
|
|
|
|
list(APPEND ASAN_TEST_DEPS AsanUnitTests)
|
|
|
|
list(APPEND ASAN_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/Unit)
|
|
|
|
if(COMPILER_RT_ASAN_HAS_STATIC_RUNTIME)
|
|
|
|
list(APPEND ASAN_DYNAMIC_TEST_DEPS AsanDynamicUnitTests)
|
|
|
|
list(APPEND ASAN_DYNAMIC_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/Unit/dynamic)
|
|
|
|
endif()
|
|
|
|
endif()
|
2014-02-14 22:06:10 +08:00
|
|
|
endif()
|
2014-12-18 07:14:01 +08:00
|
|
|
|
2014-02-14 22:06:10 +08:00
|
|
|
add_lit_testsuite(check-asan "Running the AddressSanitizer tests"
|
|
|
|
${ASAN_TESTSUITES}
|
2016-09-14 06:25:41 +08:00
|
|
|
DEPENDS ${ASAN_TEST_DEPS})
|
2016-07-12 05:51:56 +08:00
|
|
|
set_target_properties(check-asan PROPERTIES FOLDER "Compiler-RT Misc")
|
2014-12-18 07:14:01 +08:00
|
|
|
|
|
|
|
if(COMPILER_RT_ASAN_HAS_STATIC_RUNTIME)
|
|
|
|
add_lit_testsuite(check-asan-dynamic
|
|
|
|
"Running the AddressSanitizer tests with dynamic runtime"
|
|
|
|
${ASAN_DYNAMIC_TESTSUITES}
|
|
|
|
DEPENDS ${ASAN_DYNAMIC_TEST_DEPS})
|
|
|
|
set_target_properties(check-asan-dynamic
|
2016-07-12 05:51:56 +08:00
|
|
|
PROPERTIES FOLDER "Compiler-RT Misc")
|
2014-12-18 07:14:01 +08:00
|
|
|
endif()
|
2017-03-22 06:07:06 +08:00
|
|
|
|
|
|
|
# Reset EXCLUDE_FROM_ALL to its initial value.
|
2017-05-13 00:30:56 +08:00
|
|
|
if (SHADOW_MAPPING_UNRELIABLE)
|
2017-03-22 06:07:06 +08:00
|
|
|
set(EXCLUDE_FROM_ALL FALSE)
|
|
|
|
endif()
|