[PATCH] D109252: Add extra check for llvm::Any::TypeId visibility
serge via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 14 13:13:00 PDT 2021
serge-sans-paille updated this revision to Diff 372546.
serge-sans-paille added a comment.
Update test comment
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D109252/new/
https://reviews.llvm.org/D109252
Files:
llvm/test/lit.cfg.py
llvm/test/lit.site.cfg.py.in
llvm/test/tools/llvm-shlib/typeids.test
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. As
+# the adress of llvm::Any::TypeId::Id is used as a global unique identifier for
+# each type, having another visibility defeats the original purpose.
+#
+# 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
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/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")
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D109252.372546.patch
Type: text/x-patch
Size: 1989 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210914/d8bbcfdf/attachment.bin>
More information about the llvm-commits
mailing list