1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --scrub-attributes --check-attributes --check-globals --include-generated-funcs 2; RUN: opt -passes=openmp-opt -S < %s | FileCheck %s --check-prefixes=CHECK 3 4@_ZN4ompx5state9TeamStateE = internal addrspace(3) global ptr undef 5 6define internal fastcc i1 @__kmpc_kernel_parallel() { 7bb: 8 %i = load ptr, ptr addrspace(3) @_ZN4ompx5state9TeamStateE, align 16 9 %i1 = icmp eq ptr %i, null 10 ret i1 %i1 11} 12 13define weak_odr amdgpu_kernel void @__omp_offloading_16_2e1d69__ZN11qmcplusplus7ompBLAS9gemv_implIfEEiRiciiT_PKS3_iS5_iS3_PS3_i_l44() #1 { 14bb: 15 call void @barrier() 16 %i31 = call fastcc i1 @__kmpc_kernel_parallel() 17 call void @barrier() 18 store ptr @use, ptr addrspace(3) @_ZN4ompx5state9TeamStateE, align 16 19 call void @barrier() 20 store ptr null, ptr addrspace(3) @_ZN4ompx5state9TeamStateE, align 16 21 call void @barrier() 22 call void @use(i1 %i31) 23 ret void 24} 25 26declare void @use(i1) 27declare void @barrier() nocallback 28 29attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } 30attributes #1 = { "kernel" } 31 32!llvm.module.flags = !{!0, !1} 33 34!0 = !{i32 7, !"openmp", i32 50} 35!1 = !{i32 7, !"openmp-device", i32 50} 36;. 37; CHECK: @_ZN4ompx5state9TeamStateE = internal addrspace(3) global ptr undef 38;. 39; CHECK: Function Attrs: norecurse nosync nounwind memory(read) 40; CHECK-LABEL: define {{[^@]+}}@__kmpc_kernel_parallel 41; CHECK-SAME: () #[[ATTR0:[0-9]+]] { 42; CHECK-NEXT: bb: 43; CHECK-NEXT: [[I:%.*]] = load ptr, ptr addrspace(3) @_ZN4ompx5state9TeamStateE, align 16 44; CHECK-NEXT: [[I1:%.*]] = icmp eq ptr [[I]], null 45; CHECK-NEXT: ret i1 [[I1]] 46; 47; 48; CHECK-LABEL: define {{[^@]+}}@__omp_offloading_16_2e1d69__ZN11qmcplusplus7ompBLAS9gemv_implIfEEiRiciiT_PKS3_iS5_iS3_PS3_i_l44 49; CHECK-SAME: () #[[ATTR1:[0-9]+]] { 50; CHECK-NEXT: bb: 51; CHECK-NEXT: call void @barrier() 52; CHECK-NEXT: [[I31:%.*]] = call fastcc i1 @__kmpc_kernel_parallel() 53; CHECK-NEXT: call void @barrier() 54; CHECK-NEXT: store ptr @use, ptr addrspace(3) @_ZN4ompx5state9TeamStateE, align 16 55; CHECK-NEXT: call void @barrier() 56; CHECK-NEXT: store ptr null, ptr addrspace(3) @_ZN4ompx5state9TeamStateE, align 16 57; CHECK-NEXT: call void @barrier() 58; CHECK-NEXT: call void @use(i1 [[I31]]) 59; CHECK-NEXT: ret void 60; 61;. 62; CHECK: attributes #[[ATTR0]] = { norecurse nosync nounwind memory(read) } 63; CHECK: attributes #[[ATTR1]] = { "kernel" } 64; CHECK: attributes #[[ATTR2:[0-9]+]] = { nocallback } 65; CHECK: attributes #[[ATTR3:[0-9]+]] = { nosync nounwind memory(read) } 66;. 67; CHECK: [[META0:![0-9]+]] = !{i32 7, !"openmp", i32 50} 68; CHECK: [[META1:![0-9]+]] = !{i32 7, !"openmp-device", i32 50} 69;. 70