Index: test/profile/instrprof-dlopen.test =================================================================== --- test/profile/instrprof-dlopen.test +++ 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 Index: test/profile/lit.cfg =================================================================== --- test/profile/lit.cfg +++ test/profile/lit.cfg @@ -24,6 +24,10 @@ lit_config.load_config(config, site_cfg) raise SystemExit +# FreeBSD does not have libdl +if config.host_os != 'FreeBSD': + extra_linkflags += ["-ldl"] + # Test suffixes. config.suffixes = ['.c', '.cc', '.cpp', '.m', '.mm', '.ll', '.test'] @@ -41,6 +45,5 @@ 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