diff options
Diffstat (limited to 'clang/test/OpenMP/target_messages.cpp')
-rw-r--r-- | clang/test/OpenMP/target_messages.cpp | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/clang/test/OpenMP/target_messages.cpp b/clang/test/OpenMP/target_messages.cpp index 25db02690c3..52dbe4900d6 100644 --- a/clang/test/OpenMP/target_messages.cpp +++ b/clang/test/OpenMP/target_messages.cpp @@ -9,6 +9,25 @@ // RUN: not %clang_cc1 -fopenmp -std=c++11 -fopenmp-targets=hexagon-linux-gnu -o - %s 2>&1 | FileCheck --check-prefix CHECK-UNSUPPORTED-DEVICE-TARGET %s // CHECK-UNSUPPORTED-DEVICE-TARGET: OpenMP target is invalid: 'hexagon-linux-gnu' +// RUN: not %clang_cc1 -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path 1111.bc -o - 2>&1 | FileCheck --check-prefix NO-HOST-BC %s +// NO-HOST-BC: The provided host compiler IR file '1111.bc' is required to generate code for OpenMP target regions but cannot be found. + +// RUN: %clang_cc1 -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm-bc %s -o %t-ppc-host.bc -DREGION_HOST +// RUN: not %clang_cc1 -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -o - -DREGION_DEVICE 2>&1 | FileCheck %s --check-prefix NO-REGION +// NO-REGION: Offloading entry for target region is incorect: either the address or the ID is invalid. + +#if defined(REGION_HOST) || defined(REGION_DEVICE) +void foo() { +#ifdef REGION_HOST +#pragma omp target + ; +#endif +#ifdef REGION_DEVICE +#pragma omp target + ; +#endif +} +#else void foo() { } @@ -71,4 +90,4 @@ int main(int argc, char **argv) { return 0; } - +#endif |