| 1 |
// UNSUPPORTED: system-windows |
| 2 |
|
| 3 |
// RUN: not %clang -### -x hip --target=x86_64-linux-gnu --offload= \ |
| 4 |
// RUN: --hip-path=%S/Inputs/hipspv -nogpuinc -nogpulib %s \ |
| 5 |
// RUN: 2>&1 | FileCheck --check-prefix=INVALID-TARGET %s |
| 6 |
// RUN: not %clang -### -x hip --target=x86_64-linux-gnu --offload=foo \ |
| 7 |
// RUN: --hip-path=%S/Inputs/hipspv -nogpuinc -nogpulib %s \ |
| 8 |
// RUN: 2>&1 | FileCheck --check-prefix=INVALID-TARGET %s |
| 9 |
|
| 10 |
// INVALID-TARGET: error: invalid or unsupported offload target: '{{.*}}' |
| 11 |
|
| 12 |
// In the future we should be able to specify multiple targets for HIP |
| 13 |
// compilation but currently it is not supported. |
| 14 |
// |
| 15 |
// RUN: not %clang -### -x hip --target=x86_64-linux-gnu --offload=foo,bar \ |
| 16 |
// RUN: --hip-path=%S/Inputs/hipspv -nogpuinc -nogpulib %s \ |
| 17 |
// RUN: 2>&1 | FileCheck --check-prefix=TOO-MANY-TARGETS %s |
| 18 |
// RUN: not %clang -### -x hip --target=x86_64-linux-gnu \ |
| 19 |
// RUN: --offload=foo --offload=bar \ |
| 20 |
// RUN: --hip-path=%S/Inputs/hipspv -nogpuinc -nogpulib %s \ |
| 21 |
// RUN: 2>&1 | FileCheck --check-prefix=TOO-MANY-TARGETS %s |
| 22 |
|
| 23 |
// TOO-MANY-TARGETS: error: only one offload target is supported |
| 24 |
|
| 25 |
// RUN: not %clang -### -x hip --target=x86_64-linux-gnu -nogpuinc -nogpulib \ |
| 26 |
// RUN: --offload=amdgcn-amd-amdhsa --offload-arch=gfx900 %s \ |
| 27 |
// RUN: 2>&1 | FileCheck --check-prefix=OFFLOAD-ARCH-MIX %s |
| 28 |
|
| 29 |
// OFFLOAD-ARCH-MIX: error: option '--offload-arch' cannot be specified with '--offload' |