xref: /aosp_15_r20/external/clang/test/Driver/cuda-not-found.cu (revision 67e74705e28f6214e480b399dd47ea732279e315)
1*67e74705SXin Li // REQUIRES: clang-driver
2*67e74705SXin Li 
3*67e74705SXin Li // Check that we raise an error if we're trying to compile CUDA code but can't
4*67e74705SXin Li // find a CUDA install, unless -nocudainc was passed.
5*67e74705SXin Li 
6*67e74705SXin Li // RUN: %clang -### --sysroot=%s/no-cuda-there %s 2>&1 | FileCheck %s --check-prefix ERR
7*67e74705SXin Li // RUN: %clang -### --cuda-path=%s/no-cuda-there %s 2>&1 | FileCheck %s --check-prefix ERR
8*67e74705SXin Li // ERR: cannot find CUDA installation
9*67e74705SXin Li 
10*67e74705SXin Li // RUN: %clang -### -nocudainc --sysroot=%s/no-cuda-there %s 2>&1 | FileCheck %s --check-prefix OK
11*67e74705SXin Li // RUN: %clang -### -nocudainc --cuda-path=%s/no-cuda-there %s 2>&1 | FileCheck %s --check-prefix OK
12*67e74705SXin Li // OK-NOT: cannot find CUDA installation
13