24 lines · python
1# RUN: %PYTHON %s | FileCheck %s2 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 f15 16 17# CHECK-LABEL: test_barrier18# CHECK: module {19# CHECK: omp.barrier20# CHECK: }21@constructAndPrintInModule22def test_barrier():23 barrier = BarrierOp()24