[PATCH] D74042: [test] Disable the Passes/PluginsTest cases on windows with BUILD_SHARED_LIBS

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 5 05:04:52 PST 2020


mstorsjo created this revision.
mstorsjo added reviewers: thakis, rnk, smeenai.
Herald added a subscriber: mgorny.
Herald added a project: LLVM.

The plugin expects to have undefined references to symbols exported by the loading process, which isn't supported by shared libraries on windows.

As far as I see, the test is pratically disabled in these configurations anyway, but the test plugin is still built, which fails when BUILD_SHARED_LIBS is enabled (which can be enabled in mingw configurations even though it can't be enabled in MSVC mode).

Or should we just disable the whole directory unconditionally on Windows, as the test is a no-op even in the configurations where it is built?


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D74042

Files:
  llvm/unittests/Passes/CMakeLists.txt


Index: llvm/unittests/Passes/CMakeLists.txt
===================================================================
--- llvm/unittests/Passes/CMakeLists.txt
+++ llvm/unittests/Passes/CMakeLists.txt
@@ -7,6 +7,15 @@
   add_definitions(-DLLVM_ENABLE_PLUGINS)
 endif()
 
+# The plugin expects to not link against the Support and Core libraries
+# (otherwise there are multiple definitions of the same command line option
+# in the binary), but expects them to exist in the process loading the plugin.
+# This doesn't work with DLLs on Windows (where a shared library can't have
+# undefined references), so just skip this testcase in such configurations.
+if (WIN32 AND BUILD_SHARED_LIBS)
+  return()
+endif()
+
 set(LLVM_LINK_COMPONENTS Support Passes Core)
 add_llvm_unittest(PluginsTests
   PluginsTest.cpp


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D74042.242561.patch
Type: text/x-patch
Size: 803 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200205/09e8aca7/attachment-0001.bin>


More information about the llvm-commits mailing list