Skip to content

Commit bc8e442

Browse files
committed
[test] Disable the Passes/PluginsTest cases on windows with BUILD_SHARED_LIBS
The plugin expects to have undefined references to symbols exported by the loading process, which isn't supported by shared libraries on windows. Differential Revision: https://reviews.llvm.org/D74042
1 parent e4e9e10 commit bc8e442

File tree

1 file changed

+24
-18
lines changed

1 file changed

+24
-18
lines changed

llvm/unittests/Passes/CMakeLists.txt

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,30 @@ if (LLVM_ENABLE_PLUGINS)
77
add_definitions(-DLLVM_ENABLE_PLUGINS)
88
endif()
99

10-
set(LLVM_LINK_COMPONENTS Support Passes Core)
11-
add_llvm_unittest(PluginsTests
12-
PluginsTest.cpp
13-
)
14-
export_executable_symbols(PluginsTests)
15-
target_link_libraries(PluginsTests PRIVATE LLVMTestingSupport)
10+
# The plugin expects to not link against the Support and Core libraries,
11+
# but expects them to exist in the process loading the plugin. This doesn't
12+
# work with DLLs on Windows (where a shared library can't have undefined
13+
# references), so just skip this testcase on Windows.
14+
if (NOT WIN32)
15+
set(LLVM_LINK_COMPONENTS Support Passes Core)
16+
add_llvm_unittest(PluginsTests
17+
PluginsTest.cpp
18+
)
19+
export_executable_symbols(PluginsTests)
20+
target_link_libraries(PluginsTests PRIVATE LLVMTestingSupport)
1621

17-
set(LLVM_LINK_COMPONENTS)
18-
add_llvm_library(TestPlugin MODULE BUILDTREE_ONLY
19-
TestPlugin.cpp
20-
)
22+
set(LLVM_LINK_COMPONENTS)
23+
add_llvm_library(TestPlugin MODULE BUILDTREE_ONLY
24+
TestPlugin.cpp
25+
)
2126

22-
# Put plugin next to the unit test executable.
23-
set_output_directory(TestPlugin
24-
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}
25-
LIBRARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}
26-
)
27-
set_target_properties(TestPlugin PROPERTIES FOLDER "Tests")
27+
# Put plugin next to the unit test executable.
28+
set_output_directory(TestPlugin
29+
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}
30+
LIBRARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}
31+
)
32+
set_target_properties(TestPlugin PROPERTIES FOLDER "Tests")
2833

29-
add_dependencies(TestPlugin intrinsics_gen)
30-
add_dependencies(PluginsTests TestPlugin)
34+
add_dependencies(TestPlugin intrinsics_gen)
35+
add_dependencies(PluginsTests TestPlugin)
36+
endif()

0 commit comments

Comments
 (0)