Author: Fangrui Song
Date: 2023-07-28T21:21:42-07:00
New Revision: 9155e517e6e1cda474d0d0fa82f71696c325bc10

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

LOG: [Driver][test] Add --cuda-path= to some tests

Their exit code is otherwise dependent on whether /usr/local/cuda exists.

Added: 
    

Modified: 
    clang/test/Driver/clang_f_opts.c
    clang/test/Driver/cuda-arch-translation.cu
    clang/test/Driver/cuda-bad-arch.cu
    clang/test/Driver/cuda-bindings.cu
    clang/test/Driver/cuda-flush-denormals-to-zero.cu
    clang/test/Driver/cuda-openmp-driver.cu
    clang/test/Driver/cuda-options.cu
    clang/test/Driver/cuda-output-asm.cu
    clang/test/Driver/fbasic-block-sections.c
    clang/test/Driver/lto.cu
    clang/test/Driver/nvptx-cuda-system-arch.c
    clang/test/Driver/openmp-offload-gpu.c
    clang/test/Driver/opt-record.c

Removed: 
    


################################################################################
diff  --git a/clang/test/Driver/clang_f_opts.c 
b/clang/test/Driver/clang_f_opts.c
index 09fca3658456bc..f47f226b4386bd 100644
--- a/clang/test/Driver/clang_f_opts.c
+++ b/clang/test/Driver/clang_f_opts.c
@@ -59,8 +59,8 @@
 // CHECK-SAMPLE-PROFILE: "-fprofile-sample-use={{.*}}/file.prof"
 
 //
-// RUN: not %clang -### -x cuda -nocudainc -nocudalib \
-// RUN:    -c -fprofile-sample-use=%S/Inputs/file.prof %s 2>&1 \
+// RUN: %clang -### -x cuda -nocudainc -nocudalib \
+// RUN:    -c -fprofile-sample-use=%S/Inputs/file.prof 
--cuda-path=%S/Inputs/CUDA/usr/local/cuda %s 2>&1 \
 // RUN:  | FileCheck -check-prefix=CHECK-CUDA-SAMPLE-PROFILE %s
 // -fprofile-sample-use should not be passed to the GPU compilation
 // CHECK-CUDA-SAMPLE-PROFILE: "-cc1"

diff  --git a/clang/test/Driver/cuda-arch-translation.cu 
b/clang/test/Driver/cuda-arch-translation.cu
index 4511d5cf1f5a02..f37964d87c66a1 100644
--- a/clang/test/Driver/cuda-arch-translation.cu
+++ b/clang/test/Driver/cuda-arch-translation.cu
@@ -28,7 +28,7 @@
 // RUN: | FileCheck -check-prefixes=CUDA,SM61 %s
 // RUN: %clang -### --target=x86_64-linux-gnu -c --cuda-gpu-arch=sm_62 
--cuda-path=%S/Inputs/CUDA_80/usr/local/cuda %s 2>&1 \
 // RUN: | FileCheck -check-prefixes=CUDA,SM62 %s
-// RUN: %clang -### --target=x86_64-linux-gnu -c --cuda-gpu-arch=sm_70 %s 2>&1 
\
+// RUN: %clang -### --target=x86_64-linux-gnu -c --cuda-gpu-arch=sm_70 
--cuda-path=%S/Inputs/CUDA_111/usr/local/cuda %s 2>&1 \
 // RUN: | FileCheck -check-prefixes=CUDA,SM70 %s
 // RUN: %clang -x hip -### --target=x86_64-linux-gnu -c --cuda-gpu-arch=gfx600 
-nogpuinc -nogpulib %s 2>&1 \
 // RUN: | FileCheck -check-prefixes=HIP,GFX600 %s

diff  --git a/clang/test/Driver/cuda-bad-arch.cu 
b/clang/test/Driver/cuda-bad-arch.cu
index 6c5f74a552933a..732f264e310a4f 100644
--- a/clang/test/Driver/cuda-bad-arch.cu
+++ b/clang/test/Driver/cuda-bad-arch.cu
@@ -3,7 +3,7 @@
 // REQUIRES: nvptx-registered-target
 // REQUIRES: amdgpu-registered-target
 
