Index: test/asan/lit.cfg =================================================================== --- test/asan/lit.cfg +++ test/asan/lit.cfg @@ -101,7 +101,18 @@ config.substitutions.append( ("%clangxx ", build_invocation(target_cxxflags)) ) config.substitutions.append( ("%clang_asan ", build_invocation(clang_asan_cflags)) ) config.substitutions.append( ("%clangxx_asan ", build_invocation(clang_asan_cxxflags)) ) -config.substitutions.append( ("%shared_libasan", "libclang_rt.asan%s.so" % config.target_suffix)) +if config.host_os == 'Linux': + # FIXME: This should be an absolute path! + config.substitutions.append( ("%shared_libasan", "libclang_rt.asan%s.so" % config.target_suffix)) +elif config.host_os == 'Darwin': + shared_libasan_path = os.path.join( + config.compiler_rt_libdir, + 'libclang_rt.asan_{}_dynamic.dylib'.format( + config.apple_platform + ) + ) + config.substitutions.append( ("%shared_libasan", shared_libasan_path) ) + if config.asan_dynamic: config.substitutions.append( ("%clang_asan_static ", build_invocation(clang_asan_static_cflags)) ) config.substitutions.append( ("%clangxx_asan_static ", build_invocation(clang_asan_static_cxxflags)) )