Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / Driver / invalid-offload-options.cpp
blobf9bb5cf9ab56368b685165aa7e8ea6b8f2380024
1 // REQUIRES: x86-registered-target
2 // UNSUPPORTED: system-windows
4 // RUN: not %clang -### -x hip --target=x86_64-linux-gnu --offload= \
5 // RUN: --hip-path=%S/Inputs/hipspv -nogpuinc -nogpulib %s \
6 // RUN: 2>&1 | FileCheck --check-prefix=INVALID-TARGET %s
7 // RUN: not %clang -### -x hip --target=x86_64-linux-gnu --offload=foo \
8 // RUN: --hip-path=%S/Inputs/hipspv -nogpuinc -nogpulib %s \
9 // RUN: 2>&1 | FileCheck --check-prefix=INVALID-TARGET %s
11 // INVALID-TARGET: error: invalid or unsupported offload target: '{{.*}}'
13 // In the future we should be able to specify multiple targets for HIP
14 // compilation but currently it is not supported.
16 // RUN: not %clang -### -x hip --target=x86_64-linux-gnu --offload=foo,bar \
17 // RUN: --hip-path=%S/Inputs/hipspv -nogpuinc -nogpulib %s \
18 // RUN: 2>&1 | FileCheck --check-prefix=TOO-MANY-TARGETS %s
19 // RUN: not %clang -### -x hip --target=x86_64-linux-gnu \
20 // RUN: --offload=foo --offload=bar \
21 // RUN: --hip-path=%S/Inputs/hipspv -nogpuinc -nogpulib %s \
22 // RUN: 2>&1 | FileCheck --check-prefix=TOO-MANY-TARGETS %s
24 // TOO-MANY-TARGETS: error: only one offload target is supported
26 // RUN: not %clang -### -x hip --target=x86_64-linux-gnu -nogpuinc -nogpulib \
27 // RUN: --offload=amdgcn-amd-amdhsa --offload-arch=gfx900 %s \
28 // RUN: 2>&1 | FileCheck --check-prefix=OFFLOAD-ARCH-MIX %s
30 // OFFLOAD-ARCH-MIX: error: option '--offload-arch' cannot be specified with '--offload'