diff options
| author | Fangrui Song <i@maskray.me> | 2024-06-06 13:23:38 -0700 |
|---|---|---|
| committer | Fangrui Song <i@maskray.me> | 2024-06-06 13:23:38 -0700 |
| commit | 683ca4ab2cce926ca945b5eed9fa0bb3cf575de9 (patch) | |
| tree | c32c6df233afdf9469e20f99733cde3f552e49de /mlir/test/python/ir | |
| parent | cf44857e7bce6b2defe3f174e0134e2bb7a0ac9d (diff) | |
| parent | fbcb92ca017ee7fbf84be808701133fbdf3b1c59 (diff) | |
[𝘀𝗽𝗿] changes introduced through rebaseusers/MaskRay/spr/main.elf-orphan-placement-remove-hasinputsections-condition
Created using spr 1.3.5-bogner
[skip ci]
Diffstat (limited to 'mlir/test/python/ir')
| -rw-r--r-- | mlir/test/python/ir/blocks.py | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/mlir/test/python/ir/blocks.py b/mlir/test/python/ir/blocks.py index 8b4d946c97b8..70ccaeeb5435 100644 --- a/mlir/test/python/ir/blocks.py +++ b/mlir/test/python/ir/blocks.py @@ -145,3 +145,35 @@ def testBlockHash(): block1 = Block.create_at_start(dummy.operation.regions[0], [f32]) block2 = Block.create_at_start(dummy.operation.regions[0], [f32]) assert hash(block1) != hash(block2) + + +# CHECK-LABEL: TEST: testBlockAddArgs +@run +def testBlockAddArgs(): + with Context() as ctx, Location.unknown(ctx) as loc: + ctx.allow_unregistered_dialects = True + f32 = F32Type.get() + op = Operation.create("test", regions=1, loc=Location.unknown()) + blocks = op.regions[0].blocks + blocks.append() + # CHECK: ^bb0: + op.print(enable_debug_info=True) + blocks[0].add_argument(f32, loc) + # CHECK: ^bb0(%{{.+}}: f32 loc(unknown)): + op.print(enable_debug_info=True) + + +# CHECK-LABEL: TEST: testBlockEraseArgs +@run +def testBlockEraseArgs(): + with Context() as ctx, Location.unknown(ctx) as loc: + ctx.allow_unregistered_dialects = True + f32 = F32Type.get() + op = Operation.create("test", regions=1, loc=Location.unknown()) + blocks = op.regions[0].blocks + blocks.append(f32) + # CHECK: ^bb0(%{{.+}}: f32 loc(unknown)): + op.print(enable_debug_info=True) + blocks[0].erase_argument(0) + # CHECK: ^bb0: + op.print(enable_debug_info=True) |
