diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/profile/instrprof-dlopen.test | 4 | ||||
-rw-r--r-- | test/profile/lit.cfg | 10 |
2 files changed, 9 insertions, 5 deletions
diff --git a/test/profile/instrprof-dlopen.test b/test/profile/instrprof-dlopen.test index f0c067fb4..ba386e347 100644 --- a/test/profile/instrprof-dlopen.test +++ b/test/profile/instrprof-dlopen.test @@ -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 diff --git a/test/profile/lit.cfg b/test/profile/lit.cfg index 6e53b5033..8a847ae3e 100644 --- a/test/profile/lit.cfg +++ b/test/profile/lit.cfg @@ -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 |