Skip to content

Commit 61d0cdd

Browse files
committed
add test
1 parent 1faa5e2 commit 61d0cdd

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

mlir/test/python/ir/operation.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1187,3 +1187,16 @@ def callback(op):
11871187
module.operation.walk(callback)
11881188
except RuntimeError:
11891189
print("Exception raised")
1190+
1191+
1192+
# CHECK-LABEL: TEST: testGetOwnerConcreteOpview
1193+
@run
1194+
def testGetOwnerConcreteOpview():
1195+
with Context() as ctx, Location.unknown():
1196+
module = Module.create()
1197+
with InsertionPoint(module.body):
1198+
a = arith.ConstantOp(value=42, result=IntegerType.get_signless(32))
1199+
r = arith.AddIOp(a, a, overflowFlags=arith.IntegerOverflowFlags.nsw)
1200+
for u in a.result.uses:
1201+
assert isinstance(u.owner, arith.AddIOp)
1202+
assert isinstance(r.operands[0].owner, arith.ConstantOp)

0 commit comments

Comments
 (0)