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

via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 23 15:14:32 PST 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: Fangrui Song (MaskRay)

<details>
<summary>Changes</summary>

Fix missing test coverage after #<!-- -->70740 #<!-- -->70760


---
Full diff: https://github.com/llvm/llvm-project/pull/79222.diff


1 Files Affected:

- (added) clang/test/Driver/unsupported-option-gpu.c (+7) 


``````````diff
diff --git a/clang/test/Driver/unsupported-option-gpu.c b/clang/test/Driver/unsupported-option-gpu.c
new file mode 100644
index 000000000000000..5713dbbfc7ae4db
--- /dev/null
+++ b/clang/test/Driver/unsupported-option-gpu.c
@@ -0,0 +1,7 @@
+/// Some target-specific options are ignored for GPU, so %clang exits with code 0.
+// DEFINE: %{gpu_opts} = --cuda-gpu-arch=sm_60 --cuda-path=%S/Inputs/CUDA/usr/local/cuda --no-cuda-version-check
+// DEFINE: %{check} = %clang -### -c %{gpu_opts} -mcmodel=medium %s
+// RUN: %{check} -fbasic-block-sections=all
+
+// REDEFINE: %{gpu_opts} = -x hip --rocm-path=%S/Inputs/rocm -nogpulib
+// RUN: %{check}

``````````

</details>


https://github.com/llvm/llvm-project/pull/79222


More information about the cfe-commits mailing list