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