We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3d2fa57 commit fd0fb71Copy full SHA for fd0fb71
test/ir.jl
@@ -1,4 +1,4 @@
1
-using MLIR.Dialects: arith
+using MLIR.Dialects: arith, builtin
2
using MLIR.IR, LLVM
3
4
@testset "operation introspection" begin
@@ -11,3 +11,16 @@ using MLIR.IR, LLVM
11
@test IR.get_attribute_by_name(op, "value") |> IR.bool_value
12
end
13
14
+
15
+@testset "Module construction from operation" begin
16
+ IR.context!(IR.Context()) do
17
+ op = builtin.module_(bodyRegion=IR.Region())
18
+ mod = IR.Module(op)
19
+ op = IR.get_operation(mod)
20
21
+ @test IR.name(op) == "builtin.module"
22
23
+ # Only a `module` operation can be used to create a module.
24
+ @test_throws AssertionError IR.Module(arith.constant(; value=true, result=MLIRType(Bool)))
25
+ end
26
+end
0 commit comments