[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / Driver / amdgpu-hip-system-arch.c
blobe70e65bc1abbd4f3f1dc54891c38d37f14d7bf50
1 // REQUIRES: system-linux
2 // REQUIRES: x86-registered-target
3 // REQUIRES: amdgpu-registered-target
4 // REQUIRES: shell
6 // RUN: mkdir -p %t
7 // RUN: cp %S/Inputs/amdgpu-arch/amdgpu_arch_fail %t/
8 // RUN: cp %S/Inputs/amdgpu-arch/amdgpu_arch_gfx906 %t/
9 // RUN: echo '#!/bin/sh' > %t/amdgpu_arch_empty
10 // RUN: chmod +x %t/amdgpu_arch_fail
11 // RUN: chmod +x %t/amdgpu_arch_gfx906
12 // RUN: chmod +x %t/amdgpu_arch_empty
14 // case when amdgpu-arch returns nothing or fails
15 // RUN: %clang -### --target=x86_64-unknown-linux-gnu -nogpulib --offload-arch=native --amdgpu-arch-tool=%t/amdgpu_arch_fail -x hip %s 2>&1 \
16 // RUN: | FileCheck %s --check-prefix=NO-OUTPUT-ERROR
17 // RUN: %clang -### --target=x86_64-unknown-linux-gnu -nogpulib --offload-new-driver --offload-arch=native --amdgpu-arch-tool=%t/amdgpu_arch_fail -x hip %s 2>&1 \
18 // RUN: | FileCheck %s --check-prefix=NO-OUTPUT-ERROR
19 // NO-OUTPUT-ERROR: error: cannot determine amdgcn architecture{{.*}}; consider passing it via '--offload-arch'
21 // case when amdgpu-arch does not return anything with successful execution
22 // RUN: %clang -### --target=x86_64-unknown-linux-gnu -nogpulib --offload-arch=native --amdgpu-arch-tool=%t/amdgpu_arch_empty -x hip %s 2>&1 \
23 // RUN: | FileCheck %s --check-prefix=EMPTY-OUTPUT
24 // RUN: %clang -### --target=x86_64-unknown-linux-gnu -nogpulib --offload-new-driver --offload-arch=native --amdgpu-arch-tool=%t/amdgpu_arch_empty -x hip %s 2>&1 \
25 // RUN: | FileCheck %s --check-prefix=EMPTY-OUTPUT
26 // EMPTY-OUTPUT: error: cannot determine amdgcn architecture: No AMD GPU detected in the system; consider passing it via '--offload-arch'
28 // case when amdgpu-arch returns a gfx906 GPU.
29 // RUN: %clang -### --target=x86_64-unknown-linux-gnu -nogpulib --offload-arch=native --amdgpu-arch-tool=%t/amdgpu_arch_gfx906 -x hip %s 2>&1 \
30 // RUN: | FileCheck %s --check-prefix=ARCH-GFX906
31 // RUN: %clang -### --target=x86_64-unknown-linux-gnu -nogpulib --offload-new-driver --offload-arch=native --amdgpu-arch-tool=%t/amdgpu_arch_gfx906 -x hip %s 2>&1 \
32 // RUN: | FileCheck %s --check-prefix=ARCH-GFX906
33 // ARCH-GFX906: "-cc1" "-triple" "amdgcn-amd-amdhsa"{{.*}}"-target-cpu" "gfx906"