Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / OpenMP / declare_target_nohost_variant_messages.cpp
blob62206d3020e9603598fc7e2f27e556da27b1a246
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
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)})
9 void fun() {}
10 void host_function() {}
11 void call_host_function() { fun(); }
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}}
17 void fun1() {}
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}}
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)})
27 void fun2() {}
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(); }