summaryrefslogtreecommitdiff
path: root/Tests/Assembler
diff options
context:
space:
mode:
authorTom Stellard <tstellar@redhat.com>2022-06-30 22:29:18 +0000
committerTom Stellard <tstellar@redhat.com>2022-06-30 22:29:18 +0000
commit01d05985fdb2deeafb4cb805d6c7d3db4a40384d (patch)
treebf78d3baa65c1d588e7aba9495d7ac8657e813e1 /Tests/Assembler
parent7375542615e0c1d3d09117eac3a9e201275da425 (diff)
downloadcmake-01d05985fdb2deeafb4cb805d6c7d3db4a40384d.tar.gz
Tests: Pass -fno-lto to the Assembler test when using clang
Diffstat (limited to 'Tests/Assembler')
-rw-r--r--Tests/Assembler/CMakeLists.txt6
1 files changed, 6 insertions, 0 deletions
diff --git a/Tests/Assembler/CMakeLists.txt b/Tests/Assembler/CMakeLists.txt
index 1b7e57d28c..8f6b355686 100644
--- a/Tests/Assembler/CMakeLists.txt
+++ b/Tests/Assembler/CMakeLists.txt
@@ -24,6 +24,12 @@ if("${CMAKE_GENERATOR}" MATCHES "Makefile|Xcode|Ninja" AND
elseif("${CMAKE_SYSTEM_NAME};${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "Darwin;arm64")
list(APPEND C_FLAGS -arch arm64)
endif()
+ if(CMAKE_C_COMPILER_ID STREQUAL "Clang")
+ # Just in case the user is passing -flto, we need to pass -fno-lto to
+ # clang when generating the assembly file, or else clang will generate
+ # LLVM IR instead of assembly.
+ list(APPEND C_FLAGS -fno-lto)
+ endif()
# Clang on OS X, and perhaps other compilers, do not support -g
# for both generating and assembling, so drop it from generating.
list(REMOVE_ITEM C_FLAGS -g)