-// RUN: not %clang -### -target x86_64-linux-gnu --cuda-gpu-arch=compute_20 -c 
%s 2>&1 \
+// RUN: not %clang -### -target x86_64-linux-gnu --cuda-gpu-arch=compute_20 -c 
--cuda-path=%S/Inputs/CUDA_80/usr/local/cuda %s 2>&1 \
 // RUN: | FileCheck -check-prefix BAD %s
 // RUN: not %clang -### -target x86_64-linux-gnu --cuda-gpu-arch=sm20 -c %s 
2>&1 \
 // RUN: | FileCheck -check-prefix BAD %s
@@ -22,7 +22,7 @@
 
 // RUN: not %clang -### -target x86_64-linux-gnu --cuda-gpu-arch=sm_20 -c %s 
2>&1 \
 // RUN: | FileCheck -check-prefix OK %s
-// RUN: %clang -### -target x86_64-linux-gnu --cuda-gpu-arch=sm_52 -c %s 2>&1 \
+// RUN: %clang -### -target x86_64-linux-gnu --cuda-gpu-arch=sm_52 -c 
--cuda-path=%S/Inputs/CUDA_80/usr/local/cuda %s 2>&1 \
 // RUN: | FileCheck -check-prefix OK %s
 // RUN: not %clang -### -x hip -target x86_64-linux-gnu --cuda-gpu-arch=gfx908 
-c %s 2>&1 \
 // RUN: | FileCheck -check-prefix OK %s

diff  --git a/clang/test/Driver/cuda-bindings.cu 
b/clang/test/Driver/cuda-bindings.cu
index 73109eef744810..79c9f6f0874c5f 100644
--- a/clang/test/Driver/cuda-bindings.cu
+++ b/clang/test/Driver/cuda-bindings.cu
@@ -190,10 +190,10 @@
 // Ensure we output the user's specified name in device-only mode.
 //
 // RUN: %clang -target powerpc64le-ibm-linux-gnu -### \
-// RUN:        --cuda-gpu-arch=sm_52 --cuda-device-only -c -o foo.o %s 2>&1 \
+// RUN:        --cuda-gpu-arch=sm_52 --cuda-device-only -c -o foo.o 
--cuda-path=%S/Inputs/CUDA_80/usr/local/cuda %s 2>&1 \
 // RUN: | FileCheck -check-prefix=D_ONLY %s
 // RUN: %clang -target powerpc64le-ibm-linux-gnu -### --offload-new-driver \
-// RUN:        --cuda-gpu-arch=sm_52 --cuda-device-only -c -o foo.o %s 2>&1 \
+// RUN:        --cuda-gpu-arch=sm_52 --cuda-device-only -c -o foo.o 
--cuda-path=%S/Inputs/CUDA_80/usr/local/cuda %s 2>&1 \
 // RUN: | FileCheck -check-prefix=D_ONLY %s
 // D_ONLY: "foo.o"
 
@@ -219,7 +219,7 @@
 // driver.
 // 
 // RUN: %clang -### -target powerpc64le-ibm-linux-gnu --offload-new-driver \
-// RUN:        -fsyntax-only --offload-arch=sm_70 --offload-arch=sm_52 -c %s 
2>&1 \
+// RUN:        -fsyntax-only --offload-arch=sm_70 --offload-arch=sm_52 -c 
--cuda-path=%S/Inputs/CUDA_111/usr/local/cuda %s 2>&1 \
 // RUN: | FileCheck -check-prefix=SYNTAX-ONLY %s
 // SYNTAX-ONLY: "-cc1" "-triple" "nvptx64-nvidia-cuda"{{.*}}"-fsyntax-only"
 // SYNTAX-ONLY: "-cc1" "-triple" "nvptx64-nvidia-cuda"{{.*}}"-fsyntax-only"
@@ -229,7 +229,7 @@
 // Check to ensure that we can use '-save-temps' when operating in RDC-mode.
 //
 // RUN: %clang -### -target powerpc64le-ibm-linux-gnu -save-temps 
