1 // REQUIRES: shell 2 3 // RUN: mkdir -p %t 4 // RUN: rm -f %t/amdgpu_arch_fail %t/amdgpu_arch_different 5 // RUN: cp %S/Inputs/amdgpu-arch/amdgpu_arch_fail %t/ 6 // RUN: cp %S/Inputs/amdgpu-arch/amdgpu_arch_different %t/ 7 // RUN: echo '#!/bin/sh' > %t/amdgpu_arch_empty 8 // RUN: chmod +x %t/amdgpu_arch_fail 9 // RUN: chmod +x %t/amdgpu_arch_different 10 // RUN: chmod +x %t/amdgpu_arch_empty 11 12 // case when amdgpu_arch returns nothing or fails 13 // RUN: not %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 \ 14 // RUN: | FileCheck %s --check-prefix=NO-OUTPUT-ERROR 15 // NO-OUTPUT-ERROR: error: cannot determine amdgcn architecture{{.*}}; consider passing it via '-march' 16 17 // case when amdgpu_arch does not return anything with successful execution 18 // RUN: not %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 \ 19 // RUN: | FileCheck %s --check-prefix=EMPTY-OUTPUT 20 // EMPTY-OUTPUT: error: cannot determine amdgcn architecture: No AMD GPU detected in the system; consider passing it via '-march' 21