1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 12:12:47 +01:00

[examples] Skip building the Bye pass plugin on windows

Windows doesn't properly support pass plugins (as a shared library
can't have undefined references, which pass plugins assume, being
loaded into a host process that contains provides them), thus
disable building it and the corresponding test.

This matches what was done for the passes unit test in
bc8e44218810c0db6328b9809c959ceb7d43e3f5.

Differential Revision: https://reviews.llvm.org/D79771
This commit is contained in:
Martin Storsjö 2020-05-12 11:54:51 +03:00
parent 2b68172fec
commit f96eecf20b
3 changed files with 20 additions and 9 deletions

View File

@ -2,12 +2,18 @@ if(LLVM_BYE_LINK_INTO_TOOLS)
message(WARNING "Setting LLVM_BYE_LINK_INTO_TOOLS=ON only makes sense for testing purpose")
endif()
add_llvm_pass_plugin(Bye
Bye.cpp
DEPENDS
intrinsics_gen
BUILDTREE_ONLY
)
# The plugin expects to not link against the Support and Core libraries,
# 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 example on Windows.
if (NOT WIN32)
add_llvm_pass_plugin(Bye
Bye.cpp
DEPENDS
intrinsics_gen
BUILDTREE_ONLY
)
install(TARGETS ${name} RUNTIME DESTINATION examples)
set_target_properties(${name} PROPERTIES FOLDER "Examples")
install(TARGETS ${name} RUNTIME DESTINATION examples)
set_target_properties(${name} PROPERTIES FOLDER "Examples")
endif()

View File

@ -144,13 +144,17 @@ endif()
if(LLVM_BUILD_EXAMPLES)
list(APPEND LLVM_TEST_DEPENDS
Bye
Kaleidoscope-Ch3
Kaleidoscope-Ch4
Kaleidoscope-Ch5
Kaleidoscope-Ch6
Kaleidoscope-Ch7
)
if (NOT WIN32)
list(APPEND LLVM_TEST_DEPENDS
Bye
)
endif()
endif()
if(TARGET ocaml_llvm)

View File

@ -6,6 +6,7 @@
; RUN: llvm-lto2 run %t.o %loadbye %loadnewpmbye -wave-goodbye -use-new-pm -o %t -r %t.o,somefunk,plx -r %t.o,junk,plx 2>&1 | FileCheck %s
; RUN: llvm-lto2 run %t.o %loadbye %loadnewpmbye -opt-pipeline="goodbye" -wave-goodbye -use-new-pm -o %t -r %t.o,somefunk,plx -r %t.o,junk,plx 2>&1 | FileCheck %s
; REQUIRES: plugins, examples
; UNSUPPORTED: windows
; CHECK: Bye
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"