[compiler-rt] r219227 - Run profile tests on FreeBSD

Ed Maste emaste at freebsd.org
Tue Oct 7 12:24:24 PDT 2014


Author: emaste
Date: Tue Oct  7 14:24:24 2014
New Revision: 219227

URL: http://llvm.org/viewvc/llvm-project?rev=219227&view=rev
Log:
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

Modified:
    compiler-rt/trunk/test/profile/instrprof-dlopen.test
    compiler-rt/trunk/test/profile/lit.cfg

Modified: compiler-rt/trunk/test/profile/instrprof-dlopen.test
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/profile/instrprof-dlopen.test?rev=219227&r1=219226&r2=219227&view=diff
==============================================================================
--- compiler-rt/trunk/test/profile/instrprof-dlopen.test (original)
+++ compiler-rt/trunk/test/profile/instrprof-dlopen.test Tue Oct  7 14:24:24 2014
@@ -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

Modified: compiler-rt/trunk/test/profile/lit.cfg
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/profile/lit.cfg?rev=219227&r1=219226&r2=219227&view=diff
==============================================================================
--- compiler-rt/trunk/test/profile/lit.cfg (original)
+++ compiler-rt/trunk/test/profile/lit.cfg Tue Oct  7 14:24:24 2014
@@ -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',
 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 ",
 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





More information about the llvm-commits mailing list