Skip to content

Commit 2ca82f3

Browse files
committed
[Driver][test] Add --cuda-path= to some tests
An upcoming change D156363 will change -### to exit with code 1 if hasErrorOccurred. Some AMDGPU tests would exit with code 1 due to not found CUDA installation.
1 parent 9d4e8c0 commit 2ca82f3

File tree

4 files changed

+37
-37
lines changed

4 files changed

+37
-37
lines changed

clang/test/Driver/cuda-arch-translation.cu

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -4,63 +4,63 @@
44
// REQUIRES: x86-registered-target
55
// REQUIRES: nvptx-registered-target
66

7-
// RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=sm_20 %s 2>&1 \
7+
// RUN: %clang -### --target=x86_64-linux-gnu -c --cuda-gpu-arch=sm_20 --cuda-path=%S/Inputs/CUDA_80/usr/local/cuda %s 2>&1 \
88
// RUN: | FileCheck -check-prefixes=CUDA,SM20 %s
9-
// RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=sm_21 %s 2>&1 \
9+
// RUN: %clang -### --target=x86_64-linux-gnu -c --cuda-gpu-arch=sm_21 --cuda-path=%S/Inputs/CUDA_80/usr/local/cuda %s 2>&1 \
1010
// RUN: | FileCheck -check-prefixes=CUDA,SM21 %s
11-
// RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=sm_30 %s 2>&1 \
11+
// RUN: %clang -### --target=x86_64-linux-gnu -c --cuda-gpu-arch=sm_30 --cuda-path=%S/Inputs/CUDA_80/usr/local/cuda %s 2>&1 \
1212
// RUN: | FileCheck -check-prefixes=CUDA,SM30 %s
13-
// RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=sm_32 %s 2>&1 \
13+
// RUN: %clang -### --target=x86_64-linux-gnu -c --cuda-gpu-arch=sm_32 --cuda-path=%S/Inputs/CUDA_80/usr/local/cuda %s 2>&1 \
1414
// RUN: | FileCheck -check-prefixes=CUDA,SM32 %s
15-
// RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=sm_35 %s 2>&1 \
15+
// RUN: %clang -### --target=x86_64-linux-gnu -c --cuda-gpu-arch=sm_35 --cuda-path=%S/Inputs/CUDA_80/usr/local/cuda %s 2>&1 \
1616
// RUN: | FileCheck -check-prefixes=CUDA,SM35 %s
17-
// RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=sm_37 %s 2>&1 \
17+
// RUN: %clang -### --target=x86_64-linux-gnu -c --cuda-gpu-arch=sm_37 --cuda-path=%S/Inputs/CUDA_80/usr/local/cuda %s 2>&1 \
1818
// RUN: | FileCheck -check-prefixes=CUDA,SM37 %s
19-
// RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=sm_50 %s 2>&1 \
19+
// RUN: %clang -### --target=x86_64-linux-gnu -c --cuda-gpu-arch=sm_50 --cuda-path=%S/Inputs/CUDA_80/usr/local/cuda %s 2>&1 \
2020
// RUN: | FileCheck -check-prefixes=CUDA,SM50 %s
21-
// RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=sm_52 %s 2>&1 \
21+
// RUN: %clang -### --target=x86_64-linux-gnu -c --cuda-gpu-arch=sm_52 --cuda-path=%S/Inputs/CUDA_80/usr/local/cuda %s 2>&1 \
2222
// RUN: | FileCheck -check-prefixes=CUDA,SM52 %s
23-
// RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=sm_53 %s 2>&1 \
23+
// RUN: %clang -### --target=x86_64-linux-gnu -c --cuda-gpu-arch=sm_53 --cuda-path=%S/Inputs/CUDA_80/usr/local/cuda %s 2>&1 \
2424
// RUN: | FileCheck -check-prefixes=CUDA,SM53 %s
25-
// RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=sm_60 %s 2>&1 \
25+
// RUN: %clang -### --target=x86_64-linux-gnu -c --cuda-gpu-arch=sm_60 --cuda-path=%S/Inputs/CUDA_80/usr/local/cuda %s 2>&1 \
2626
// RUN: | FileCheck -check-prefixes=CUDA,SM60 %s
27-
// RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=sm_61 %s 2>&1 \
27+
// RUN: %clang -### --target=x86_64-linux-gnu -c --cuda-gpu-arch=sm_61 --cuda-path=%S/Inputs/CUDA_80/usr/local/cuda %s 2>&1 \
2828
// RUN: | FileCheck -check-prefixes=CUDA,SM61 %s
29-
// RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=sm_62 %s 2>&1 \
29+
// 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 \
3030
// RUN: | FileCheck -check-prefixes=CUDA,SM62 %s
31-
// RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=sm_70 %s 2>&1 \
31+
// RUN: %clang -### --target=x86_64-linux-gnu -c --cuda-gpu-arch=sm_70 %s 2>&1 \
3232
// RUN: | FileCheck -check-prefixes=CUDA,SM70 %s
33-
// RUN: %clang -x hip -### -target x86_64-linux-gnu -c --cuda-gpu-arch=gfx600 %s 2>&1 \
33+
// RUN: %clang -x hip -### --target=x86_64-linux-gnu -c --cuda-gpu-arch=gfx600 -nogpuinc -nogpulib %s 2>&1 \
3434
// RUN: | FileCheck -check-prefixes=HIP,GFX600 %s
35-
// RUN: %clang -x hip -### -target x86_64-linux-gnu -c --cuda-gpu-arch=gfx601 %s 2>&1 \
35+
// RUN: %clang -x hip -### --target=x86_64-linux-gnu -c --cuda-gpu-arch=gfx601 -nogpuinc -nogpulib %s 2>&1 \
3636
// RUN: | FileCheck -check-prefixes=HIP,GFX601 %s
37-
// RUN: %clang -x hip -### -target x86_64-linux-gnu -c --cuda-gpu-arch=gfx602 %s 2>&1 \
37+
// RUN: %clang -x hip -### --target=x86_64-linux-gnu -c --cuda-gpu-arch=gfx602 -nogpuinc -nogpulib %s 2>&1 \
3838
// RUN: | FileCheck -check-prefixes=HIP,GFX602 %s
39-
// RUN: %clang -x hip -### -target x86_64-linux-gnu -c --cuda-gpu-arch=gfx700 %s 2>&1 \
39+
// RUN: %clang -x hip -### --target=x86_64-linux-gnu -c --cuda-gpu-arch=gfx700 -nogpuinc -nogpulib %s 2>&1 \
4040
// RUN: | FileCheck -check-prefixes=HIP,GFX700 %s
41-
// RUN: %clang -x hip -### -target x86_64-linux-gnu -c --cuda-gpu-arch=gfx701 %s 2>&1 \
41+
// RUN: %clang -x hip -### --target=x86_64-linux-gnu -c --cuda-gpu-arch=gfx701 -nogpuinc -nogpulib %s 2>&1 \
4242
// RUN: | FileCheck -check-prefixes=HIP,GFX701 %s
43-
// RUN: %clang -x hip -### -target x86_64-linux-gnu -c --cuda-gpu-arch=gfx702 %s 2>&1 \
43+
// RUN: %clang -x hip -### --target=x86_64-linux-gnu -c --cuda-gpu-arch=gfx702 -nogpuinc -nogpulib %s 2>&1 \
4444
// RUN: | FileCheck -check-prefixes=HIP,GFX702 %s
45-
// RUN: %clang -x hip -### -target x86_64-linux-gnu -c --cuda-gpu-arch=gfx703 %s 2>&1 \
45+
// RUN: %clang -x hip -### --target=x86_64-linux-gnu -c --cuda-gpu-arch=gfx703 -nogpuinc -nogpulib %s 2>&1 \
4646
// RUN: | FileCheck -check-prefixes=HIP,GFX703 %s
47-
// RUN: %clang -x hip -### -target x86_64-linux-gnu -c --cuda-gpu-arch=gfx704 %s 2>&1 \
47+
// RUN: %clang -x hip -### --target=x86_64-linux-gnu -c --cuda-gpu-arch=gfx704 -nogpuinc -nogpulib %s 2>&1 \
4848
// RUN: | FileCheck -check-prefixes=HIP,GFX704 %s
49-
// RUN: %clang -x hip -### -target x86_64-linux-gnu -c --cuda-gpu-arch=gfx705 %s 2>&1 \
49+
// RUN: %clang -x hip -### --target=x86_64-linux-gnu -c --cuda-gpu-arch=gfx705 -nogpuinc -nogpulib %s 2>&1 \
5050
// RUN: | FileCheck -check-prefixes=HIP,GFX705 %s
51-
// RUN: %clang -x hip -### -target x86_64-linux-gnu -c --cuda-gpu-arch=gfx801 %s 2>&1 \
51+
// RUN: %clang -x hip -### --target=x86_64-linux-gnu -c --cuda-gpu-arch=gfx801 -nogpuinc -nogpulib %s 2>&1 \
5252
// RUN: | FileCheck -check-prefixes=HIP,GFX801 %s
53-
// RUN: %clang -x hip -### -target x86_64-linux-gnu -c --cuda-gpu-arch=gfx802 %s 2>&1 \
53+
// RUN: %clang -x hip -### --target=x86_64-linux-gnu -c --cuda-gpu-arch=gfx802 -nogpuinc -nogpulib %s 2>&1 \
5454
// RUN: | FileCheck -check-prefixes=HIP,GFX802 %s
55-
// RUN: %clang -x hip -### -target x86_64-linux-gnu -c --cuda-gpu-arch=gfx803 %s 2>&1 \
55+
// RUN: %clang -x hip -### --target=x86_64-linux-gnu -c --cuda-gpu-arch=gfx803 -nogpuinc -nogpulib %s 2>&1 \
5656
// RUN: | FileCheck -check-prefixes=HIP,GFX803 %s
57-
// RUN: %clang -x hip -### -target x86_64-linux-gnu -c --cuda-gpu-arch=gfx805 %s 2>&1 \
57+
// RUN: %clang -x hip -### --target=x86_64-linux-gnu -c --cuda-gpu-arch=gfx805 -nogpuinc -nogpulib %s 2>&1 \
5858
// RUN: | FileCheck -check-prefixes=HIP,GFX805 %s
59-
// RUN: %clang -x hip -### -target x86_64-linux-gnu -c --cuda-gpu-arch=gfx810 %s 2>&1 \
59+
// RUN: %clang -x hip -### --target=x86_64-linux-gnu -c --cuda-gpu-arch=gfx810 -nogpuinc -nogpulib %s 2>&1 \
6060
// RUN: | FileCheck -check-prefixes=HIP,GFX810 %s
61-
// RUN: %clang -x hip -### -target x86_64-linux-gnu -c --cuda-gpu-arch=gfx900 %s 2>&1 \
61+
// RUN: %clang -x hip -### --target=x86_64-linux-gnu -c --cuda-gpu-arch=gfx900 -nogpuinc -nogpulib %s 2>&1 \
6262
// RUN: | FileCheck -check-prefixes=HIP,GFX900 %s
63-
// RUN: %clang -x hip -### -target x86_64-linux-gnu -c --cuda-gpu-arch=gfx902 %s 2>&1 \
63+
// RUN: %clang -x hip -### --target=x86_64-linux-gnu -c --cuda-gpu-arch=gfx902 -nogpuinc -nogpulib %s 2>&1 \
6464
// RUN: | FileCheck -check-prefixes=HIP,GFX902 %s
6565

