From e71f37c1cd0fd824d7460561fc29a8bdfb82df94 Mon Sep 17 00:00:00 2001 From: Alexey Samsonov Date: Sun, 30 Jun 2013 14:47:38 +0000 Subject: [PATCH] Define the path to llvm-symbolizer tool in a common config to reduce copy-paste llvm-svn: 185286 --- compiler-rt/lib/asan/lit_tests/lit.cfg | 5 +---- compiler-rt/lib/lit.common.cfg | 3 +++ compiler-rt/lib/lsan/lit_tests/lit.common.cfg | 4 ---- compiler-rt/lib/msan/lit_tests/lit.cfg | 5 +---- compiler-rt/lib/tsan/lit_tests/lit.cfg | 7 ++----- 5 files changed, 7 insertions(+), 17 deletions(-) diff --git a/compiler-rt/lib/asan/lit_tests/lit.cfg b/compiler-rt/lib/asan/lit_tests/lit.cfg index c215651debca..71b284f417c5 100644 --- a/compiler-rt/lib/asan/lit_tests/lit.cfg +++ b/compiler-rt/lib/asan/lit_tests/lit.cfg @@ -67,10 +67,7 @@ config.substitutions.append( ("%clangxx_asan ", (" " + config.clang + " " + clang_asan_cxxflags + " ")) ) # Setup path to external LLVM symbolizer to run AddressSanitizer output tests. -llvm_tools_dir = getattr(config, 'llvm_tools_dir', None) -if llvm_tools_dir: - config.environment['ASAN_SYMBOLIZER_PATH'] = os.path.join( - llvm_tools_dir, "llvm-symbolizer") +config.environment['ASAN_SYMBOLIZER_PATH'] = config.llvm_symbolizer_path # Define CHECK-%os to check for OS-dependent output. config.substitutions.append( ('CHECK-%os', ("CHECK-" + config.host_os))) diff --git a/compiler-rt/lib/lit.common.cfg b/compiler-rt/lib/lit.common.cfg index dd67295e9428..b19d68708e9c 100644 --- a/compiler-rt/lib/lit.common.cfg +++ b/compiler-rt/lib/lit.common.cfg @@ -40,6 +40,9 @@ if (not llvm_tools_dir) or (not os.path.exists(llvm_tools_dir)): path = os.path.pathsep.join((llvm_tools_dir, config.environment['PATH'])) config.environment['PATH'] = path +# Define path to external llvm-symbolizer tool. +config.llvm_symbolizer_path = os.path.join(llvm_tools_dir, "llvm-symbolizer") + # Use ugly construction to explicitly prohibit "clang", "clang++" etc. # in RUN lines. config.substitutions.append( diff --git a/compiler-rt/lib/lsan/lit_tests/lit.common.cfg b/compiler-rt/lib/lsan/lit_tests/lit.common.cfg index cf5ccd50932d..dfae8db4c890 100644 --- a/compiler-rt/lib/lsan/lit_tests/lit.common.cfg +++ b/compiler-rt/lib/lsan/lit_tests/lit.common.cfg @@ -12,10 +12,6 @@ def get_required_attr(config, attr_name): "to lit.site.cfg " % attr_name) return attr_value -# Setup path to external LLVM symbolizer to run LeakSanitizer output tests. -llvm_tools_dir = get_required_attr(config, 'llvm_tools_dir') -config.llvm_symbolizer_path = os.path.join(llvm_tools_dir, "llvm-symbolizer") - # Setup source root. lsan_lit_src_root = get_required_attr(config, 'lsan_lit_src_root') config.test_source_root = os.path.join(lsan_lit_src_root, 'TestCases') diff --git a/compiler-rt/lib/msan/lit_tests/lit.cfg b/compiler-rt/lib/msan/lit_tests/lit.cfg index e047a261a9fe..0a39626a3c4f 100644 --- a/compiler-rt/lib/msan/lit_tests/lit.cfg +++ b/compiler-rt/lib/msan/lit_tests/lit.cfg @@ -63,10 +63,7 @@ config.substitutions.append( ("%clangxx_msan ", " ") ) # Setup path to external LLVM symbolizer to run MemorySanitizer output tests. -llvm_tools_dir = getattr(config, 'llvm_tools_dir', None) -if llvm_tools_dir: - llvm_symbolizer_path = os.path.join(llvm_tools_dir, "llvm-symbolizer") - config.environment['MSAN_SYMBOLIZER_PATH'] = llvm_symbolizer_path +config.environment['MSAN_SYMBOLIZER_PATH'] = config.llvm_symbolizer_path # Default test suffixes. config.suffixes = ['.c', '.cc', '.cpp'] diff --git a/compiler-rt/lib/tsan/lit_tests/lit.cfg b/compiler-rt/lib/tsan/lit_tests/lit.cfg index 6dc465437fdc..af78828bd67b 100644 --- a/compiler-rt/lib/tsan/lit_tests/lit.cfg +++ b/compiler-rt/lib/tsan/lit_tests/lit.cfg @@ -50,11 +50,8 @@ if llvm_src_root is None: # Setup environment variables for running ThreadSanitizer. tsan_options = "atexit_sleep_ms=0" -# Get path to external LLVM symbolizer to run ThreadSanitizer output tests. -llvm_tools_dir = getattr(config, 'llvm_tools_dir', None) -if llvm_tools_dir: - llvm_symbolizer_path = os.path.join(llvm_tools_dir, "llvm-symbolizer") - tsan_options += " " + "external_symbolizer_path=" + llvm_symbolizer_path +# Set path to external LLVM symbolizer to run ThreadSanitizer output tests. +tsan_options += " " + "external_symbolizer_path=" + config.llvm_symbolizer_path config.environment['TSAN_OPTIONS'] = tsan_options