Skip to content

Commit 25629bb

Browse files
committed
Fix cuda-bad-arch.cu test.
Tests for correctness of HIP architecture need `- xhip`
1 parent 087310c commit 25629bb

File tree

3 files changed

+70
-68
lines changed

3 files changed

+70
-68
lines changed

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

+66-64
Original file line numberDiff line numberDiff line change
@@ -6,67 +6,69 @@
66
// REQUIRES: nvptx-registered-target
77

88
// RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=sm_20 %s 2>&1 \
9-
// RUN: | FileCheck -check-prefixes=COMMON,SM20 %s
9+
// RUN: | FileCheck -check-prefixes=CUDA,SM20 %s
1010
// RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=sm_21 %s 2>&1 \
11-
// RUN: | FileCheck -check-prefixes=COMMON,SM21 %s
11+
// RUN: | FileCheck -check-prefixes=CUDA,SM21 %s
1212
// RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=sm_30 %s 2>&1 \
13-
// RUN: | FileCheck -check-prefixes=COMMON,SM30 %s
13+
// RUN: | FileCheck -check-prefixes=CUDA,SM30 %s
1414
// RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=sm_32 %s 2>&1 \
15-
// RUN: | FileCheck -check-prefixes=COMMON,SM32 %s
15+
// RUN: | FileCheck -check-prefixes=CUDA,SM32 %s
1616
// RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=sm_35 %s 2>&1 \
17-
// RUN: | FileCheck -check-prefixes=COMMON,SM35 %s
17+
// RUN: | FileCheck -check-prefixes=CUDA,SM35 %s
1818
// RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=sm_37 %s 2>&1 \
19-
// RUN: | FileCheck -check-prefixes=COMMON,SM37 %s
19+
// RUN: | FileCheck -check-prefixes=CUDA,SM37 %s
2020
// RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=sm_50 %s 2>&1 \
21-
// RUN: | FileCheck -check-prefixes=COMMON,SM50 %s
21+
// RUN: | FileCheck -check-prefixes=CUDA,SM50 %s
2222
// RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=sm_52 %s 2>&1 \
23-
// RUN: | FileCheck -check-prefixes=COMMON,SM52 %s
23+
// RUN: | FileCheck -check-prefixes=CUDA,SM52 %s
2424
// RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=sm_53 %s 2>&1 \
25-
// RUN: | FileCheck -check-prefixes=COMMON,SM53 %s
25+
// RUN: | FileCheck -check-prefixes=CUDA,SM53 %s
2626
// RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=sm_60 %s 2>&1 \
27-
// RUN: | FileCheck -check-prefixes=COMMON,SM60 %s
27+
// RUN: | FileCheck -check-prefixes=CUDA,SM60 %s
2828
// RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=sm_61 %s 2>&1 \
29-
// RUN: | FileCheck -check-prefixes=COMMON,SM61 %s
29+
// RUN: | FileCheck -check-prefixes=CUDA,SM61 %s
3030
// RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=sm_62 %s 2>&1 \
31-
// RUN: | FileCheck -check-prefixes=COMMON,SM62 %s
31+
// RUN: | FileCheck -check-prefixes=CUDA,SM62 %s
3232
// RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=sm_70 %s 2>&1 \
33-
// RUN: | FileCheck -check-prefixes=COMMON,SM70 %s
34-
// RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=gfx600 %s 2>&1 \
35-
// RUN: | FileCheck -check-prefixes=COMMON,GFX600 %s
36-
// RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=gfx601 %s 2>&1 \
37-
// RUN: | FileCheck -check-prefixes=COMMON,GFX601 %s
38-
// RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=gfx602 %s 2>&1 \
39-
// RUN: | FileCheck -check-prefixes=COMMON,GFX602 %s
40-
// RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=gfx700 %s 2>&1 \
41-
// RUN: | FileCheck -check-prefixes=COMMON,GFX700 %s
42-
// RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=gfx701 %s 2>&1 \
43-
// RUN: | FileCheck -check-prefixes=COMMON,GFX701 %s
44-
// RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=gfx702 %s 2>&1 \
45-
// RUN: | FileCheck -check-prefixes=COMMON,GFX702 %s
46-
// RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=gfx703 %s 2>&1 \
47-
// RUN: | FileCheck -check-prefixes=COMMON,GFX703 %s
48-
// RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=gfx704 %s 2>&1 \
49-
// RUN: | FileCheck -check-prefixes=COMMON,GFX704 %s
50-
// RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=gfx705 %s 2>&1 \
51-
// RUN: | FileCheck -check-prefixes=COMMON,GFX705 %s
52-
// RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=gfx801 %s 2>&1 \
53-
// RUN: | FileCheck -check-prefixes=COMMON,GFX801 %s
54-
// RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=gfx802 %s 2>&1 \
55-
// RUN: | FileCheck -check-prefixes=COMMON,GFX802 %s
56-
// RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=gfx803 %s 2>&1 \
57-
// RUN: | FileCheck -check-prefixes=COMMON,GFX803 %s
58-
// RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=gfx805 %s 2>&1 \
59-
// RUN: | FileCheck -check-prefixes=COMMON,GFX805 %s
60-
// RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=gfx810 %s 2>&1 \
61-
// RUN: | FileCheck -check-prefixes=COMMON,GFX810 %s
62-
// RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=gfx900 %s 2>&1 \
63-
// RUN: | FileCheck -check-prefixes=COMMON,GFX900 %s
64-
// RUN: %clang -### -target x86_64-linux-gnu -c --cuda-gpu-arch=gfx902 %s 2>&1 \
65-
// RUN: | FileCheck -check-prefixes=COMMON,GFX902 %s
33+
// RUN: | FileCheck -check-prefixes=CUDA,SM70 %s
34+
// RUN: %clang -x hip -### -target x86_64-linux-gnu -c --cuda-gpu-arch=gfx600 %s 2>&1 \
35+
// RUN: | FileCheck -check-prefixes=HIP,GFX600 %s
36+
// RUN: %clang -x hip -### -target x86_64-linux-gnu -c --cuda-gpu-arch=gfx601 %s 2>&1 \
37+
// RUN: | FileCheck -check-prefixes=HIP,GFX601 %s
38+
// RUN: %clang -x hip -### -target x86_64-linux-gnu -c --cuda-gpu-arch=gfx602 %s 2>&1 \
39+
// RUN: | FileCheck -check-prefixes=HIP,GFX602 %s
40+
// RUN: %clang -x hip -### -target x86_64-linux-gnu -c --cuda-gpu-arch=gfx700 %s 2>&1 \
41+
// RUN: | FileCheck -check-prefixes=HIP,GFX700 %s
42+
// RUN: %clang -x hip -### -target x86_64-linux-gnu -c --cuda-gpu-arch=gfx701 %s 2>&1 \
43+
// RUN: | FileCheck -check-prefixes=HIP,GFX701 %s
44+
// RUN: %clang -x hip -### -target x86_64-linux-gnu -c --cuda-gpu-arch=gfx702 %s 2>&1 \
45+
// RUN: | FileCheck -check-prefixes=HIP,GFX702 %s
46+
// RUN: %clang -x hip -### -target x86_64-linux-gnu -c --cuda-gpu-arch=gfx703 %s 2>&1 \
47+
// RUN: | FileCheck -check-prefixes=HIP,GFX703 %s
48+
// RUN: %clang -x hip -### -target x86_64-linux-gnu -c --cuda-gpu-arch=gfx704 %s 2>&1 \
49+
// RUN: | FileCheck -check-prefixes=HIP,GFX704 %s
50+
// RUN: %clang -x hip -### -target x86_64-linux-gnu -c --cuda-gpu-arch=gfx705 %s 2>&1 \
51+
// RUN: | FileCheck -check-prefixes=HIP,GFX705 %s
52+
// RUN: %clang -x hip -### -target x86_64-linux-gnu -c --cuda-gpu-arch=gfx801 %s 2>&1 \
53+
// RUN: | FileCheck -check-prefixes=HIP,GFX801 %s
54+
// RUN: %clang -x hip -### -target x86_64-linux-gnu -c --cuda-gpu-arch=gfx802 %s 2>&1 \
55+
// RUN: | FileCheck -check-prefixes=HIP,GFX802 %s
56+
// RUN: %clang -x hip -### -target x86_64-linux-gnu -c --cuda-gpu-arch=gfx803 %s 2>&1 \
57+
// RUN: | FileCheck -check-prefixes=HIP,GFX803 %s
58+
// RUN: %clang -x hip -### -target x86_64-linux-gnu -c --cuda-gpu-arch=gfx805 %s 2>&1 \
59+
// RUN: | FileCheck -check-prefixes=HIP,GFX805 %s
60+
// RUN: %clang -x hip -### -target x86_64-linux-gnu -c --cuda-gpu-arch=gfx810 %s 2>&1 \
61+
// RUN: | FileCheck -check-prefixes=HIP,GFX810 %s
62+
// RUN: %clang -x hip -### -target x86_64-linux-gnu -c --cuda-gpu-arch=gfx900 %s 2>&1 \
63+
// RUN: | FileCheck -check-prefixes=HIP,GFX900 %s
64+
// RUN: %clang -x hip -### -target x86_64-linux-gnu -c --cuda-gpu-arch=gfx902 %s 2>&1 \
65+
// RUN: | FileCheck -check-prefixes=HIP,GFX902 %s
6666

