|
1 | 1 | set(DFSAN_LIT_TESTS_DIR ${CMAKE_CURRENT_SOURCE_DIR})
|
2 | 2 |
|
3 |
| -configure_lit_site_cfg( |
4 |
| - ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in |
5 |
| - ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg) |
| 3 | +set(DFSAN_TESTSUITES) |
| 4 | + |
| 5 | +set(DFSAN_TEST_ARCH ${DFSAN_SUPPORTED_ARCH}) |
| 6 | +if(APPLE) |
| 7 | + darwin_filter_host_archs(DFSAN_SUPPORTED_ARCH DFSAN_TEST_ARCH) |
| 8 | +endif() |
| 9 | + |
| 10 | +foreach(arch ${DFSAN_TEST_ARCH}) |
| 11 | + string(TOLOWER "-${arch}" DFSAN_TEST_CONFIG_SUFFIX) |
| 12 | + if(ANDROID OR ${arch} MATCHES "arm|aarch64") |
| 13 | + # This is only true if we are cross-compiling. |
| 14 | + # Build all tests with host compiler and use host tools. |
| 15 | + set(DFSAN_TEST_TARGET_CC ${COMPILER_RT_TEST_COMPILER}) |
| 16 | + set(DFSAN_TEST_TARGET_CFLAGS ${COMPILER_RT_TEST_COMPILER_CFLAGS}) |
| 17 | + else() |
| 18 | + get_target_flags_for_arch(${arch} DFSAN_TEST_TARGET_CFLAGS) |
| 19 | + string(REPLACE ";" " " DFSAN_TEST_TARGET_CFLAGS "${DFSAN_TEST_TARGET_CFLAGS}") |
| 20 | + endif() |
| 21 | + |
| 22 | + string(TOUPPER ${arch} ARCH_UPPER_CASE) |
| 23 | + set(CONFIG_NAME ${ARCH_UPPER_CASE}Config) |
| 24 | + |
| 25 | + configure_lit_site_cfg( |
| 26 | + ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in |
| 27 | + ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}/lit.site.cfg) |
| 28 | + list(APPEND DFSAN_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}) |
| 29 | +endforeach() |
6 | 30 |
|
7 | 31 | set(DFSAN_TEST_DEPS ${SANITIZER_COMMON_LIT_TEST_DEPS})
|
8 | 32 | if(NOT COMPILER_RT_STANDALONE_BUILD)
|
9 | 33 | list(APPEND DFSAN_TEST_DEPS dfsan)
|
10 | 34 | endif()
|
11 | 35 |
|
12 | 36 | add_lit_testsuite(check-dfsan "Running the DataFlowSanitizer tests"
|
13 |
| - ${CMAKE_CURRENT_BINARY_DIR} |
| 37 | + ${DFSAN_TESTSUITES} |
14 | 38 | DEPENDS ${DFSAN_TEST_DEPS})
|
15 | 39 | set_target_properties(check-dfsan PROPERTIES FOLDER "DFSan tests")
|
0 commit comments