xref: /llvm-project/mlir/test/Target/LLVMIR/omptarget-teams-llvm.mlir (revision 9708d0900311503aa4685d6810d8caf0412e15d7)
1// RUN: mlir-translate -mlir-to-llvmir %s | FileCheck %s
2
3// The aim of the test is to check the LLVM IR codegen for the device
4// for omp teams construct
5
6module attributes {omp.is_target_device = true} {
7  llvm.func @foo(i32)
8  llvm.func @omp_target_teams_shared_simple(%arg0 : i32)  attributes {omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (to)>} {
9    omp.teams {
10      llvm.call @foo(%arg0) : (i32) -> ()
11      omp.terminator
12    }
13  llvm.return
14  }
15}
16
17// CHECK-LABEL: @omp_target_teams_shared_simple
18// CHECK-SAME: (i32 [[ARG0:%.+]])
19// CHECK: call void @[[OUTLINED_FN:.*]](
20// CHECK-NOT: call {{.+}} @__kmpc_fork_teams
21// CHECK: ret void
22
23//CHECK: define internal void @[[OUTLINED_FN]](
24//CHECK: call void @foo(i32 %[[FOO_ARG:.*]])
25//CHECK: ret void
26