[clang] ed7cee9 - [Driver] Test ignored target-specific options for AMDGPU/NVPTX (#79222)

via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 24 10:06:31 PST 2024


Author: Fangrui Song
Date: 2024-01-24T10:06:27-08:00
New Revision: ed7cee90f7849594ba9a3ebc2271cb9b5d172004

URL: https://github.com/llvm/llvm-project/commit/ed7cee90f7849594ba9a3ebc2271cb9b5d172004
DIFF: https://github.com/llvm/llvm-project/commit/ed7cee90f7849594ba9a3ebc2271cb9b5d172004.diff

LOG: [Driver] Test ignored target-specific options for AMDGPU/NVPTX (#79222)

Fix missing test coverage after #70740 #70760

When compiling for CUDA/HIP, the driver creates a cc1 job to compile for
amdgcn/nvptx triple using most options.
Certain target-specific options should be ignored, not lead to an error
(`err_drv_unsupported_opt_for_target`).

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

Modified: 
    

Removed: 
    


################################################################################
diff  --git a/clang/test/Driver/unsupported-option-gpu.c b/clang/test/Driver/unsupported-option-gpu.c
new file mode 100644
index 000000000000000..225f3be7c76242c
--- /dev/null
+++ b/clang/test/Driver/unsupported-option-gpu.c
@@ -0,0 +1,5 @@
+/// Some target-specific options are ignored for GPU, so %clang exits with code 0.
+// DEFINE: %{check} = %clang -### -c -mcmodel=medium
+
+// 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
+// RUN: %{check} -x hip %s --rocm-path=%S/Inputs/rocm -nogpulib -nogpuinc


        


More information about the cfe-commits mailing list