1 // REQUIRES: amdgpu-registered-target
3 // RUN: %clang_cc1 -fopenmp -fopenmp-targets=amdgcn-amd-amdhsa -fopenmp-version=52 -triple powerpc64le-unknown-unknown -DVERBOSE_MODE=1 -verify=omp52 -fnoopenmp-use-tls -ferror-limit 100 -fopenmp-targets=amdgcn-amd-amdhsa -o - %s
7 #pragma omp declare target enter(fun) device_type(nohost)
8 #pragma omp declare variant(host_function) match(device={kind(host)})
10 void host_function() {}
11 void call_host_function() { fun(); }
14 void not_a_host_function();
15 #pragma omp declare target enter(fun1) device_type(nohost) // omp52-note {{marked as 'device_type(nohost)' here}}
16 #pragma omp declare variant(not_a_host_function) match(device={kind(host)}) // omp52-error {{function with 'device_type(nohost)' is not available on host}}
18 #pragma omp begin declare target device_type(nohost) // omp52-note {{marked as 'device_type(nohost)' here}}
19 void not_a_host_function() {}
20 #pragma omp end declare target
21 void failed_call_to_host_function() { fun1(); } // omp52-error {{function with 'device_type(nohost)' is not available on host}}
24 void host_function2();
25 #pragma omp declare target enter(fun2) device_type(nohost)
26 #pragma omp declare variant(host_function2) match(device={kind(host)})
28 #pragma omp begin declare target device_type(host)
29 void host_function2() {}
30 #pragma omp end declare target
31 void call_to_host_function() { fun2(); }