1 // REQUIRES: amdgpu-registered-target 2 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 4 5 void fun(); 6 void host_function(); 7 #pragma omp declare target enter(fun) device_type(nohost) 8 #pragma omp declare variant(host_function) match(device={kind(host)}) fun()9void fun() {} host_function()10void host_function() {} call_host_function()11void call_host_function() { fun(); } 12 13 void fun1(); 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}} fun1()17void fun1() {} 18 #pragma omp begin declare target device_type(nohost) // omp52-note {{marked as 'device_type(nohost)' here}} not_a_host_function()19void not_a_host_function() {} 20 #pragma omp end declare target failed_call_to_host_function()21void failed_call_to_host_function() { fun1(); } // omp52-error {{function with 'device_type(nohost)' is not available on host}} 22 23 void fun2(); 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)}) fun2()27void fun2() {} 28 #pragma omp begin declare target device_type(host) host_function2()29void host_function2() {} 30 #pragma omp end declare target call_to_host_function()31void call_to_host_function() { fun2(); } 32