diff options
author | Vitaly Buka <vitalybuka@google.com> | 2019-10-08 20:50:46 +0000 |
---|---|---|
committer | Vitaly Buka <vitalybuka@google.com> | 2019-10-08 20:50:46 +0000 |
commit | d8c3df27dea12cca769a430033dd5a411f296b1b (patch) | |
tree | 97ba4ea8c994a6366fc9ae30a44fc18b7d97e512 /test/sanitizer_common | |
parent | fc749b5cf3d06d3940f04fe69b7d3c66ca8a9368 (diff) | |
download | compiler-rt-d8c3df27dea12cca769a430033dd5a411f296b1b.tar.gz |
[sanitizer] Fix crypt.cpp test on Darwin
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@374115 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/sanitizer_common')
-rw-r--r-- | test/sanitizer_common/TestCases/Posix/crypt.cpp | 2 | ||||
-rw-r--r-- | test/sanitizer_common/lit.common.cfg.py | 9 |
2 files changed, 7 insertions, 4 deletions
diff --git a/test/sanitizer_common/TestCases/Posix/crypt.cpp b/test/sanitizer_common/TestCases/Posix/crypt.cpp index ff86aced5..ff2626408 100644 --- a/test/sanitizer_common/TestCases/Posix/crypt.cpp +++ b/test/sanitizer_common/TestCases/Posix/crypt.cpp @@ -1,4 +1,4 @@ -// RUN: %clangxx -O0 -g %s -o %t -lcrypt && %run %t +// RUN: %clangxx -O0 -g %s -o %t && %run %t // crypt is missing from Android. // UNSUPPORTED: android diff --git a/test/sanitizer_common/lit.common.cfg.py b/test/sanitizer_common/lit.common.cfg.py index 5f4f2d892..e23a8ce0d 100644 --- a/test/sanitizer_common/lit.common.cfg.py +++ b/test/sanitizer_common/lit.common.cfg.py @@ -46,10 +46,13 @@ if default_tool_options_str: config.environment[tool_options] = default_tool_options_str default_tool_options_str += ':' +extra_link_flags = [] + if config.host_os in ['Linux']: - extra_link_flags = ["-ldl"] -else: - extra_link_flags = [] + extra_link_flags += ["-ldl"] + +if config.host_os in ['Linux', 'NetBSD', 'FreeBSD']: + extra_link_flags += ["-lcrypt"] clang_cflags = config.debug_info_flags + tool_cflags + [config.target_cflags] clang_cflags += extra_link_flags |