Skip to content

Commit

Permalink
[Driver] Test ignored target-specific options for AMDGPU/NVPTX (#79222)
Browse files Browse the repository at this point in the history
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`).
  • Loading branch information
MaskRay committed Jan 24, 2024
1 parent 604a6c4 commit ed7cee9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions clang/test/Driver/unsupported-option-gpu.c
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit ed7cee9

Please sign in to comment.