Skip to content

Commit 2bab814

Browse files
committed
add test
1 parent 1faa5e2 commit 2bab814

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

mlir/test/python/ir/operation.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1187,3 +1187,14 @@ 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+
assert isinstance(r.operands[0].owner, arith.ConstantOp)

0 commit comments

Comments
 (0)