From 2e1afe5232674cab6edf1efefd0c8c88fb63a594 Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Mon, 6 Apr 2020 10:47:41 -0400 Subject: [PATCH] try to fix tsan bot --- llvm/utils/llvm-lit/CMakeLists.txt | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/llvm/utils/llvm-lit/CMakeLists.txt b/llvm/utils/llvm-lit/CMakeLists.txt index 158d10988ffd..5c00f39ab4a5 100644 --- a/llvm/utils/llvm-lit/CMakeLists.txt +++ b/llvm/utils/llvm-lit/CMakeLists.txt @@ -13,13 +13,15 @@ if("${CMAKE_CFG_INTDIR}" STREQUAL ".") endif() set(LLVM_LIT_CONFIG_MAP "${LLVM_LIT_PATH_FUNCTION}\n") -foreach(i RANGE 0 ${file_last} 2) - list(GET LLVM_LIT_CONFIG_FILES ${i} main_config) - math(EXPR i1 "${i} + 1") - list(GET LLVM_LIT_CONFIG_FILES ${i1} site_out) - set(map "map_config(path('${main_config}'), path('${site_out}'))") - set(LLVM_LIT_CONFIG_MAP "${LLVM_LIT_CONFIG_MAP}\n${map}") -endforeach() +if (${file_last} GREATER -1) + foreach(i RANGE 0 ${file_last} 2) + list(GET LLVM_LIT_CONFIG_FILES ${i} main_config) + math(EXPR i1 "${i} + 1") + list(GET LLVM_LIT_CONFIG_FILES ${i1} site_out) + set(map "map_config(path('${main_config}'), path('${site_out}'))") + set(LLVM_LIT_CONFIG_MAP "${LLVM_LIT_CONFIG_MAP}\n${map}") + endforeach() +endif() set(LLVM_SOURCE_DIR ${LLVM_MAIN_SRC_DIR})