Files
TheRock/compiler/amd-llvm/clang/test/OpenMP/target_exceptions_messages.cpp
T
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

120 lines
3.9 KiB
C++

// RUN: %clang_cc1 -fopenmp -x c++ -triple powerpc64le-unknown-unknown \
// RUN: -verify=host -fopenmp-targets=nvptx64-nvidia-cuda -emit-llvm-bc \
// RUN: %s -o %t-ppc-host.bc -fexceptions -fcxx-exceptions
// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple nvptx64-unknown-unknown \
// RUN: -fopenmp-targets=nvptx64-nvidia-cuda -emit-llvm %s \
// RUN: -fopenmp-is-target-device -fopenmp-host-ir-file-path %t-ppc-host.bc -o - \
// RUN: -fexceptions -fcxx-exceptions -ferror-limit 100
// RUN: %clang_cc1 -fopenmp -x c++ -triple powerpc64le-unknown-unknown \
// RUN: -verify=host -fopenmp-targets=amdgcn-amd-amdhsa -emit-llvm-bc \
// RUN: %s -o %t-ppc-host-amd.bc -fexceptions -fcxx-exceptions
// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple amdgcn-amd-amdhsa \
// RUN: -fopenmp-targets=amdgcn-amd-amdhsa -emit-llvm %s \
// RUN: -fopenmp-is-target-device -fopenmp-host-ir-file-path %t-ppc-host-amd.bc -o - \
// RUN: -fexceptions -fcxx-exceptions -ferror-limit 100
// RUN: %clang_cc1 -fopenmp -x c++ -triple powerpc64le-unknown-unknown \
// RUN: -verify=host -fopenmp-targets=spirv64-intel -emit-llvm-bc \
// RUN: %s -o %t-ppc-host-spirv.bc -fexceptions -fcxx-exceptions
// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple spirv64-intel \
// RUN: -fopenmp-targets=spirv64-intel -emit-llvm %s \
// RUN: -fopenmp-is-target-device -fopenmp-host-ir-file-path %t-ppc-host-spirv.bc -o - \
// RUN: -fexceptions -fcxx-exceptions -ferror-limit 100
#ifndef HEADER
#define HEADER
template <typename T>
class TemplateClass {
T a;
public:
TemplateClass() { throw 1;}
T f_method() const { return a; }
};
int foo();
int baz1();
int baz2();
int baz4() { return 5; }
template <typename T>
T FA() {
TemplateClass<T> s;
return s.f_method();
}
#pragma omp declare target
struct S {
int a;
S(int a) : a(a) { throw 1; } // expected-warning-re {{target '{{.*}}' does not support exception handling; 'throw' is assumed to be never reached}}
};
int foo() { return 0; }
int b = 15;
int d;
#pragma omp end declare target
int c;
int bar() { return 1 + foo() + bar() + baz1() + baz2(); } // expected-note {{called by 'bar'}}
int maini1() {
int a;
static long aa = 32;
try {
#pragma omp target map(tofrom \
: a, b)
{
// expected-note@+1 {{called by 'maini1'}}
S s(a);
static long aaa = 23;
a = foo() + bar() + b + c + d + aa + aaa + FA<int>(); // expected-note{{called by 'maini1'}}
if (!a)
throw "Error"; // expected-warning-re {{target '{{.*}}' does not support exception handling; 'throw' is assumed to be never reached}}
}
} catch(...) {
}
return baz4();
}
int baz3() { return 2 + baz2(); }
int baz2() {
#pragma omp target
try { // expected-warning-re {{target '{{.*}}' does not support exception handling; 'catch' block is ignored}}
++c;
} catch (...) {
}
return 2 + baz3();
}
int baz1() { throw 1; } // expected-warning-re {{target '{{.*}}' does not support exception handling; 'throw' is assumed to be never reached}}
int foobar1();
int foobar2();
int (*A)() = &foobar1;
#pragma omp declare target
int (*B)() = &foobar2;
#pragma omp end declare target
int foobar1() { throw 1; }
int foobar2() { throw 1; } // expected-warning-re {{target '{{.*}}' does not support exception handling; 'throw' is assumed to be never reached}}
int foobar3();
int (*C)() = &foobar3; // expected-warning {{declaration is not declared in any declare target region}}
// host-warning@-1 {{declaration is not declared in any declare target region}}
#pragma omp declare target
int (*D)() = C; // expected-note {{used here}}
// host-note@-1 {{used here}}
#pragma omp end declare target
int foobar3() { throw 1; } // expected-warning-re {{target '{{.*}}' does not support exception handling; 'throw' is assumed to be never reached}}
// Check no infinite recursion in deferred diagnostic emitter.
long E = (long)&E;
#endif // HEADER