1 // Test clang driver bails out after one error during CUDA compilation.
3 // REQUIRES: powerpc-registered-target
4 // REQUIRES: nvptx-registered-target
7 #error compilation failed
10 // RUN: not %clang -target powerpc64le-ibm-linux-gnu -fsyntax-only -nocudalib \
11 // RUN: -nocudainc -DFORCE_ERROR %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: %s 2>&1 | FileCheck %s
15 // RUN: not %clang -target powerpc64le-ibm-linux-gnu -fsyntax-only -nocudalib \
16 // RUN: -nocudainc -DFORCE_ERROR --cuda-gpu-arch=sm_35 --cuda-gpu-arch=sm_60 \
17 // RUN: --cuda-device-only %s 2>&1 | FileCheck %s
19 #if defined(ERROR_HOST) && !defined(__CUDA_ARCH__)
20 #error compilation failed
23 #if defined(ERROR_SM35) && (__CUDA_ARCH__ == 350)
24 #error compilation failed
27 #if defined(ERROR_SM60) && (__CUDA_ARCH__ == 600)
28 #error compilation failed
31 // RUN: not %clang -target powerpc64le-ibm-linux-gnu -fsyntax-only -nocudalib \
32 // RUN: -nocudainc -DERROR_HOST --cuda-gpu-arch=sm_35 --cuda-gpu-arch=sm_60 \
33 // RUN: %s 2>&1 | FileCheck %s
34 // RUN: not %clang -target powerpc64le-ibm-linux-gnu -fsyntax-only -nocudalib \
35 // RUN: -nocudainc -DERROR_SM35 --cuda-gpu-arch=sm_35 --cuda-gpu-arch=sm_60 \
36 // RUN: --cuda-device-only %s 2>&1 | FileCheck %s
37 // RUN: not %clang -target powerpc64le-ibm-linux-gnu -fsyntax-only -nocudalib \
38 // RUN: -nocudainc -DERROR_SM60 --cuda-gpu-arch=sm_35 --cuda-gpu-arch=sm_60 \
39 // RUN: --cuda-device-only %s 2>&1 | FileCheck %s
41 // RUN: not %clang -target powerpc64le-ibm-linux-gnu -fsyntax-only -nocudalib \
42 // RUN: -nocudainc -DERROR_HOST -DERROR_SM35 --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_HOST -DERROR_SM60 --cuda-gpu-arch=sm_35 \
46 // RUN: --cuda-gpu-arch=sm_60 %s 2>&1 | FileCheck %s
47 // RUN: not %clang -target powerpc64le-ibm-linux-gnu -fsyntax-only -nocudalib \
48 // RUN: -nocudainc -DERROR_SM35 -DERROR_SM60 --cuda-gpu-arch=sm_35 \
49 // RUN: --cuda-gpu-arch=sm_60 %s 2>&1 | FileCheck %s
52 // CHECK: error: compilation failed
53 // CHECK-NOT: error: compilation failed