Skip to content

Commit bba8e40

Browse files
committed
[clang][SPIRV] Ignore -mcmodel
The code model doesn't affect the sub-compilation, so don't check it. Followup to llvm#70740.
1 parent e4f9175 commit bba8e40

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5804,7 +5804,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
58045804
} else if (Triple.getArch() == llvm::Triple::x86_64) {
58055805
Ok = llvm::is_contained({"small", "kernel", "medium", "large", "tiny"},
58065806
CM);
5807-
} else if (Triple.isNVPTX() || Triple.isAMDGPU()) {
5807+
} else if (Triple.isNVPTX() || Triple.isAMDGPU() || Triple.isSPIRV()) {
58085808
// NVPTX/AMDGPU does not care about the code model and will accept
58095809
// whatever works for the host.
58105810
Ok = true;

clang/test/Driver/unsupported-option-gpu.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
// DEFINE: %{check} = %clang -### --target=x86_64-linux-gnu -c -mcmodel=medium
33

44
// RUN: %{check} -x cuda %s --cuda-path=%S/Inputs/CUDA/usr/local/cuda --offload-arch=sm_60 --no-cuda-version-check -fbasic-block-sections=all
5+
// RUN: %{check} -x hip %s --offload=spirv64 -nogpulib -nogpuinc
56
// RUN: %{check} -x hip %s --rocm-path=%S/Inputs/rocm -nogpulib -nogpuinc

0 commit comments

Comments
 (0)