--offload-new-driver \
-// RUN:        -fgpu-rdc --offload-arch=sm_70 --offload-arch=sm_52 -c %s 2>&1 \
+// RUN:        -fgpu-rdc --offload-arch=sm_70 --offload-arch=sm_52 -c 
--cuda-path=%S/Inputs/CUDA_111/usr/local/cuda %s 2>&1 \
 // RUN: | FileCheck -check-prefix=SAVE-TEMPS %s
 // SAVE-TEMPS: "-cc1" "-triple" "nvptx64-nvidia-cuda"{{.*}}"-target-cpu" 
"sm_52"
 // SAVE-TEMPS: "-cc1" "-triple" "nvptx64-nvidia-cuda"{{.*}}"-target-cpu" 
"sm_70"

diff  --git a/clang/test/Driver/cuda-flush-denormals-to-zero.cu 
b/clang/test/Driver/cuda-flush-denormals-to-zero.cu
index 553876601a53e3..ea808f2302fbb7 100644
--- a/clang/test/Driver/cuda-flush-denormals-to-zero.cu
+++ b/clang/test/Driver/cuda-flush-denormals-to-zero.cu
@@ -2,14 +2,14 @@
 // -fgpu-flush-denormals-to-zero. This should be translated to
 // -fdenormal-fp-math-f32=preserve-sign
 
-// RUN: not %clang -### --target=x86_64-linux-gnu -c -march=haswell 
--cuda-gpu-arch=sm_20 -fgpu-flush-denormals-to-zero -nocudainc -nocudalib %s 
2>&1 | FileCheck -check-prefix=FTZ %s
-// RUN: not %clang -### --target=x86_64-linux-gnu -c -march=haswell 
--cuda-gpu-arch=sm_20 -fno-gpu-flush-denormals-to-zero -nocudainc -nocudalib %s 
2>&1 | FileCheck -check-prefix=NOFTZ %s
+// RUN: %clang -### --target=x86_64-linux-gnu -c -march=haswell 
--cuda-gpu-arch=sm_20 -fgpu-flush-denormals-to-zero -nocudainc -nocudalib 
--cuda-path=%S/Inputs/CUDA/usr/local/cuda %s 2>&1 | FileCheck -check-prefix=FTZ 
%s
+// RUN: %clang -### --target=x86_64-linux-gnu -c -march=haswell 
--cuda-gpu-arch=sm_20 -fno-gpu-flush-denormals-to-zero -nocudainc -nocudalib 
--cuda-path=%S/Inputs/CUDA/usr/local/cuda %s 2>&1 | FileCheck 
-check-prefix=NOFTZ %s
 // RUN: %clang -### --target=x86_64-linux-gnu -c -march=haswell 
--cuda-gpu-arch=sm_70 -fgpu-flush-denormals-to-zero -nocudainc -nocudalib %s 
2>&1 | FileCheck -check-prefix=FTZ %s
 // RUN: %clang -### --target=x86_64-linux-gnu -c -march=haswell 
--cuda-gpu-arch=sm_70 -fno-gpu-flush-denormals-to-zero -nocudainc -nocudalib %s 
2>&1 | FileCheck -check-prefix=NOFTZ %s
 
 // Test alias options -f[no-]cuda-flush-denormals-to-zero
-// RUN: not %clang -### --target=x86_64-linux-gnu -c -march=haswell 
--cuda-gpu-arch=sm_20 -fcuda-flush-denormals-to-zero -nocudainc -nocudalib %s 
2>&1 | FileCheck -check-prefix=FTZ %s
-// RUN: not %clang -### --target=x86_64-linux-gnu -c -march=haswell 
--cuda-gpu-arch=sm_20 -fno-cuda-flush-denormals-to-zero -nocudainc -nocudalib 
%s 2>&1 | FileCheck -check-prefix=NOFTZ %s
+// RUN: %clang -### --target=x86_64-linux-gnu -c -march=haswell 
--cuda-gpu-arch=sm_20 -fcuda-flush-denormals-to-zero -nocudainc -nocudalib 
--cuda-path=%S/Inputs/CUDA/usr/local/cuda %s 2>&1 | FileCheck -check-prefix=FTZ 
%s
+// RUN: %clang -### --target=x86_64-linux-gnu -c -march=haswell 
--cuda-gpu-arch=sm_20 -fno-cuda-flush-denormals-to-zero -nocudainc -nocudalib 
--cuda-path=%S/Inputs/CUDA/usr/local/cuda %s 2>&1 | FileCheck 
-check-prefix=NOFTZ %s
 
 // Test explicit argument, with CUDA offload kind
 // RUN: %clang -x hip -### --target=x86_64-linux-gnu -c -march=haswell 
