Artem Belevich | 98607b6 | 2015-09-23 21:49:39 +0000 | [diff] [blame] | 1 | // REQUIRES: clang-driver |
| 2 | // REQUIRES: x86-registered-target |
Artem Belevich | fa11ab5 | 2015-11-17 22:28:46 +0000 | [diff] [blame^] | 3 | // REQUIRES: nvptx-registered-target |
Artem Belevich | 98607b6 | 2015-09-23 21:49:39 +0000 | [diff] [blame] | 4 | // |
Artem Belevich | fa11ab5 | 2015-11-17 22:28:46 +0000 | [diff] [blame^] | 5 | // # Check that we properly detect CUDA installation. |
Artem Belevich | 98607b6 | 2015-09-23 21:49:39 +0000 | [diff] [blame] | 6 | // RUN: %clang -v --target=i386-unknown-linux \ |
Artem Belevich | fa11ab5 | 2015-11-17 22:28:46 +0000 | [diff] [blame^] | 7 | // RUN: --sysroot=%S/no-cuda-there 2>&1 | FileCheck %s -check-prefix NOCUDA |
| 8 | // RUN: %clang -v --target=i386-unknown-linux \ |
| 9 | // RUN: --sysroot=%S/Inputs/CUDA 2>&1 | FileCheck %s |
Artem Belevich | 98607b6 | 2015-09-23 21:49:39 +0000 | [diff] [blame] | 10 | // RUN: %clang -v --target=i386-unknown-linux \ |
Artem Belevich | 98607b6 | 2015-09-23 21:49:39 +0000 | [diff] [blame] | 11 | // RUN: --cuda-path=%S/Inputs/CUDA/usr/local/cuda 2>&1 | FileCheck %s |
| 12 | |
Artem Belevich | fa11ab5 | 2015-11-17 22:28:46 +0000 | [diff] [blame^] | 13 | // Verify that CUDA include path gets added |
| 14 | // RUN: %clang -### -v --target=i386-unknown-linux --cuda-gpu-arch=sm_35 \ |
| 15 | // RUN: --cuda-path=%S/Inputs/CUDA/usr/local/cuda %s 2>&1 \ |
| 16 | // RUN: | FileCheck %s -check-prefix COMMON -check-prefix CUDAINC |
| 17 | // Verify that -nocudainc disables CUDA include paths. |
| 18 | // RUN: %clang -### -v --target=i386-unknown-linux --cuda-gpu-arch=sm_35 \ |
| 19 | // RUN: -nocudainc --cuda-path=%S/Inputs/CUDA/usr/local/cuda %s 2>&1 \ |
| 20 | // RUN: | FileCheck %s -check-prefix COMMON -check-prefix NOCUDAINC |
| 21 | // We should not add any CUDA include paths if there's no valid CUDA installation |
| 22 | // RUN: %clang -### -v --target=i386-unknown-linux --cuda-gpu-arch=sm_35 \ |
| 23 | // RUN: --cuda-path=%S/no-cuda-there %s 2>&1 \ |
| 24 | // RUN: | FileCheck %s -check-prefix COMMON -check-prefix NOCUDAINC |
| 25 | |
Artem Belevich | 98607b6 | 2015-09-23 21:49:39 +0000 | [diff] [blame] | 26 | // CHECK: Found CUDA installation: {{.*}}/Inputs/CUDA/usr/local/cuda |
| 27 | // NOCUDA-NOT: Found CUDA installation: |
Artem Belevich | fa11ab5 | 2015-11-17 22:28:46 +0000 | [diff] [blame^] | 28 | |
| 29 | // COMMON: "-triple" "nvptx-nvidia-cuda" |
| 30 | // COMMON-SAME: "-fcuda-is-device" |
| 31 | // CUDAINC-SAME: "-internal-isystem" "{{.*}}/Inputs/CUDA/usr/local/cuda/include" |
| 32 | // NOCUDAINC-NOT: "-internal-isystem" "{{.*}}/cuda/include" |
| 33 | // COMMON-SAME: "-x" "cuda" |
| 34 | |