[clang] [Driver] Add `--` to some test clang-cl command lines. (PR #70055)

Simon Tatham via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 24 08:51:01 PDT 2023


https://github.com/statham-arm updated https://github.com/llvm/llvm-project/pull/70055

>From 029eecc71b94130bb6d058c9f9d0779e32cd45f1 Mon Sep 17 00:00:00 2001
From: Simon Tatham <simon.tatham at arm.com>
Date: Tue, 24 Oct 2023 15:52:38 +0100
Subject: [PATCH] [Driver] Add `--` to some test clang-cl command lines.

If clang/test/Driver/cl-offload.cu is run on Unix in a directory whose
absolute pathname starts with `/w`, such as the `/workspace` used by
at least some Jenkins CI setups, then the file name on the clang
command line is misinterpreted as some kind of MSVC warning-control
option, and ignored by the catch-all `_SLASH_w` option in Options.td.

Other clang-cl tests take care to put a `--` before the input file
name, to force clang to treat it as a filename even if it starts with
a / and accidentally looks like a cl option. Do the same here.

This also allows the exclusion for `system-darwin` to be removed,
because that was trying to avoid a similar filename/option clash
involving `/Users`.
---
 clang/test/Driver/cl-offload.cu | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/clang/test/Driver/cl-offload.cu b/clang/test/Driver/cl-offload.cu
index 650c13da15b5b58..b05bf3b97b7eb71 100644
--- a/clang/test/Driver/cl-offload.cu
+++ b/clang/test/Driver/cl-offload.cu
@@ -1,15 +1,14 @@
-// REQUIRES: !system-darwin
 // REQUIRES: !system-solaris
 
 // The test cannot be run on Darwin because /Users will be treated as a MSVC option.
 
 // RUN: %clang_cl -### -target x86_64-pc-windows-msvc --offload-arch=sm_35 -fgpu-rdc \
 // RUN:   --cuda-path=%S/Inputs/CUDA/usr/local/cuda \
-// RUN:   /Wall -x cuda %s 2>&1 \
+// RUN:   /Wall -x cuda -- %s 2>&1 \
 // RUN:   | FileCheck %s -check-prefix=CUDA
 
 // RUN: %clang_cl -### -target x86_64-pc-windows-msvc --offload-arch=gfx1010 -fgpu-rdc --hip-link \
-// RUN:   --rocm-path=%S/Inputs/rocm /Wall -x hip %s 2>&1 \
+// RUN:   --rocm-path=%S/Inputs/rocm /Wall -x hip -- %s 2>&1 \
 // RUN:   | FileCheck %s -check-prefix=HIP
 
 // CUDA: "-cc1" "-triple" "nvptx64-nvidia-cuda" "-aux-triple" "x86_64-pc-windows-msvc"



More information about the cfe-commits mailing list