Index: compiler-rt/trunk/test/cfi/CMakeLists.txt =================================================================== --- compiler-rt/trunk/test/cfi/CMakeLists.txt +++ compiler-rt/trunk/test/cfi/CMakeLists.txt @@ -8,6 +8,7 @@ if (${thinlto}) set(suffix ${suffix}-thinlto) endif() + set(suffix ${suffix}-${CFI_TEST_TARGET_ARCH}) set(CFI_TEST_USE_LLD ${lld}) set(CFI_TEST_USE_THINLTO ${thinlto}) @@ -29,14 +30,21 @@ list(APPEND CFI_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/Devirt${suffix}) endmacro() -if (APPLE) - # FIXME: enable ThinLTO tests after fixing http://llvm.org/pr32741 - add_cfi_test_suites(False False) -elseif(WIN32) - add_cfi_test_suites(True False) - add_cfi_test_suites(True True) -else() - if (CFI_SUPPORTED_ARCH) +set(CFI_TEST_ARCH ${CFI_SUPPORTED_ARCH}) +if(APPLE) + darwin_filter_host_archs(CFI_SUPPORTED_ARCH CFI_TEST_ARCH) +endif() + +foreach(arch ${CFI_TEST_ARCH}) + set(CFI_TEST_TARGET_ARCH ${arch}) + get_test_cc_for_arch(${arch} CFI_TEST_TARGET_CC CFI_TEST_TARGET_CFLAGS) + if (APPLE) + # FIXME: enable ThinLTO tests after fixing http://llvm.org/pr32741 + add_cfi_test_suites(False False) + elseif(WIN32) + add_cfi_test_suites(True False) + add_cfi_test_suites(True True) + else() add_cfi_test_suites(False False) add_cfi_test_suites(False True) if (COMPILER_RT_HAS_LLD) @@ -44,7 +52,7 @@ add_cfi_test_suites(True True) endif() endif() -endif() +endforeach() set(CFI_TEST_DEPS ${SANITIZER_COMMON_LIT_TEST_DEPS}) list(APPEND CFI_TEST_DEPS Index: compiler-rt/trunk/test/cfi/lit.cfg =================================================================== --- compiler-rt/trunk/test/cfi/lit.cfg +++ compiler-rt/trunk/test/cfi/lit.cfg @@ -5,12 +5,13 @@ config.suffixes = ['.c', '.cpp', '.test'] config.test_source_root = os.path.dirname(__file__) -clangxx = ' '.join([config.clang] + config.cxx_mode_flags) +clang = ' '.join([config.clang, config.target_cflags]) +clangxx = ' '.join([config.clang, config.target_cflags] + config.cxx_mode_flags) -config.substitutions.append((r"%clang ", ' '.join([config.clang]) + ' ')) +config.substitutions.append((r"%clang ", clang + ' ')) config.substitutions.append((r"%clangxx ", clangxx + ' ')) if config.lto_supported: - clang_cfi = ' '.join(config.lto_launch + [config.clang] + config.lto_flags + ['-fsanitize=cfi ']) + clang_cfi = ' '.join(config.lto_launch + [clang] + config.lto_flags + ['-fsanitize=cfi ']) if config.cfi_lit_test_mode == "Devirt": config.available_features.add('devirt') Index: compiler-rt/trunk/test/cfi/lit.site.cfg.in =================================================================== --- compiler-rt/trunk/test/cfi/lit.site.cfg.in +++ compiler-rt/trunk/test/cfi/lit.site.cfg.in @@ -2,6 +2,8 @@ config.name_suffix = "@CFI_TEST_CONFIG_SUFFIX@" config.cfi_lit_test_mode = "@CFI_LIT_TEST_MODE@" +config.target_arch = "@CFI_TEST_TARGET_ARCH@" +config.target_cflags = "@CFI_TEST_TARGET_CFLAGS@" config.use_lld = @CFI_TEST_USE_LLD@ config.use_thinlto = @CFI_TEST_USE_THINLTO@