1 // This tests uses the PATH environment variable. 2 // REQUIRES: !system-windows 3 4 // RUN: env PATH=%S/Inputs/CUDA/usr/local/cuda/bin \ 5 // RUN: %clang -v --target=i386-unknown-linux --sysroot=%S/no-cuda-there \ 6 // RUN: 2>&1 | FileCheck %s 7 // RUN: env PATH=%S/Inputs/CUDA/usr/local/cuda/bin \ 8 // RUN: %clang -v --target=i386-apple-macosx --sysroot=%S/no-cuda-there \ 9 // RUN: 2>&1 | FileCheck %s 10 // RUN: env PATH=%S/Inputs/CUDA/usr/local/cuda/bin \ 11 // RUN: %clang -v --target=x86_64-unknown-linux --sysroot=%S/no-cuda-there \ 12 // RUN: 2>&1 | FileCheck %s 13 // RUN: env PATH=%S/Inputs/CUDA/usr/local/cuda/bin \ 14 // RUN: %clang -v --target=x86_64-apple-macosx --sysroot=%S/no-cuda-there \ 15 // RUN: 2>&1 | FileCheck %s 16 17 18 // Check that we follow ptxas binaries that are symlinks. 19 // RUN: env PATH=%S/Inputs/CUDA-symlinks/usr/bin \ 20 // RUN: %clang -v --target=i386-unknown-linux --sysroot=%S/no-cuda-there \ 21 // RUN: 2>&1 | FileCheck %s --check-prefix SYMLINKS 22 // RUN: env PATH=%S/Inputs/CUDA-symlinks/usr/bin \ 23 // RUN: %clang -v --target=i386-apple-macosx --sysroot=%S/no-cuda-there \ 24 // RUN: 2>&1 | FileCheck %s --check-prefix SYMLINKS 25 // RUN: env PATH=%S/Inputs/CUDA-symlinks/usr/bin \ 26 // RUN: %clang -v --target=x86_64-unknown-linux --sysroot=%S/no-cuda-there \ 27 // RUN: 2>&1 | FileCheck %s --check-prefix SYMLINKS 28 // RUN: env PATH=%S/Inputs/CUDA-symlinks/usr/bin \ 29 // RUN: %clang -v --target=x86_64-apple-macosx --sysroot=%S/no-cuda-there \ 30 // RUN: 2>&1 | FileCheck %s --check-prefix SYMLINKS 31 32 33 // We only take a CUDA installation from PATH if it contains libdevice. 34 // RUN: env PATH=%S/Inputs/CUDA-nolibdevice/usr/local/cuda/bin \ 35 // RUN: %clang -v --target=i386-unknown-linux --sysroot=%S/no-cuda-there \ 36 // RUN: 2>&1 | FileCheck %s --check-prefix NOCUDA 37 // RUN: env PATH=%S/Inputs/CUDA-nolibdevice/usr/local/cuda/bin \ 38 // RUN: %clang -v --target=i386-apple-macosx --sysroot=%S/no-cuda-there \ 39 // RUN: 2>&1 | FileCheck %s --check-prefix NOCUDA 40 // RUN: env PATH=%S/Inputs/CUDA-nolibdevice/usr/local/cuda/bin \ 41 // RUN: %clang -v --target=x86_64-unknown-linux --sysroot=%S/no-cuda-there \ 42 // RUN: 2>&1 | FileCheck %s --check-prefix NOCUDA 43 // RUN: env PATH=%S/Inputs/CUDA-nolibdevice/usr/local/cuda/bin \ 44 // RUN: %clang -v --target=x86_64-apple-macosx --sysroot=%S/no-cuda-there \ 45 // RUN: 2>&1 | FileCheck %s --check-prefix NOCUDA 46 47 // We even require libdevice if -nocudalib is passed to avoid false positives 48 // if the distribution merges CUDA into /usr and ptxas ends up /usr/bin. 49 // RUN: env PATH=%S/Inputs/CUDA-nolibdevice/usr/local/cuda/bin \ 50 // RUN: %clang -v --target=i386-unknown-linux --sysroot=%S/no-cuda-there -nocudalib \ 51 // RUN: 2>&1 | FileCheck %s --check-prefix NOCUDA 52 // RUN: env PATH=%S/Inputs/CUDA-nolibdevice/usr/local/cuda/bin \ 53 // RUN: %clang -v --target=i386-apple-macosx --sysroot=%S/no-cuda-there -nocudalib \ 54 // RUN: 2>&1 | FileCheck %s --check-prefix NOCUDA 55 // RUN: env PATH=%S/Inputs/CUDA-nolibdevice/usr/local/cuda/bin \ 56 // RUN: %clang -v --target=x86_64-unknown-linux --sysroot=%S/no-cuda-there -nocudalib \ 57 // RUN: 2>&1 | FileCheck %s --check-prefix NOCUDA 58 // RUN: env PATH=%S/Inputs/CUDA-nolibdevice/usr/local/cuda/bin \ 59 // RUN: %clang -v --target=x86_64-apple-macosx --sysroot=%S/no-cuda-there -nocudalib \ 60 // RUN: 2>&1 | FileCheck %s --check-prefix NOCUDA 61 62 63 // Check that the CUDA installation in PATH is not taken when passing 64 // the option --cuda-path-ignore-env. 65 // RUN: env PATH=%S/Inputs/CUDA/usr/local/cuda/bin \ 66 // RUN: %clang -v --target=i386-unknown-linux --sysroot=%S/no-cuda-there --cuda-path-ignore-env \ 67 // RUN: 2>&1 | FileCheck %s --check-prefix NOCUDA 68 // RUN: env PATH=%S/Inputs/CUDA/usr/local/cuda/bin \ 69 // RUN: %clang -v --target=i386-apple-macosx --sysroot=%S/no-cuda-there --cuda-path-ignore-env \ 70 // RUN: 2>&1 | FileCheck %s --check-prefix NOCUDA 71 // RUN: env PATH=%S/Inputs/CUDA/usr/local/cuda/bin \ 72 // RUN: %clang -v --target=x86_64-unknown-linux --sysroot=%S/no-cuda-there --cuda-path-ignore-env \ 73 // RUN: 2>&1 | FileCheck %s --check-prefix NOCUDA 74 // RUN: env PATH=%S/Inputs/CUDA/usr/local/cuda/bin \ 75 // RUN: %clang -v --target=x86_64-apple-macosx --sysroot=%S/no-cuda-there --cuda-path-ignore-env \ 76 // RUN: 2>&1 | FileCheck %s --check-prefix NOCUDA 77 78 // CHECK: Found CUDA installation: {{.*}}/Inputs/CUDA/usr/local/cuda 79 // SYMLINKS: Found CUDA installation: {{.*}}/Inputs/CUDA-symlinks/opt/cuda 80 // NOCUDA-NOT: Found CUDA installation: 81