--cuda-gpu-arch=gfx803 -fgpu-flush-denormals-to-zero -nocudainc -nogpulib %s 
2>&1 | FileCheck -check-prefix=FTZ %s

diff  --git a/clang/test/Driver/cuda-openmp-driver.cu 
b/clang/test/Driver/cuda-openmp-driver.cu
index 697c132a9c75ad..8f2d8587e2dadf 100644
--- a/clang/test/Driver/cuda-openmp-driver.cu
+++ b/clang/test/Driver/cuda-openmp-driver.cu
@@ -27,7 +27,7 @@
 // BINDINGS-DEVICE: # "nvptx64-nvidia-cuda" - "clang", inputs: 
["[[INPUT:.+]]"], output: "[[PTX:.+]]"
 // BINDINGS-DEVICE: # "nvptx64-nvidia-cuda" - "NVPTX::Assembler", inputs: 
["[[PTX]]"], output: "[[CUBIN:.+]]"
 
-// RUN: %clang -### -target x86_64-linux-gnu -nocudalib --cuda-feature=+ptx61 
--offload-arch=sm_70 %s 2>&1 | FileCheck -check-prefix MANUAL-FEATURE %s
+// RUN: %clang -### -target x86_64-linux-gnu -nocudalib --cuda-feature=+ptx61 
--offload-arch=sm_70 --cuda-path=%S/Inputs/CUDA_111/usr/local/cuda %s 2>&1 | 
FileCheck -check-prefix MANUAL-FEATURE %s
 // MANUAL-FEATURE: -cc1{{.*}}-target-feature{{.*}}+ptx61
 
 // RUN: %clang -### -target x86_64-linux-gnu -nocudalib -ccc-print-bindings 
--offload-link %s 2>&1 \
@@ -35,8 +35,8 @@
 
 // DEVICE-LINK: "x86_64-unknown-linux-gnu" - "Offload::Linker", inputs: 
["[[INPUT:.+]]"], output: "a.out"
 
-// RUN: not %clang -### -target x86_64-linux-gnu -nocudalib 
--offload-new-driver \
-// RUN:   --offload-arch=sm_35 --offload-arch=sm_70 %s 2>&1 \
+// RUN: %clang -### -target x86_64-linux-gnu -nocudalib --offload-new-driver \
+// RUN:   --offload-arch=sm_35 --offload-arch=sm_70 
--cuda-path=%S/Inputs/CUDA_111/usr/local/cuda %s 2>&1 \
 // RUN: | FileCheck -check-prefix GPU-BINARY %s
 
 // GPU-BINARY: fatbinary{{.*}}"--create" "{{.*}}.fatbin"

diff  --git a/clang/test/Driver/cuda-options.cu 
b/clang/test/Driver/cuda-options.cu
index 0acb9987fbe85d..cc3300424c27b6 100644
--- a/clang/test/Driver/cuda-options.cu
+++ b/clang/test/Driver/cuda-options.cu
@@ -4,25 +4,25 @@
 
 // Simple compilation case. Compile device-side to PTX assembly and make sure
 // we use it on the host side.
-// RUN: not %clang -### -target x86_64-linux-gnu -c %s 2>&1 \
+// RUN: %clang -### -target x86_64-linux-gnu -c 
--cuda-path=%S/Inputs/CUDA/usr/local/cuda %s 2>&1 \
 // RUN: | FileCheck -check-prefix DEVICE -check-prefix DEVICE-NOSAVE \
 // RUN:    -check-prefix HOST -check-prefix INCLUDES-DEVICE \
 // RUN:    -check-prefix NOLINK %s
 
 // Typical compilation + link case.
