Index: llvm/test/lit.cfg.py =================================================================== --- llvm/test/lit.cfg.py +++ llvm/test/lit.cfg.py @@ -240,6 +240,14 @@ if not config.build_shared_libs and not config.link_llvm_dylib: config.available_features.add('static-libs') +if config.link_llvm_dylib: + config.available_features.add('llvm-dylib') + config.substitutions.append( + ('%llvmdylib', + '{}/libLLVM-{}{}'.format(config.llvm_shlib_dir, + config.llvm_dylib_version, + config.llvm_shlib_ext))) + if config.have_tf_aot: config.available_features.add("have_tf_aot") Index: llvm/test/lit.site.cfg.py.in =================================================================== --- llvm/test/lit.site.cfg.py.in +++ llvm/test/lit.site.cfg.py.in @@ -45,6 +45,7 @@ config.enable_threads = @LLVM_ENABLE_THREADS@ config.build_shared_libs = @BUILD_SHARED_LIBS@ config.link_llvm_dylib = @LLVM_LINK_LLVM_DYLIB@ +config.llvm_dylib_version = "@LLVM_VERSION_MAJOR@@LLVM_VERSION_SUFFIX@" config.llvm_host_triple = '@LLVM_HOST_TRIPLE@' config.host_arch = "@HOST_ARCH@" config.have_opt_viewer_modules = @LLVM_HAVE_OPT_VIEWER_MODULES@ Index: llvm/test/tools/llvm-shlib/typeids.test =================================================================== --- /dev/null +++ llvm/test/tools/llvm-shlib/typeids.test @@ -0,0 +1,14 @@ +# Make sure there's no llvm::Any::TypeId symbol local to the shared library. +# That would cause non-unicity of the adresses used as unique identifier for +# each type when another library is linked in with default visibility (weak) +# for llvm::Any::TypeId. +# This happens when llvm::Any::TypeId is parametrized by a type with +# hidden visibility. + +# RUN: llvm-nm -C %llvmdylib | FileCheck %s +# RUN: llvm-nm -C %llvmdylib | FileCheck %s --check-prefix=SAFETY-CHECK +# +# CHECK-NOT: {{[^V]}} llvm::Any::TypeId +# SAFETY-CHECK: V llvm::Any::TypeId +# +# REQUIRES: x86_64-linux, llvm-dylib