1 // REQUIRES: system-linux
2 // REQUIRES: x86-registered-target
3 // REQUIRES: amdgpu-registered-target
7 // RUN: rm -f %t/amdgpu_arch_fail %t/amdgpu_arch_different
8 // RUN: cp %S/Inputs/amdgpu-arch/amdgpu_arch_fail %t/
9 // RUN: cp %S/Inputs/amdgpu-arch/amdgpu_arch_different %t/
10 // RUN: echo '#!/bin/sh' > %t/amdgpu_arch_empty
11 // RUN: chmod +x %t/amdgpu_arch_fail
12 // RUN: chmod +x %t/amdgpu_arch_different
13 // RUN: chmod +x %t/amdgpu_arch_empty
15 // case when amdgpu_arch returns nothing or fails
16 // RUN: %clang -### --target=x86_64-unknown-linux-gnu -fopenmp=libomp -fopenmp-targets=amdgcn-amd-amdhsa -nogpulib --amdgpu-arch-tool=%t/amdgpu_arch_fail %s 2>&1 \
17 // RUN: | FileCheck %s --check-prefix=NO-OUTPUT-ERROR
18 // NO-OUTPUT-ERROR: error: cannot determine amdgcn architecture{{.*}}; consider passing it via '-march'
20 // case when amdgpu_arch does not return anything with successful execution
21 // RUN: %clang -### --target=x86_64-unknown-linux-gnu -fopenmp=libomp -fopenmp-targets=amdgcn-amd-amdhsa -nogpulib --amdgpu-arch-tool=%t/amdgpu_arch_empty %s 2>&1 \
22 // RUN: | FileCheck %s --check-prefix=EMPTY-OUTPUT
23 // EMPTY-OUTPUT: error: cannot determine amdgcn architecture: No AMD GPU detected in the system; consider passing it via '-march'