6666
// CUDA: ptxas

clang/test/Driver/cuda-constructor-alias.cu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// Check that we don't pass -mconstructor-aliases to CUDA device-side
55
// compilation, but we do pass it to host-side compilation.
66

7-
// RUN: %clang -### -target x86_64-linux-gnu %s 2>&1 | FileCheck %s
7+
// RUN: %clang -### --target=x86_64-linux-gnu --cuda-path=%S/Inputs/CUDA/usr/local/cuda %s 2>&1 | FileCheck %s
88
// CHECK: "-cc1"
99
// CHECK-NOT: "-fcuda-is-device" {{.*}}"-mconstructor-aliases"
1010
// CHECK-NOT: "-mconstructor-aliases" {{.*}}"-fcuda-is-device"

clang/test/Driver/cuda-cross-compiling.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
//
6363
// Test the generated arguments default to a value with no architecture.
6464
//
65-
// RUN: %clang -target nvptx64-nvidia-cuda -### %s 2>&1 \
65+
// RUN: %clang --target=nvptx64-nvidia-cuda -### --cuda-path=%S/Inputs/CUDA/usr/local/cuda %s 2>&1 \
6666
// RUN: | FileCheck -check-prefix=DEFAULT %s
6767

6868
// DEFAULT: -cc1" "-triple" "nvptx64-nvidia-cuda" "-S" {{.*}} "-target-cpu" "sm_35" "-target-feature" "+ptx{{[0-9]+}}" {{.*}} "-o" "[[PTX:.+]].s"

