forked from OSchip/llvm-project
35 lines
1.3 KiB
MLIR
35 lines
1.3 KiB
MLIR
// RUN: mlir-translate -mlir-to-llvmir %s | FileCheck %s
|
|
|
|
// CHECK-LABEL: define void @test_stand_alone_directives()
|
|
llvm.func @test_stand_alone_directives() {
|
|
// CHECK: [[OMP_THREAD:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @{{[0-9]+}})
|
|
// CHECK-NEXT: call void @__kmpc_barrier(%struct.ident_t* @{{[0-9]+}}, i32 [[OMP_THREAD]])
|
|
omp.barrier
|
|
|
|
// CHECK: [[OMP_THREAD1:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @{{[0-9]+}})
|
|
// CHECK-NEXT: [[RET_VAL:%.*]] = call i32 @__kmpc_omp_taskwait(%struct.ident_t* @{{[0-9]+}}, i32 [[OMP_THREAD1]])
|
|
omp.taskwait
|
|
|
|
// CHECK: [[OMP_THREAD2:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @{{[0-9]+}})
|
|
// CHECK-NEXT: [[RET_VAL:%.*]] = call i32 @__kmpc_omp_taskyield(%struct.ident_t* @{{[0-9]+}}, i32 [[OMP_THREAD2]], i32 0)
|
|
omp.taskyield
|
|
|
|
// CHECK-NEXT: ret void
|
|
llvm.return
|
|
}
|
|
|
|
// CHECK-LABEL: define void @test_flush_construct(i32 %0)
|
|
llvm.func @test_flush_construct(%arg0: !llvm.i32) {
|
|
// CHECK: call void @__kmpc_flush(%struct.ident_t* @{{[0-9]+}}
|
|
omp.flush
|
|
|
|
// CHECK: call void @__kmpc_flush(%struct.ident_t* @{{[0-9]+}}
|
|
omp.flush %arg0 : !llvm.i32
|
|
|
|
// CHECK: call void @__kmpc_flush(%struct.ident_t* @{{[0-9]+}}
|
|
omp.flush %arg0, %arg0 : !llvm.i32, !llvm.i32
|
|
|
|
// CHECK-NEXT: ret void
|
|
llvm.return
|
|
}
|