@@ -17,8 +17,7 @@ def run(f):
1717@run
1818def testAttributes ():
1919 with Context () as ctx , Location .unknown ():
20- ctx .allow_unregistered_dialects = True
21-
20+ test .register_python_test_dialect (ctx )
2221 #
2322 # Check op construction with attributes.
2423 #
@@ -28,15 +27,15 @@ def testAttributes():
2827 two = IntegerAttr .get (i32 , 2 )
2928 unit = UnitAttr .get ()
3029
31- # CHECK: " python_test.attributed_op"() {
30+ # CHECK: python_test.attributed_op {
3231 # CHECK-DAG: mandatory_i32 = 1 : i32
3332 # CHECK-DAG: optional_i32 = 2 : i32
3433 # CHECK-DAG: unit
3534 # CHECK: }
3635 op = test .AttributedOp (one , optional_i32 = two , unit = unit )
3736 print (f"{ op } " )
3837
39- # CHECK: " python_test.attributed_op"() {
38+ # CHECK: python_test.attributed_op {
4039 # CHECK: mandatory_i32 = 2 : i32
4140 # CHECK: }
4241 op2 = test .AttributedOp (two )
@@ -48,21 +47,21 @@ def testAttributes():
4847
4948 assert "additional" not in op .attributes
5049
51- # CHECK: " python_test.attributed_op"() {
50+ # CHECK: python_test.attributed_op {
5251 # CHECK-DAG: additional = 1 : i32
5352 # CHECK-DAG: mandatory_i32 = 2 : i32
5453 # CHECK: }
5554 op2 .attributes ["additional" ] = one
5655 print (f"{ op2 } " )
5756
58- # CHECK: " python_test.attributed_op"() {
57+ # CHECK: python_test.attributed_op {
5958 # CHECK-DAG: additional = 2 : i32
6059 # CHECK-DAG: mandatory_i32 = 2 : i32
6160 # CHECK: }
6261 op2 .attributes ["additional" ] = two
6362 print (f"{ op2 } " )
6463
65- # CHECK: " python_test.attributed_op"() {
64+ # CHECK: python_test.attributed_op {
6665 # CHECK-NOT: additional = 2 : i32
6766 # CHECK: mandatory_i32 = 2 : i32
6867 # CHECK: }
@@ -139,7 +138,7 @@ def testAttributes():
139138@run
140139def attrBuilder ():
141140 with Context () as ctx , Location .unknown ():
142- ctx . allow_unregistered_dialects = True
141+ test . register_python_test_dialect ( ctx )
143142 # CHECK: python_test.attributes_op
144143 op = test .AttributesOp (
145144 # CHECK-DAG: x_affinemap = affine_map<() -> (2)>
@@ -177,10 +176,10 @@ def attrBuilder():
177176 x_i16 = 42 , # CHECK-DAG: x_i16 = 42 : i16
178177 x_i32 = 6 , # CHECK-DAG: x_i32 = 6 : i32
179178 x_i32arr = [4 , 5 ], # CHECK-DAG: x_i32arr = [4 : i32, 5 : i32]
180- x_i32elems = [5 , 6 ], # CHECK-DAG: x_i32elems = dense<[5, 6]> : tensor<2xsi32 >
179+ x_i32elems = [5 , 6 ], # CHECK-DAG: x_i32elems = dense<[5, 6]> : tensor<2xi32 >
181180 x_i64 = 9 , # CHECK-DAG: x_i64 = 9 : i64
182181 x_i64arr = [7 , 8 ], # CHECK-DAG: x_i64arr = [7, 8]
183- x_i64elems = [8 , 9 ], # CHECK-DAG: x_i64elems = dense<[8, 9]> : tensor<2xsi64 >
182+ x_i64elems = [8 , 9 ], # CHECK-DAG: x_i64elems = dense<[8, 9]> : tensor<2xi64 >
184183 x_i64svecarr = [10 , 11 ], # CHECK-DAG: x_i64svecarr = [10, 11]
185184 x_i8 = 11 , # CHECK-DAG: x_i8 = 11 : i8
186185 x_idx = 10 , # CHECK-DAG: x_idx = 10 : index
0 commit comments