]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/Driver/cuda-bad-arch.cu
Vendor import of clang trunk r290819:
[FreeBSD/FreeBSD.git] / test / Driver / cuda-bad-arch.cu
1 // Checks errors generated by passing a bad value for --cuda-gpu-arch.
2 // REQUIRES: clang-driver
3 // REQUIRES: x86-registered-target
4 // REQUIRES: nvptx-registered-target
5
6 // RUN: %clang -### -target x86_64-linux-gnu --cuda-gpu-arch=compute_20 -c %s 2>&1 \
7 // RUN: | FileCheck -check-prefix BAD %s
8 // RUN: %clang -### -target x86_64-linux-gnu --cuda-gpu-arch=sm20 -c %s 2>&1 \
9 // RUN: | FileCheck -check-prefix BAD %s
10 // RUN: %clang -### -target x86_64-linux-gnu --cuda-gpu-arch=sm_19 -c %s 2>&1 \
11 // RUN: | FileCheck -check-prefix BAD %s
12
13 // BAD: error: Unsupported CUDA gpu architecture
14
15 // RUN: %clang -### -target x86_64-linux-gnu --cuda-gpu-arch=sm_20 -c %s 2>&1 \
16 // RUN: | FileCheck -check-prefix OK %s
17 // RUN: %clang -### -target x86_64-linux-gnu --cuda-gpu-arch=sm_52 -c %s 2>&1 \
18 // RUN: | FileCheck -check-prefix OK %s
19 // RUN: %clang -### -target x86_64-linux-gnu -c %s 2>&1 \
20 // RUN: | FileCheck -check-prefix OK %s
21
22 // We don't allow using NVPTX for host compilation.
23 // RUN: %clang -### --cuda-host-only -target nvptx-nvidia-cuda -c %s 2>&1 \
24 // RUN: | FileCheck -check-prefix HOST_NVPTX %s
25
26 // OK-NOT: error: Unsupported CUDA gpu architecture
27 // HOST_NVPTX: error: unsupported use of NVPTX for host compilation.