diff options
author | Zsolt Parragi <zsolt.parragi@cancellar.hu> | 2019-08-13 12:29:48 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-08-30 15:30:38 (GMT) |
commit | c856d4556b4ec28cb818ef3c7aca1e4a30e0499d (patch) | |
tree | af46514551c74f62952d3d2d5cf2ca34171f9a1c /Tests/Module/CheckIPOSupported-C | |
parent | 079b8e29168dc081f37f79f3577a5c0690bb7051 (diff) | |
download | CMake-c856d4556b4ec28cb818ef3c7aca1e4a30e0499d.zip CMake-c856d4556b4ec28cb818ef3c7aca1e4a30e0499d.tar.gz CMake-c856d4556b4ec28cb818ef3c7aca1e4a30e0499d.tar.bz2 |
bindexplib: supporting llvm bitcode formats using llvm-nm
Diffstat (limited to 'Tests/Module/CheckIPOSupported-C')
-rw-r--r-- | Tests/Module/CheckIPOSupported-C/CMakeLists.txt | 12 | ||||
-rw-r--r-- | Tests/Module/CheckIPOSupported-C/bar.c | 4 | ||||
-rw-r--r-- | Tests/Module/CheckIPOSupported-C/main.c | 3 |
3 files changed, 17 insertions, 2 deletions
diff --git a/Tests/Module/CheckIPOSupported-C/CMakeLists.txt b/Tests/Module/CheckIPOSupported-C/CMakeLists.txt index 4a41a98..c5cd03e 100644 --- a/Tests/Module/CheckIPOSupported-C/CMakeLists.txt +++ b/Tests/Module/CheckIPOSupported-C/CMakeLists.txt @@ -13,8 +13,18 @@ elseif(CMake_TEST_IPO_WORKS_C) endif() add_library(foo foo.c) +if(NOT CYGWIN AND (NOT WIN32 OR "x${CMAKE_C_COMPILER_ID}" STREQUAL "xClang")) + add_library(bar SHARED bar.c) + if(WIN32) + # Bindexplib for clang supports LTO objects + set_target_properties(bar PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON) + endif() +else() + # TODO: bindexplib doesn't support exporting IPO symbols with other compilers on Windows + add_library(bar STATIC bar.c) +endif() add_executable(CheckIPOSupported-C main.c) -target_link_libraries(CheckIPOSupported-C PUBLIC foo) +target_link_libraries(CheckIPOSupported-C PUBLIC foo bar) enable_testing() add_test(NAME CheckIPOSupported-C COMMAND CheckIPOSupported-C) diff --git a/Tests/Module/CheckIPOSupported-C/bar.c b/Tests/Module/CheckIPOSupported-C/bar.c new file mode 100644 index 0000000..680f213 --- /dev/null +++ b/Tests/Module/CheckIPOSupported-C/bar.c @@ -0,0 +1,4 @@ +int bar() +{ + return 0x42; +} diff --git a/Tests/Module/CheckIPOSupported-C/main.c b/Tests/Module/CheckIPOSupported-C/main.c index 99204ab..28ab26f 100644 --- a/Tests/Module/CheckIPOSupported-C/main.c +++ b/Tests/Module/CheckIPOSupported-C/main.c @@ -1,8 +1,9 @@ int foo(); +int bar(); int main() { - if (foo() == 0) { + if (foo() != bar()) { return 1; } return 0; |