; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --scrub-attributes --check-attributes --check-globals --include-generated-funcs
; RUN: opt -passes=openmp-opt -S < %s | FileCheck %s --check-prefixes=CHECK
%"struct.ompx::state::TeamStateTy" = type { %"struct.ompx::state::ICVStateTy", i32, i32, ptr }
%"struct.ompx::state::ICVStateTy" = type { i32, i32, i32, i32, i32, i32 }
@_ZN4ompx5state9TeamStateE = internal addrspace(3) global %"struct.ompx::state::TeamStateTy" undef
define weak_odr amdgpu_kernel void @__omp_offloading_16_1d1156__Z38test_target_teams_distribute__parallelv_l16() {
%1 = tail call i32 @__kmpc_target_init(ptr null)
ret void
}
define internal i32 @__kmpc_target_init(ptr %0) {
store <2 x i32> zeroinitializer, ptr addrspace(3) @_ZN4ompx5state9TeamStateE, align 16
%2 = call i1 @__kmpc_kernel_parallel()
ret i32 0
}
define internal i1 @__kmpc_kernel_parallel() {
%1 = load ptr, ptr addrspace(3) @_ZN4ompx5state9TeamStateE, align 8
ret i1 false
}
!llvm.module.flags = !{!0}
!0 = !{i32 7, !"openmp", i32 50}
;.
; CHECK: @_ZN4ompx5state9TeamStateE = internal addrspace(3) global %"struct.ompx::state::TeamStateTy" undef
;.
; CHECK-LABEL: define {{[^@]+}}@__omp_offloading_16_1d1156__Z38test_target_teams_distribute__parallelv_l16() {
; CHECK-NEXT: [[TMP1:%.*]] = tail call i32 @__kmpc_target_init(ptr null)
; CHECK-NEXT: ret void
;
;
; CHECK-LABEL: define {{[^@]+}}@__kmpc_target_init
; CHECK-SAME: (ptr [[TMP0:%.*]]) {
; CHECK-NEXT: store <2 x i32> zeroinitializer, ptr addrspace(3) @_ZN4ompx5state9TeamStateE, align 16
; CHECK-NEXT: [[TMP2:%.*]] = call i1 @__kmpc_kernel_parallel()
; CHECK-NEXT: ret i32 0
;
;
; CHECK-LABEL: define {{[^@]+}}@__kmpc_kernel_parallel() {
; CHECK-NEXT: [[TMP1:%.*]] = load ptr, ptr addrspace(3) @_ZN4ompx5state9TeamStateE, align 8
; CHECK-NEXT: ret i1 false
;
;.
; CHECK: [[META0:![0-9]+]] = !{i32 7, !"openmp", i32 50}
;.