xref: /llvm-project/mlir/test/python/dialects/sparse_tensor/passes.py (revision f9008e6366c2496b1ca1785b891d5578174ad63e)
1# RUN: %PYTHON %s | FileCheck %s
2
3from mlir.ir import *
4from mlir.passmanager import *
5
6from mlir.dialects import sparse_tensor as st
7
8
9def run(f):
10    print("\nTEST:", f.__name__)
11    f()
12    return f
13
14
15# CHECK-LABEL: TEST: testSparseTensorPass
16@run
17def testSparseTensorPass():
18    with Context() as context:
19        PassManager.parse("any(sparsification)")
20        PassManager.parse("any(sparse-tensor-conversion)")
21    # CHECK: SUCCESS
22    print("SUCCESS")
23