-// RUN: not %clang -### -target x86_64-linux-gnu %s 2>&1 \
+// RUN: %clang -### -target x86_64-linux-gnu 
--cuda-path=%S/Inputs/CUDA/usr/local/cuda %s 2>&1 \
 // RUN: | FileCheck -check-prefix DEVICE -check-prefix DEVICE-NOSAVE \
 // RUN:    -check-prefix HOST -check-prefix INCLUDES-DEVICE \
 // RUN:    -check-prefix LINK %s
 
 // Verify that --cuda-host-only disables device-side compilation, but doesn't
 // disable host-side compilation/linking.
-// RUN: %clang -### -target x86_64-linux-gnu --cuda-host-only %s 2>&1 \
+// RUN: %clang -### -target x86_64-linux-gnu --cuda-host-only 
--cuda-path=%S/Inputs/CUDA/usr/local/cuda %s 2>&1 \
 // RUN: | FileCheck -check-prefix NODEVICE -check-prefix HOST \
 // RUN:    -check-prefix NOINCLUDES-DEVICE -check-prefix LINK %s
 
 // Verify that --cuda-device-only disables host-side compilation and linking.
-// RUN: not %clang -### -target x86_64-linux-gnu --cuda-device-only %s 2>&1 \
+// RUN: %clang -### -target x86_64-linux-gnu --cuda-device-only 
--cuda-path=%S/Inputs/CUDA/usr/local/cuda %s 2>&1 \
 // RUN: | FileCheck -check-prefix DEVICE -check-prefix DEVICE-NOSAVE \
 // RUN:    -check-prefix NOHOST -check-prefix NOLINK %s
 
@@ -30,12 +30,12 @@
 // --cuda-device-only wins.
 
 // RUN: %clang -### -target x86_64-linux-gnu --cuda-device-only \
-// RUN:    --cuda-host-only %s 2>&1 \
+// RUN:    --cuda-host-only --cuda-path=%S/Inputs/CUDA/usr/local/cuda %s 2>&1 \
 // RUN: | FileCheck -check-prefix NODEVICE -check-prefix HOST \
 // RUN:    -check-prefix NOINCLUDES-DEVICE -check-prefix LINK %s
 
 // RUN: %clang -### -target x86_64-linux-gnu --cuda-compile-host-device \
-// RUN:    --cuda-host-only %s 2>&1 \
+// RUN:    --cuda-host-only --cuda-path=%S/Inputs/CUDA/usr/local/cuda %s 2>&1 \
 // RUN: | FileCheck -check-prefix NODEVICE -check-prefix HOST \
 // RUN:    -check-prefix NOINCLUDES-DEVICE -check-prefix LINK %s
 
@@ -132,7 +132,7 @@
 // RUN:   --cuda-gpu-arch=sm_35 --cuda-gpu-arch=sm_30 \
 // RUN:   --no-cuda-gpu-arch=all \
 // RUN:   --cuda-gpu-arch=sm_50 \
-// RUN:   -c %s 2>&1 \
+// RUN:   -c --cuda-path=%S/Inputs/CUDA/usr/local/cuda %s 2>&1 \
 // RUN: | FileCheck -check-prefixes NOARCH-SM30,NOARCH-SM35,ARCH-SM50 %s
 
 // g) There's no --cuda-gpu-arch=all

diff  --git a/clang/test/Driver/cuda-output-asm.cu 
b/clang/test/Driver/cuda-output-asm.cu
index 0465385475a4c1..f5aebe98291893 100644
--- a/clang/test/Driver/cuda-output-asm.cu
+++ b/clang/test/Driver/cuda-output-asm.cu
@@ -3,15 +3,15 @@
 // REQUIRES: x86-registered-target
 // REQUIRES: nvptx-registered-target
 
-// RUN: not %clang -### -S -target x86_64-linux-gnu --cuda-gpu-arch=sm_20 %s 
2>&1 \
+// RUN: %clang -### -S --target=x86_64-linux-gnu --cuda-gpu-arch=sm_20 
--cuda-path=%S/Inputs/CUDA_80/usr/local/cuda %s 2>&1 \
 // RUN:   | FileCheck -check-prefix HOST -check-prefix SM20 %s
