1 // RUN: %clang_cc1 -fopenmp -x c++ -triple powerpc64le-unknown-unknown \
2 // RUN: -verify=host -fopenmp-targets=nvptx64-nvidia-cuda -emit-llvm-bc \
3 // RUN: %s -o %t-ppc-host.bc -fexceptions -fcxx-exceptions
4 // RUN: %clang_cc1 -verify -fopenmp -x c++ -triple nvptx64-unknown-unknown \
5 // RUN: -fopenmp-targets=nvptx64-nvidia-cuda -emit-llvm %s \
6 // RUN: -fopenmp-is-target-device -fopenmp-host-ir-file-path %t-ppc-host.bc -o - \
7 // RUN: -fexceptions -fcxx-exceptions -ferror-limit 100
16 TemplateClass() { throw 1;}
17 T
f_method() const { return a
; }
26 int baz4() { return 5; }
34 #pragma omp declare target
37 S(int a
) : a(a
) { throw 1; } // expected-warning {{target 'nvptx64-unknown-unknown' does not support exception handling; 'throw' is assumed to be never reached}}
40 int foo() { return 0; }
43 #pragma omp end declare target
46 int bar() { return 1 + foo() + bar() + baz1() + baz2(); } // expected-note {{called by 'bar'}}
52 #pragma omp target map(tofrom \
55 // expected-note@+1 {{called by 'maini1'}}
58 a
= foo() + bar() + b
+ c
+ d
+ aa
+ aaa
+ FA
<int>(); // expected-note{{called by 'maini1'}}
60 throw "Error"; // expected-warning {{target 'nvptx64-unknown-unknown' does not support exception handling; 'throw' is assumed to be never reached}}
67 int baz3() { return 2 + baz2(); }
70 try { // expected-warning {{target 'nvptx64-unknown-unknown' does not support exception handling; 'catch' block is ignored}}
77 int baz1() { throw 1; } // expected-warning {{target 'nvptx64-unknown-unknown' does not support exception handling; 'throw' is assumed to be never reached}}
82 int (*A
)() = &foobar1
;
83 #pragma omp declare target
84 int (*B
)() = &foobar2
;
85 #pragma omp end declare target
87 int foobar1() { throw 1; }
88 int foobar2() { throw 1; } // expected-warning {{target 'nvptx64-unknown-unknown' does not support exception handling; 'throw' is assumed to be never reached}}
92 int (*C
)() = &foobar3
; // expected-warning {{declaration is not declared in any declare target region}}
93 // host-warning@-1 {{declaration is not declared in any declare target region}}
94 #pragma omp declare target
95 int (*D
)() = C
; // expected-note {{used here}}
96 // host-note@-1 {{used here}}
97 #pragma omp end declare target
98 int foobar3() { throw 1; } // expected-warning {{target 'nvptx64-unknown-unknown' does not support exception handling; 'throw' is assumed to be never reached}}
100 // Check no infinite recursion in deferred diagnostic emitter.