diff options
| author | Alexey Samsonov <samsonov@google.com> | 2012-09-28 11:05:41 +0000 |
|---|---|---|
| committer | Alexey Samsonov <samsonov@google.com> | 2012-09-28 11:05:41 +0000 |
| commit | 2d9899b2cee703d102dcaa79887e46692f15162d (patch) | |
| tree | 7a482497f41f7b2563053210a0975e9db84b25cb | |
| parent | 255dea4b90a622d2912ab0986a245a930dccc1fb (diff) | |
| download | bcm5719-llvm-2d9899b2cee703d102dcaa79887e46692f15162d.tar.gz bcm5719-llvm-2d9899b2cee703d102dcaa79887e46692f15162d.zip | |
[ASan] use llvm-symbolizer (in offline mode) in ASan output tests on Linux
llvm-svn: 164819
| -rw-r--r-- | compiler-rt/lib/asan/lit_tests/CMakeLists.txt | 3 | ||||
| -rw-r--r-- | compiler-rt/lib/asan/lit_tests/lit.cfg | 9 | ||||
| -rw-r--r-- | compiler-rt/lib/asan/lit_tests/lit.site.cfg.in | 1 |
3 files changed, 13 insertions, 0 deletions
diff --git a/compiler-rt/lib/asan/lit_tests/CMakeLists.txt b/compiler-rt/lib/asan/lit_tests/CMakeLists.txt index e08a84a0221..c230ff52c49 100644 --- a/compiler-rt/lib/asan/lit_tests/CMakeLists.txt +++ b/compiler-rt/lib/asan/lit_tests/CMakeLists.txt @@ -18,6 +18,9 @@ if("${CMAKE_HOST_SYSTEM}" STREQUAL "${CMAKE_SYSTEM}") clang clang-headers FileCheck count not llvm-nm ${ASAN_RUNTIME_LIBRARIES} ) + if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") + list(APPEND ASAN_TEST_DEPS llvm-symbolizer) + endif() set(ASAN_TEST_PARAMS asan_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg ) diff --git a/compiler-rt/lib/asan/lit_tests/lit.cfg b/compiler-rt/lib/asan/lit_tests/lit.cfg index 54ad92e3524..0ab424e049f 100644 --- a/compiler-rt/lib/asan/lit_tests/lit.cfg +++ b/compiler-rt/lib/asan/lit_tests/lit.cfg @@ -68,6 +68,15 @@ clang_asan_cxxflags = ("-ccc-clang-cxx " config.substitutions.append( ("%clangxx_asan ", (" " + config.clang + " " + clang_asan_cxxflags + " ")) ) +# Setup path to external LLVM symbolizer to run AddressSanitizer output tests. +# Currently llvm-symbolizer is supported on Linux only. +if config.host_os == 'Linux': + llvm_obj_root = getattr(config, 'llvm_obj_root', None) + if llvm_obj_root: + config.environment['LLVM_SYMBOLIZER_PATH'] = os.path.join( + config.llvm_obj_root, "projects", "compiler-rt", "utils", + "llvm-symbolizer", "llvm-symbolizer") + # Setup path to symbolizer script. # FIXME: Instead we should copy this script to the build tree and point # at it there. diff --git a/compiler-rt/lib/asan/lit_tests/lit.site.cfg.in b/compiler-rt/lib/asan/lit_tests/lit.site.cfg.in index 89956e6e35a..cf439309c6a 100644 --- a/compiler-rt/lib/asan/lit_tests/lit.site.cfg.in +++ b/compiler-rt/lib/asan/lit_tests/lit.site.cfg.in @@ -4,6 +4,7 @@ config.target_triple = "@TARGET_TRIPLE@" config.host_os = "@HOST_OS@" config.llvm_src_root = "@LLVM_SOURCE_DIR@" +config.llvm_obj_root = "@LLVM_BINARY_DIR@" config.llvm_tools_dir = "@LLVM_TOOLS_DIR@" config.clang = "@LLVM_BINARY_DIR@/bin/clang" |