-// RUN: %clang -### -S -target x86_64-linux-gnu --cuda-host-only -o foo.s %s 
2>&1 \
+// RUN: %clang -### -S --target=x86_64-linux-gnu --cuda-host-only -o foo.s 
--cuda-path=%S/Inputs/CUDA_80/usr/local/cuda %s 2>&1 \
 // RUN:   | FileCheck -check-prefix HOST %s
-// RUN: not %clang -### -S -target x86_64-linux-gnu --cuda-gpu-arch=sm_20 \
-// RUN:   --cuda-device-only -o foo.s %s 2>&1 \
+// RUN: %clang -### -S --target=x86_64-linux-gnu --cuda-gpu-arch=sm_20 \
+// RUN:   --cuda-device-only -o foo.s 
--cuda-path=%S/Inputs/CUDA_80/usr/local/cuda %s 2>&1 \
 // RUN:   | FileCheck -check-prefix SM20 %s
-// RUN: not %clang -### -S -target x86_64-linux-gnu --cuda-gpu-arch=sm_20 \
-// RUN:   --cuda-gpu-arch=sm_30 --cuda-device-only %s 2>&1 \
+// RUN: %clang -### -S --target=x86_64-linux-gnu --cuda-gpu-arch=sm_20 \
+// RUN:   --cuda-gpu-arch=sm_30 --cuda-device-only 
--cuda-path=%S/Inputs/CUDA_80/usr/local/cuda %s 2>&1 \
 // RUN:   | FileCheck -check-prefix SM20 -check-prefix SM30 %s
 
 // HOST-DAG: "-cc1" "-triple" "x86_64-unknown-linux-gnu"

diff  --git a/clang/test/Driver/fbasic-block-sections.c 
b/clang/test/Driver/fbasic-block-sections.c
index db3ccaa96906bb..417cf9b6319bde 100644
--- a/clang/test/Driver/fbasic-block-sections.c
+++ b/clang/test/Driver/fbasic-block-sections.c
@@ -10,7 +10,7 @@
 // RUN: not %clang -### -target x86_64 -fbasic-block-sections=list %s -S 2>&1 
| FileCheck -check-prefix=CHECK-INVALID-VALUE %s
 // RUN: %clang -### -target x86_64 -fbasic-block-sections=list= %s -S 2>&1 | 
FileCheck -check-prefix=CHECK-OPT-NULL-LIST %s
 // RUN: %clang -### -target x86_64 -fbasic-block-sections=none %s -S 2>&1 | 
FileCheck -check-prefix=CHECK-OPT-NONE %s
-// RUN: not %clang -### -x cuda -nocudainc -nocudalib -target x86_64 
-fbasic-block-sections=all %s -c 2>&1 \
+// RUN: %clang -### -x cuda -nocudainc -nocudalib --target=x86_64 
-fbasic-block-sections=all --cuda-path=%S/Inputs/CUDA/usr/local/cuda %s -c 2>&1 
\
 // RUN:   | FileCheck -check-prefix=CHECK-CUDA %s
 
 //

diff  --git a/clang/test/Driver/lto.cu b/clang/test/Driver/lto.cu
index 81d4708eb5ffb3..802c039eaa704c 100644
--- a/clang/test/Driver/lto.cu
+++ b/clang/test/Driver/lto.cu
@@ -29,7 +29,7 @@
 
 // llvm-bc and llvm-ll outputs need to match regular suffixes
 // (unfortunately).
-// RUN: not %clangxx %s -nocudainc -nocudalib -flto -save-temps -### 2> %t
+// RUN: %clangxx %s -nocudainc -nocudalib -flto -save-temps 
--cuda-path=%S/Inputs/CUDA_80/usr/local/cuda -### 2> %t
 // RUN: FileCheck -check-prefix=CHECK-COMPILELINK-SUFFIXES < %t %s
 //
 // CHECK-COMPILELINK-SUFFIXES: "-o" "[[CPP:.*lto-host.*\.cui]]" "-x" "cuda" 
"{{.*}}lto.cu"
@@ -63,11 +63,11 @@
 // NO-LLVMGOLD-NOT: "-plugin" "{{.*}}{{[/\\]}}LLVMgold.{{dll|dylib|so}}"
 
 // -flto passes along an explicit debugger tuning argument.
