[llvm] r277788 - [LIT][Darwin] Change %ld64 to be prefixed with DYLD_INSERT_LIBRARIES
Bruno Cardoso Lopes via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 4 16:58:31 PDT 2016
Author: bruno
Date: Thu Aug 4 18:58:30 2016
New Revision: 277788
URL: http://llvm.org/viewvc/llvm-project?rev=277788&view=rev
Log:
[LIT][Darwin] Change %ld64 to be prefixed with DYLD_INSERT_LIBRARIES
Followup from r277778, after Mehdi's comments.
Expand %ld64 to perform the necessary preload instead, that way new
tests do not need to worry about setting up DYLD_INSERT_LIBRARIES
themselves.
rdar://problem/24300926
Modified:
llvm/trunk/test/lit.cfg
llvm/trunk/test/tools/lto/hide-linkonce-odr.ll
llvm/trunk/test/tools/lto/opt-level.ll
Modified: llvm/trunk/test/lit.cfg
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/lit.cfg?rev=277788&r1=277787&r2=277788&view=diff
==============================================================================
--- llvm/trunk/test/lit.cfg (original)
+++ llvm/trunk/test/lit.cfg Thu Aug 4 18:58:30 2016
@@ -210,7 +210,6 @@ config.substitutions.append( ('%llc_dwar
# Add site-specific substitutions.
config.substitutions.append( ('%gold', config.gold_executable) )
-config.substitutions.append( ('%ld64', config.ld64_executable) )
config.substitutions.append( ('%go', config.go_executable) )
config.substitutions.append( ('%llvmshlibdir', config.llvm_shlib_dir) )
config.substitutions.append( ('%shlibext', config.llvm_shlib_ext) )
@@ -221,7 +220,11 @@ config.substitutions.append( ('%host_cc'
# Provide the path to asan runtime lib if available. On darwin, this lib needs
# to be loaded via DYLD_INSERT_LIBRARIES before libLTO.dylib in case the files
# to be linked contain instrumented sanitizer code.
-config.substitutions.append( ('%asanrtlib', get_asan_rtlib()) )
+ld64_cmd = config.ld64_executable
+asan_rtlib = get_asan_rtlib()
+if asan_rtlib:
+ ld64_cmd = "DYLD_INSERT_LIBRARIES={} {}".format(asan_rtlib, ld64_cmd)
+config.substitutions.append( ('%ld64', ld64_cmd) )
# OCaml substitutions.
# Support tests for both native and bytecode builds.
Modified: llvm/trunk/test/tools/lto/hide-linkonce-odr.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/lto/hide-linkonce-odr.ll?rev=277788&r1=277787&r2=277788&view=diff
==============================================================================
--- llvm/trunk/test/tools/lto/hide-linkonce-odr.ll (original)
+++ llvm/trunk/test/tools/lto/hide-linkonce-odr.ll Thu Aug 4 18:58:30 2016
@@ -1,5 +1,5 @@
; RUN: llvm-as %s -o %t.o
-; RUN: DYLD_INSERT_LIBRARIES=%asanrtlib %ld64 -lto_library %llvmshlibdir/libLTO.dylib -dylib -arch x86_64 -macosx_version_min 10.10.0 -lSystem -o %t.dylib %t.o -save-temps -undefined dynamic_lookup -exported_symbol _c -exported_symbol _b -exported_symbol _GlobLinkonce
+; RUN: %ld64 -lto_library %llvmshlibdir/libLTO.dylib -dylib -arch x86_64 -macosx_version_min 10.10.0 -lSystem -o %t.dylib %t.o -save-temps -undefined dynamic_lookup -exported_symbol _c -exported_symbol _b -exported_symbol _GlobLinkonce
; RUN: llvm-dis %t.dylib.lto.opt.bc -o - | FileCheck --check-prefix=IR %s
; check that @a is no longer a linkonce_odr definition
Modified: llvm/trunk/test/tools/lto/opt-level.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/lto/opt-level.ll?rev=277788&r1=277787&r2=277788&view=diff
==============================================================================
--- llvm/trunk/test/tools/lto/opt-level.ll (original)
+++ llvm/trunk/test/tools/lto/opt-level.ll Thu Aug 4 18:58:30 2016
@@ -1,7 +1,7 @@
; RUN: llvm-as %s -o %t.o
-; RUN: DYLD_INSERT_LIBRARIES=%asanrtlib %ld64 -lto_library %llvmshlibdir/libLTO.dylib -arch x86_64 -dylib -mllvm -O0 -o %t.dylib %t.o
+; RUN: %ld64 -lto_library %llvmshlibdir/libLTO.dylib -arch x86_64 -dylib -mllvm -O0 -o %t.dylib %t.o
; RUN: llvm-nm -no-llvm-bc %t.dylib | FileCheck --check-prefix=CHECK-O0 %s
-; RUN: DYLD_INSERT_LIBRARIES=%asanrtlib %ld64 -lto_library %llvmshlibdir/libLTO.dylib -arch x86_64 -dylib -mllvm -O2 -o %t.dylib %t.o
+; RUN: %ld64 -lto_library %llvmshlibdir/libLTO.dylib -arch x86_64 -dylib -mllvm -O2 -o %t.dylib %t.o
; RUN: llvm-nm -no-llvm-bc %t.dylib | FileCheck --check-prefix=CHECK-O2 %s
target triple = "x86_64-apple-macosx10.8.0"
More information about the llvm-commits
mailing list