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