xref: /llvm-project/mlir/test/python/dialects/openmp_ops.py (revision 2b664d678dcd6b23eda992b45d009788e34ea8f1)
1*2b664d67Smax# RUN: %PYTHON %s | FileCheck %s
2*2b664d67Smax
3*2b664d67Smaxfrom mlir.ir import *
4*2b664d67Smaxfrom mlir.dialects.openmp import *
5*2b664d67Smax
6*2b664d67Smax
7*2b664d67Smaxdef constructAndPrintInModule(f):
8*2b664d67Smax    print("\nTEST:", f.__name__)
9*2b664d67Smax    with Context(), Location.unknown():
10*2b664d67Smax        module = Module.create()
11*2b664d67Smax        with InsertionPoint(module.body):
12*2b664d67Smax            f()
13*2b664d67Smax        print(module)
14*2b664d67Smax    return f
15*2b664d67Smax
16*2b664d67Smax
17*2b664d67Smax# CHECK-LABEL: test_barrier
18*2b664d67Smax# CHECK: module {
19*2b664d67Smax# CHECK:   omp.barrier
20*2b664d67Smax# CHECK: }
21*2b664d67Smax@constructAndPrintInModule
22*2b664d67Smaxdef test_barrier():
23*2b664d67Smax    barrier = BarrierOp()
24