| 1 |
// Tests CUDA compilation with -S and -emit-llvm. |
| 2 |
|
| 3 |
// RUN: %clang -### -S --target=x86_64-linux-gnu --cuda-gpu-arch=sm_20 --cuda-path=%S/Inputs/CUDA_80/usr/local/cuda %s 2>&1 \ |
| 4 |
// RUN: | FileCheck -check-prefix HOST -check-prefix SM20 %s |
| 5 |
// RUN: %clang -### -S --target=x86_64-linux-gnu --cuda-host-only -o foo.s --cuda-path=%S/Inputs/CUDA_80/usr/local/cuda %s 2>&1 \ |
| 6 |
// RUN: | FileCheck -check-prefix HOST %s |
| 7 |
// RUN: %clang -### -S --target=x86_64-linux-gnu --cuda-gpu-arch=sm_20 \ |
| 8 |
// RUN: --cuda-device-only -o foo.s --cuda-path=%S/Inputs/CUDA_80/usr/local/cuda %s 2>&1 \ |
| 9 |
// RUN: | FileCheck -check-prefix SM20 %s |
| 10 |
// RUN: %clang -### -S --target=x86_64-linux-gnu --cuda-gpu-arch=sm_20 \ |
| 11 |
// RUN: --cuda-gpu-arch=sm_30 --cuda-device-only --cuda-path=%S/Inputs/CUDA_80/usr/local/cuda %s 2>&1 \ |
| 12 |
// RUN: | FileCheck -check-prefix SM20 -check-prefix SM30 %s |
| 13 |
|
| 14 |
// HOST-DAG: "-cc1" "-triple" "x86_64-unknown-linux-gnu" |
| 15 |
// SM20-DAG: "-cc1" "-triple" "nvptx64-nvidia-cuda" |
| 16 |
// SM20-same: "-target-cpu" "sm_20" |
| 17 |
// SM30-DAG: "-cc1" "-triple" "nvptx64-nvidia-cuda" |
| 18 |
// SM30-same: "-target-cpu" "sm_30" |
| 19 |
|
| 20 |
// RUN: not %clang -### -S --target=x86_64-linux-gnu --cuda-device-only \ |
| 21 |
// RUN: --cuda-gpu-arch=sm_20 --cuda-gpu-arch=sm_30 -o foo.s %s 2>&1 \ |
| 22 |
// RUN: | FileCheck -check-prefix MULTIPLE-OUTPUT-FILES %s |
| 23 |
// MULTIPLE-OUTPUT-FILES: error: cannot specify -o when generating multiple output files |
| 24 |
// Make sure we do not get duplicate diagnostics. |
| 25 |
// MULTIPLE-OUTPUT-FILES-NOT: error: cannot specify -o when generating multiple output files |