1 // RUN: fir-opt -split-input-file --omp-function-filtering %s | FileCheck %s
3 // CHECK: func.func @any
5 // CHECK: func.func @nohost
7 // CHECK-NOT: func.func {{.*}}}} @host
8 // CHECK-NOT: func.func {{.*}}}} @none
9 // CHECK: func.func @nohost_target
11 // CHECK: func.func @host_target
13 // CHECK: func.func @none_target
15 // CHECK: func.func @host_target_call
16 // CHECK-NOT: call @none_target
17 // CHECK: %[[UNDEF:.*]] = fir.undefined i32
18 // CHECK: return %[[UNDEF]] : i32
19 module attributes {omp.is_target_device = true} {
20 func.func @any() -> ()
23 #omp.declaretarget<device_type = (any), capture_clause = (to)>
27 func.func @nohost() -> ()
30 #omp.declaretarget<device_type = (nohost), capture_clause = (to)>
34 func.func @host() -> ()
37 #omp.declaretarget<device_type = (host), capture_clause = (to)>
41 func.func @none() -> () {
44 func.func @nohost_target() -> ()
47 #omp.declaretarget<device_type = (nohost), capture_clause = (to)>
52 func.func @host_target() -> ()
55 #omp.declaretarget<device_type = (host), capture_clause = (to)>
60 func.func @none_target() -> i32 {
62 %0 = arith.constant 25 : i32
65 func.func @host_target_call() -> i32
68 #omp.declaretarget<device_type = (host), capture_clause = (to)>
71 %0 = call @none_target() : () -> i32
78 // CHECK: func.func @any
80 // CHECK: func.func @nohost
82 // CHECK: func.func @host
84 // CHECK: func.func @none
86 // CHECK: func.func @nohost_target
88 // CHECK: func.func @host_target
90 // CHECK: func.func @none_target
92 module attributes {omp.is_target_device = false} {
93 func.func @any() -> ()
96 #omp.declaretarget<device_type = (any), capture_clause = (to)>
100 func.func @nohost() -> ()
103 #omp.declaretarget<device_type = (nohost), capture_clause = (to)>
107 func.func @host() -> ()
110 #omp.declaretarget<device_type = (host), capture_clause = (to)>
114 func.func @none() -> () {
117 func.func @nohost_target() -> ()
120 #omp.declaretarget<device_type = (nohost), capture_clause = (to)>
125 func.func @host_target() -> ()
128 #omp.declaretarget<device_type = (host), capture_clause = (to)>
133 func.func @none_target() -> () {