[CMake] Only set LLVM_DEFAULT_TARGET_TRIPLE to LLVM_HOST_TRIPLE when native target is enabled
This is for case when native target like X86 is not in LLVM_TARGETS_TO_BUILD. Right now LLVM_DEFAULT_TARGET_TRIPLE is set to LLVM_HOST_TRIPLE even when native target is not enabled, As a result, many lit tests will fail because default_triple is set for lit test but not enabled when build LLVM. Reviewed By: smeenai Differential Revision: https://reviews.llvm.org/D134972
This commit is contained in:
parent
35a870c30a
commit
4ec7dff27d
|
@ -837,8 +837,11 @@ include(config-ix)
|
|||
if("${LLVM_HOST_TRIPLE}" MATCHES "^powerpc64-ibm-aix")
|
||||
string(REGEX REPLACE "^powerpc64" "powerpc" LLVM_DEFAULT_TARGET_TRIPLE_default "${LLVM_HOST_TRIPLE}")
|
||||
else()
|
||||
# Only set default triple when native target is enabled.
|
||||
if (LLVM_NATIVE_TARGET)
|
||||
set(LLVM_DEFAULT_TARGET_TRIPLE_default "${LLVM_HOST_TRIPLE}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(LLVM_DEFAULT_TARGET_TRIPLE "${LLVM_DEFAULT_TARGET_TRIPLE_default}" CACHE STRING
|
||||
"Default target for which LLVM will generate code." )
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
# This test makes sure that the example builds and executes as expected.
|
||||
# Instructions for debugging can be found in LLJITWithRemoteDebugging.cpp
|
||||
|
||||
# REQUIRES: default_triple
|
||||
|
||||
# RUN: LLJITWithRemoteDebugging %p/Inputs/argc_sub1_elf.ll | FileCheck --check-prefix=CHECK0 %s
|
||||
# CHECK0: Parsing input IR code from: {{.*}}/Inputs/argc_sub1_elf.ll
|
||||
# CHECK0: Running: main()
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
# RUN: opt -module-summary %p/Inputs/foo-mod.ll -o foo-mod.bc
|
||||
# RUN: opt -module-summary %p/Inputs/bar-mod.ll -o bar-mod.bc
|
||||
|
||||
# REQUIRES: default_triple
|
||||
|
||||
# RUN: llvm-lto -thinlto -o main-foo-bar main-mod.bc foo-mod.bc bar-mod.bc
|
||||
|
||||
# RUN: LLJITWithThinLTOSummaries main-foo-bar.thinlto.bc 2>&1 | FileCheck %s
|
||||
|
|
Loading…
Reference in New Issue