clang/test/Driver/cuda-dwarf-2.cu

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
//
2-
// RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=sm_20 %s -g -O1 --no-cuda-noopt-device-debug 2>&1 | \
2+
// RUN: %clang -### --target=x86_64-linux-gnu -c --cuda-gpu-arch=sm_20 %s -g -O1 --no-cuda-noopt-device-debug --cuda-path=%S/Inputs/CUDA_80/usr/local/cuda 2>&1 | \
33
// RUN: FileCheck %s -check-prefix DEBUG_DIRECTIVES
4-
// RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=sm_20 %s -g -O3 2>&1 | \
4+
// RUN: %clang -### --target=x86_64-linux-gnu -c --cuda-gpu-arch=sm_20 %s -g -O3 --cuda-path=%S/Inputs/CUDA_80/usr/local/cuda 2>&1 | \
55
// RUN: FileCheck %s -check-prefix DEBUG_DIRECTIVES
6-
// RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=sm_20 %s -g -O3 --no-cuda-noopt-device-debug 2>&1 | \
6+
// RUN: %clang -### --target=x86_64-linux-gnu -c --cuda-gpu-arch=sm_20 %s -g -O3 --no-cuda-noopt-device-debug --cuda-path=%S/Inputs/CUDA_80/usr/local/cuda 2>&1 | \
77
// RUN: FileCheck %s -check-prefix DEBUG_DIRECTIVES
8-
// RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=sm_20 %s -g0 2>&1 | \
8+
// RUN: %clang -### --target=x86_64-linux-gnu -c --cuda-gpu-arch=sm_20 %s -g0 --cuda-path=%S/Inputs/CUDA_80/usr/local/cuda 2>&1 | \
99
// RUN: FileCheck %s -check-prefix NO_DEBUG
10-
// RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=sm_20 %s -ggdb0 -O3 --cuda-noopt-device-debug 2>&1 | \
10+
// RUN: %clang -### --target=x86_64-linux-gnu -c --cuda-gpu-arch=sm_20 %s -ggdb0 -O3 --cuda-noopt-device-debug --cuda-path=%S/Inputs/CUDA_80/usr/local/cuda 2>&1 | \
1111
// RUN: FileCheck %s -check-prefix NO_DEBUG
12-
// RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=sm_20 %s -gline-directives-only -O2 --cuda-noopt-device-debug 2>&1 | \
12+
// RUN: %clang -### --target=x86_64-linux-gnu -c --cuda-gpu-arch=sm_20 %s -gline-directives-only -O2 --cuda-noopt-device-debug --cuda-path=%S/Inputs/CUDA_80/usr/local/cuda 2>&1 | \
1313
// RUN: FileCheck %s -check-prefix DEBUG_DIRECTIVES
1414

1515
// NO_DEBUG-NOT: warning: debug

0 commit comments

Comments
 (0)