-// RUN: not %clangxx -nocudainc -nocudalib \
-// RUN:          --target=x86_64-unknown-linux -### %s -flto -glldb 2> %t
+// RUN: %clangxx -nocudainc -nocudalib \
+// RUN:          --target=x86_64-unknown-linux -### %s -flto -glldb 
--cuda-path=%S/Inputs/CUDA_80/usr/local/cuda 2> %t
 // RUN: FileCheck -check-prefix=CHECK-TUNING-LLDB < %t %s
-// RUN: not %clangxx -nocudainc -nocudalib \
-// RUN:          --target=x86_64-unknown-linux -### %s -flto -g 2> %t
+// RUN: %clangxx -nocudainc -nocudalib \
+// RUN:          --target=x86_64-unknown-linux -### %s -flto -g 
--cuda-path=%S/Inputs/CUDA_80/usr/local/cuda 2> %t
 // RUN: FileCheck -check-prefix=CHECK-NO-TUNING < %t %s
 //
 // CHECK-TUNING-LLDB:   "-plugin-opt=-debugger-tune=lldb"

diff  --git a/clang/test/Driver/nvptx-cuda-system-arch.c 
b/clang/test/Driver/nvptx-cuda-system-arch.c
index 0302342c5ac7b4..037215fd52a88b 100644
--- a/clang/test/Driver/nvptx-cuda-system-arch.c
+++ b/clang/test/Driver/nvptx-cuda-system-arch.c
@@ -26,8 +26,8 @@
 // EMPTY-OUTPUT: error: cannot determine nvptx64 architecture: No NVIDIA GPU 
detected in the system; consider passing it via '--offload-arch'
 
 // case when nvptx-arch does not return anything with successful execution
-// RUN:   %clang -### --target=x86_64-unknown-linux-gnu -nogpulib 
--offload-arch=native --nvptx-arch-tool=%t/nvptx_arch_sm_70 -x cuda %s 2>&1 \
+// RUN:   %clang -### --target=x86_64-unknown-linux-gnu -nogpulib 
--offload-arch=native --nvptx-arch-tool=%t/nvptx_arch_sm_70 -x cuda 
--cuda-path=%S/Inputs/CUDA_102/usr/local/cuda %s 2>&1 \
 // RUN:   | FileCheck %s --check-prefix=ARCH-sm_70
-// RUN:   %clang -### --target=x86_64-unknown-linux-gnu -nogpulib 
--offload-arch=native --offload-new-driver 
--nvptx-arch-tool=%t/nvptx_arch_sm_70 -x cuda %s 2>&1 \
+// RUN:   %clang -### --target=x86_64-unknown-linux-gnu -nogpulib 
--offload-arch=native --offload-new-driver 
--nvptx-arch-tool=%t/nvptx_arch_sm_70 -x cuda 
--cuda-path=%S/Inputs/CUDA_102/usr/local/cuda %s 2>&1 \
 // RUN:   | FileCheck %s --check-prefix=ARCH-sm_70
 // ARCH-sm_70: "-cc1" "-triple" "nvptx64-nvidia-cuda"{{.*}}"-target-cpu" 
"sm_70"

diff  --git a/clang/test/Driver/openmp-offload-gpu.c 
b/clang/test/Driver/openmp-offload-gpu.c
index 657aa3dba7c86d..11fa080f6d8fda 100644
--- a/clang/test/Driver/openmp-offload-gpu.c
+++ b/clang/test/Driver/openmp-offload-gpu.c
@@ -231,11 +231,11 @@
 // TRIPLE: "-target-cpu" "sm_35"
 
 // RUN:   %clang -### --target=x86_64-unknown-linux-gnu -fopenmp=libomp 
-fopenmp-targets=nvptx64-nvidia-cuda \
-// RUN:          -Xopenmp-target=nvptx64-nvidia-cuda -march=sm_52 \
+// RUN:          -Xopenmp-target=nvptx64-nvidia-cuda -march=sm_52 
--cuda-path=%S/Inputs/CUDA_102/usr/local/cuda \
 // RUN:          
