1set(PROFILE_LIT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) 2set(PROFILE_LIT_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}) 3 4set(PROFILE_TESTSUITES) 5set(PROFILE_TEST_DEPS ${SANITIZER_COMMON_LIT_TEST_DEPS}) 6if(NOT COMPILER_RT_STANDALONE_BUILD) 7 list(APPEND PROFILE_TEST_DEPS profile llvm-profdata llvm-cov) 8endif() 9 10set(PROFILE_TEST_ARCH ${PROFILE_SUPPORTED_ARCH}) 11if(APPLE) 12 darwin_filter_host_archs(PROFILE_SUPPORTED_ARCH PROFILE_TEST_ARCH) 13endif() 14 15foreach(arch ${PROFILE_TEST_ARCH}) 16 set(PROFILE_TEST_TARGET_ARCH ${arch}) 17 if(${arch} MATCHES "arm|aarch64") 18 # This is only true if we're cross-compiling. 19 set(PROFILE_TEST_TARGET_CFLAGS ${COMPILER_RT_TEST_COMPILER_CFLAGS}) 20 else() 21 get_target_flags_for_arch(${arch} PROFILE_TEST_TARGET_CFLAGS) 22 string(REPLACE ";" " " PROFILE_TEST_TARGET_CFLAGS "${PROFILE_TEST_TARGET_CFLAGS}") 23 endif() 24 set(CONFIG_NAME Profile-${arch}) 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 ) 29 list(APPEND PROFILE_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}) 30endforeach() 31 32add_lit_testsuite(check-profile "Running the profile tests" 33 ${PROFILE_TESTSUITES} 34 DEPENDS ${PROFILE_TEST_DEPS}) 35set_target_properties(check-profile PROPERTIES FOLDER "Compiler-RT Misc") 36