1 // Tests CUDA compilation with -S and -emit-llvm.
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
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"
20 // RUN: not %clang -### -S --target=x86_64-linux-gnu -o foo.s %s 2>&1 \
21 // RUN: | FileCheck -check-prefix MULTIPLE-OUTPUT-FILES %s
22 // RUN: not %clang -### -S --target=x86_64-linux-gnu --cuda-device-only \
23 // RUN: --cuda-gpu-arch=sm_20 --cuda-gpu-arch=sm_30 -o foo.s %s 2>&1 \
24 // RUN: | FileCheck -check-prefix MULTIPLE-OUTPUT-FILES %s
25 // RUN: not %clang -### -emit-llvm -c --target=x86_64-linux-gnu -o foo.s %s 2>&1 \
26 // RUN: | FileCheck -check-prefix MULTIPLE-OUTPUT-FILES %s
27 // MULTIPLE-OUTPUT-FILES: error: cannot specify -o when generating multiple output files
28 // Make sure we do not get duplicate diagnostics.
29 // MULTIPLE-OUTPUT-FILES-NOT: error: cannot specify -o when generating multiple output files