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