Debian Codegraph @

clang/test/Driver/cuda-bail-out.cu

raw
1 // Test clang driver bails out after one error during CUDA compilation.
2
3 #ifdef FORCE_ERROR
4 #error compilation failed
5 #endif
6
7 // RUN: not %clang -target powerpc64le-ibm-linux-gnu -fsyntax-only -nocudalib \
8 // RUN: -nocudainc -DFORCE_ERROR %s 2>&1 | FileCheck %s
9 // RUN: not %clang -target powerpc64le-ibm-linux-gnu -fsyntax-only -nocudalib \
10 // RUN: -nocudainc -DFORCE_ERROR --cuda-gpu-arch=sm_35 --cuda-gpu-arch=sm_60 \
11 // RUN: %s 2>&1 | FileCheck %s
12 // RUN: not %clang -target powerpc64le-ibm-linux-gnu -fsyntax-only -nocudalib \
13 // RUN: -nocudainc -DFORCE_ERROR --cuda-gpu-arch=sm_35 --cuda-gpu-arch=sm_60 \
14 // RUN: --cuda-device-only %s 2>&1 | FileCheck %s
15
16 #if defined(ERROR_HOST) && !defined(__CUDA_ARCH__)
17 #error compilation failed
18 #endif
19
20 #if defined(ERROR_SM35) && (__CUDA_ARCH__ == 350)
21 #error compilation failed
22 #endif
23
24 #if defined(ERROR_SM60) && (__CUDA_ARCH__ == 600)
25 #error compilation failed
26 #endif
27
28 // RUN: not %clang -target powerpc64le-ibm-linux-gnu -fsyntax-only -nocudalib \
29 // RUN: -nocudainc -DERROR_HOST --cuda-gpu-arch=sm_35 --cuda-gpu-arch=sm_60 \
30 // RUN: %s 2>&1 | FileCheck %s
31 // RUN: not %clang -target powerpc64le-ibm-linux-gnu -fsyntax-only -nocudalib \
32 // RUN: -nocudainc -DERROR_SM35 --cuda-gpu-arch=sm_35 --cuda-gpu-arch=sm_60 \
33 // RUN: --cuda-device-only %s 2>&1 | FileCheck %s
34 // RUN: not %clang -target powerpc64le-ibm-linux-gnu -fsyntax-only -nocudalib \
35 // RUN: -nocudainc -DERROR_SM60 --cuda-gpu-arch=sm_35 --cuda-gpu-arch=sm_60 \
36 // RUN: --cuda-device-only %s 2>&1 | FileCheck %s
37
38 // RUN: not %clang -target powerpc64le-ibm-linux-gnu -fsyntax-only -nocudalib \
39 // RUN: -nocudainc -DERROR_HOST -DERROR_SM35 --cuda-gpu-arch=sm_35 \
40 // RUN: --cuda-gpu-arch=sm_60 %s 2>&1 | FileCheck %s
41 // RUN: not %clang -target powerpc64le-ibm-linux-gnu -fsyntax-only -nocudalib \
42 // RUN: -nocudainc -DERROR_HOST -DERROR_SM60 --cuda-gpu-arch=sm_35 \
43 // RUN: --cuda-gpu-arch=sm_60 %s 2>&1 | FileCheck %s
44 // RUN: not %clang -target powerpc64le-ibm-linux-gnu -fsyntax-only -nocudalib \
45 // RUN: -nocudainc -DERROR_SM35 -DERROR_SM60 --cuda-gpu-arch=sm_35 \
46 // RUN: --cuda-gpu-arch=sm_60 %s 2>&1 | FileCheck %s
47
48
49 // CHECK: error: compilation failed
50 // CHECK-NOT: error: compilation failed