67-
// COMMON: ptxas
68-
// COMMON-SAME: -m64
69-
// COMMON: fatbinary
67+
// CUDA: ptxas
68+
// CUDA-SAME: -m64
69+
// CUDA: fatbinary
70+
71+
// HIP: clang-offload-bundler
7072

7173
// SM20:--image=profile=sm_20{{.*}}--image=profile=compute_20
7274
// SM21:--image=profile=sm_21{{.*}}--image=profile=compute_20
@@ -81,19 +83,19 @@
8183
// SM61:--image=profile=sm_61{{.*}}--image=profile=compute_61
8284
// SM62:--image=profile=sm_62{{.*}}--image=profile=compute_62
8385
// SM70:--image=profile=sm_70{{.*}}--image=profile=compute_70
84-
// GFX600:--image=profile=gfx600{{.*}}--image=profile=compute_amdgcn
85-
// GFX601:--image=profile=gfx601{{.*}}--image=profile=compute_amdgcn
86-
// GFX602:--image=profile=gfx602{{.*}}--image=profile=compute_amdgcn
87-
// GFX700:--image=profile=gfx700{{.*}}--image=profile=compute_amdgcn
88-
// GFX701:--image=profile=gfx701{{.*}}--image=profile=compute_amdgcn
89-
// GFX702:--image=profile=gfx702{{.*}}--image=profile=compute_amdgcn
90-
// GFX703:--image=profile=gfx703{{.*}}--image=profile=compute_amdgcn
91-
// GFX704:--image=profile=gfx704{{.*}}--image=profile=compute_amdgcn
92-
// GFX705:--image=profile=gfx705{{.*}}--image=profile=compute_amdgcn
93-
// GFX801:--image=profile=gfx801{{.*}}--image=profile=compute_amdgcn
94-
// GFX802:--image=profile=gfx802{{.*}}--image=profile=compute_amdgcn
95-
// GFX803:--image=profile=gfx803{{.*}}--image=profile=compute_amdgcn
96-
// GFX805:--image=profile=gfx805{{.*}}--image=profile=compute_amdgcn
97-
// GFX810:--image=profile=gfx810{{.*}}--image=profile=compute_amdgcn
98-
// GFX900:--image=profile=gfx900{{.*}}--image=profile=compute_amdgcn
99-
// GFX902:--image=profile=gfx902{{.*}}--image=profile=compute_amdgcn
86+
// GFX600:-targets=host-x86_64-unknown-linux,hipv4-amdgcn-amd-amdhsa--gfx600
87+
// GFX601:-targets=host-x86_64-unknown-linux,hipv4-amdgcn-amd-amdhsa--gfx601
88+
// GFX602:-targets=host-x86_64-unknown-linux,hipv4-amdgcn-amd-amdhsa--gfx602
89+
// GFX700:-targets=host-x86_64-unknown-linux,hipv4-amdgcn-amd-amdhsa--gfx700
90+
// GFX701:-targets=host-x86_64-unknown-linux,hipv4-amdgcn-amd-amdhsa--gfx701
91+
// GFX702:-targets=host-x86_64-unknown-linux,hipv4-amdgcn-amd-amdhsa--gfx702
92+
// GFX703:-targets=host-x86_64-unknown-linux,hipv4-amdgcn-amd-amdhsa--gfx703
93+
// GFX704:-targets=host-x86_64-unknown-linux,hipv4-amdgcn-amd-amdhsa--gfx704
94+
// GFX705:-targets=host-x86_64-unknown-linux,hipv4-amdgcn-amd-amdhsa--gfx705
95+
// GFX801:-targets=host-x86_64-unknown-linux,hipv4-amdgcn-amd-amdhsa--gfx801
96+
// GFX802:-targets=host-x86_64-unknown-linux,hipv4-amdgcn-amd-amdhsa--gfx802
97+
// GFX803:-targets=host-x86_64-unknown-linux,hipv4-amdgcn-amd-amdhsa--gfx803
98+
// GFX805:-targets=host-x86_64-unknown-linux,hipv4-amdgcn-amd-amdhsa--gfx805
99+
// GFX810:-targets=host-x86_64-unknown-linux,hipv4-amdgcn-amd-amdhsa--gfx810
100+
// GFX900:-targets=host-x86_64-unknown-linux,hipv4-amdgcn-amd-amdhsa--gfx900
101+
// GFX902:-targets=host-x86_64-unknown-linux,hipv4-amdgcn-amd-amdhsa--gfx902

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@
2525
// RUN: | FileCheck -check-prefix OK %s
2626
// RUN: %clang -### -target x86_64-linux-gnu --cuda-gpu-arch=sm_52 -c %s 2>&1 \
2727
// RUN: | FileCheck -check-prefix OK %s
28-
// RUN: %clang -### -target x86_64-linux-gnu --cuda-gpu-arch=gfx908 -c %s 2>&1 \
28+
// RUN: %clang -### -x hip -target x86_64-linux-gnu --cuda-gpu-arch=gfx908 -c %s 2>&1 \
2929
// RUN: | FileCheck -check-prefix OK %s
30-
// RUN: %clang -### -target x86_64-linux-gnu --cuda-gpu-arch=gfx90a -c %s 2>&1 \
30+
// RUN: %clang -### -x hip -target x86_64-linux-gnu --cuda-gpu-arch=gfx90a -c %s 2>&1 \
3131
// RUN: | FileCheck -check-prefix OK %s
3232
// RUN: %clang -### -target x86_64-linux-gnu -c %s 2>&1 \
3333
// RUN: | FileCheck -check-prefix OK %s

clang/test/Driver/cuda-flush-denormals-to-zero.cu

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
// RUN: %clang -no-canonical-prefixes -### -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
1313

1414
// Test explicit argument, with CUDA offload kind
15-
// RUN: %clang -no-canonical-prefixes -### -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
16-
// RUN: %clang -no-canonical-prefixes -### -target x86_64-linux-gnu -c -march=haswell --cuda-gpu-arch=gfx803 -fno-gpu-flush-denormals-to-zero -nocudainc -nogpulib %s 2>&1 | FileCheck -check-prefix=NOFTZ %s
15+
// RUN: %clang -x hip -no-canonical-prefixes -### -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
16+
// RUN: %clang -x hip -no-canonical-prefixes -### -target x86_64-linux-gnu -c -march=haswell --cuda-gpu-arch=gfx803 -fno-gpu-flush-denormals-to-zero -nocudainc -nogpulib %s 2>&1 | FileCheck -check-prefix=NOFTZ %s
1717

1818
// Test explicit argument, with HIP offload kind
1919
// RUN: %clang -x hip -no-canonical-prefixes -### -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

0 commit comments

Comments
 (0)