Run profile tests on FreeBSD

FreeBSD does not have libdl, so set it via lit.cfg instead of the test
input, as with asan.  Also remove it from Darwin test runs - it's not
necessary, but harmless there.

Add FreeBSD to the list of hosts to test.

Differential Revision: http://reviews.llvm.org/D5650

llvm-svn: 219227
This commit is contained in:
Ed Maste 2014-10-07 19:24:24 +00:00
parent d2c7fd8207
commit 1419e9adb5
2 changed files with 9 additions and 5 deletions

View File

@ -1,8 +1,8 @@
RUN: mkdir -p %t.d
RUN: %clang_profgen -o %t.d/func.shared -fPIC -shared %S/Inputs/instrprof-dlopen-func.c
RUN: %clang_profgen -o %t.d/func2.shared -fPIC -shared %S/Inputs/instrprof-dlopen-func2.c
RUN: %clang -o %t-local -fPIC -DDLOPEN_FUNC_DIR=\"%t.d\" -DDLOPEN_FLAGS="RTLD_LAZY | RTLD_LOCAL" %S/Inputs/instrprof-dlopen-main.c -ldl
RUN: %clang -o %t-global -fPIC -DDLOPEN_FUNC_DIR=\"%t.d\" -DDLOPEN_FLAGS="RTLD_LAZY | RTLD_GLOBAL" %S/Inputs/instrprof-dlopen-main.c -ldl
RUN: %clang -o %t-local -fPIC -DDLOPEN_FUNC_DIR=\"%t.d\" -DDLOPEN_FLAGS="RTLD_LAZY | RTLD_LOCAL" %S/Inputs/instrprof-dlopen-main.c
RUN: %clang -o %t-global -fPIC -DDLOPEN_FUNC_DIR=\"%t.d\" -DDLOPEN_FLAGS="RTLD_LAZY | RTLD_GLOBAL" %S/Inputs/instrprof-dlopen-main.c
RUN: %clang -c -o %t.d/main.o %S/Inputs/instrprof-dlopen-main.c
RUN: %clang_profgen -o %t-static %S/Inputs/instrprof-dlopen-func.c %S/Inputs/instrprof-dlopen-func2.c %t.d/main.o

View File

@ -24,6 +24,11 @@ if config.test_exec_root is None:
lit_config.load_config(config, site_cfg)
raise SystemExit
if config.host_os in ['Linux']:
extra_linkflags = ["-ldl"]
else:
extra_linkflags = []
# Test suffixes.
config.suffixes = ['.c', '.cc', '.cpp', '.m', '.mm', '.ll', '.test']
@ -31,7 +36,7 @@ config.suffixes = ['.c', '.cc', '.cpp', '.m', '.mm', '.ll', '.test']
config.excludes = ['Inputs']
# Clang flags.
clang_cflags = [config.target_cflags]
clang_cflags = [config.target_cflags] + extra_linkflags
def build_invocation(compile_flags):
return " " + " ".join([config.clang] + compile_flags) + " "
@ -41,6 +46,5 @@ config.substitutions.append( ("%clang ", build_invocation(clang_cflags)) )
config.substitutions.append( ("%clang_profgen ", build_invocation(clang_cflags) + " -fprofile-instr-generate ") )
config.substitutions.append( ("%clang_profuse=", build_invocation(clang_cflags) + " -fprofile-instr-use=") )
# Profile tests are currently supported on Linux and Darwin only.
if config.host_os not in ['Linux', 'Darwin']:
if config.host_os not in ['Darwin', 'FreeBSD', 'Linux']:
config.unsupported = True