--libomptarget-nvptx-bc-path=%S/Inputs/libomptarget/libomptarget-nvptx-test.bc 
%s 2>&1 \
 // RUN:   | FileCheck %s
 // RUN:   %clang -### --target=x86_64-unknown-linux-gnu -fopenmp=libomp 
-fopenmp-targets=nvptx64-nvidia-cuda \
-// RUN:          --offload-arch=sm_52 \
+// RUN:          --offload-arch=sm_52 
--cuda-path=%S/Inputs/CUDA_102/usr/local/cuda \
 // RUN:          
--libomptarget-nvptx-bc-path=%S/Inputs/libomptarget/libomptarget-nvptx-test.bc 
%s 2>&1 \
 // RUN:   | FileCheck %s
 
@@ -336,7 +336,7 @@
 // RUN:     --offload-device-only -E -nogpulib %s 2>&1 | FileCheck %s 
--check-prefix=CHECK-DEVICE-ONLY-PP
 // CHECK-DEVICE-ONLY-PP: "nvptx64-nvidia-cuda" - "clang", inputs: 
["[[INPUT:.*]]"], output: "-"
 
-// RUN:   %clang -### --target=x86_64-unknown-linux-gnu -fopenmp=libomp 
--offload-arch=sm_52 \
+// RUN:   %clang -### --target=x86_64-unknown-linux-gnu -fopenmp=libomp 
--offload-arch=sm_52 --cuda-path=%S/Inputs/CUDA_102/usr/local/cuda \
 // RUN:     -foffload-lto %s 2>&1 | FileCheck --check-prefix=CHECK-LTO-LIBRARY 
%s
 
 // CHECK-LTO-LIBRARY: {{.*}}-lomptarget{{.*}}-lomptarget.devicertl

diff  --git a/clang/test/Driver/opt-record.c b/clang/test/Driver/opt-record.c
index 4d3162d57635b2..64e7a7f0e0e29a 100644
--- a/clang/test/Driver/opt-record.c
+++ b/clang/test/Driver/opt-record.c
@@ -6,8 +6,8 @@
 // RUN: %clang -### -c -fsave-optimization-record %s 2>&1 | FileCheck %s 
-check-prefix=CHECK-NO-O
 // RUN: %clang -### -save-temps -c -fsave-optimization-record %s 2>&1 | 
FileCheck %s -check-prefix=CHECK-NO-O
 // RUN: %clang -### -fsave-optimization-record %s 2>&1 | FileCheck %s 
-check-prefix=CHECK-NO-O
-// RUN: %clang -### -S -fsave-optimization-record -x cuda -nocudainc 
-nocudalib %s 2>&1 | FileCheck %s -check-prefix=CHECK-NO-O 
-check-prefix=CHECK-CUDA-DEV
-// RUN: not %clang -### -fsave-optimization-record -x cuda -nocudainc 
-nocudalib %s 2>&1 | FileCheck %s -check-prefix=CHECK-NO-O 
-check-prefix=CHECK-CUDA-DEV
+// RUN: %clang -### -S -fsave-optimization-record -x cuda -nocudainc 
-nocudalib --cuda-path=%S/Inputs/CUDA/usr/local/cuda %s 2>&1 | FileCheck %s 
-check-prefix=CHECK-NO-O -check-prefix=CHECK-CUDA-DEV
+// RUN: %clang -### -fsave-optimization-record -x cuda -nocudainc -nocudalib 
--cuda-path=%S/Inputs/CUDA/usr/local/cuda %s 2>&1 | FileCheck %s 
-check-prefix=CHECK-NO-O -check-prefix=CHECK-CUDA-DEV
 // RUN: %clang -### -S -o FOO -fsave-optimization-record 
-foptimization-record-file=BAR.txt %s 2>&1 | FileCheck %s -check-prefix=CHECK-EQ
 // RUN: %clang -### -S -o FOO -foptimization-record-file=BAR.txt %s 2>&1 | 
FileCheck %s -check-prefix=CHECK-EQ
 // RUN: %clang -### -S -o FOO -foptimization-record-file=BAR.txt 
-fno-save-optimization-record %s 2>&1 | FileCheck %s 
--check-prefix=CHECK-FOPT-DISABLE


        
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to