@@ -17,8 +17,7 @@ def run(f):
17
17
@run
18
18
def testAttributes ():
19
19
with Context () as ctx , Location .unknown ():
20
- ctx .allow_unregistered_dialects = True
21
-
20
+ test .register_python_test_dialect (ctx )
22
21
#
23
22
# Check op construction with attributes.
24
23
#
@@ -28,15 +27,15 @@ def testAttributes():
28
27
two = IntegerAttr .get (i32 , 2 )
29
28
unit = UnitAttr .get ()
30
29
31
- # CHECK: " python_test.attributed_op"() {
30
+ # CHECK: python_test.attributed_op {
32
31
# CHECK-DAG: mandatory_i32 = 1 : i32
33
32
# CHECK-DAG: optional_i32 = 2 : i32
34
33
# CHECK-DAG: unit
35
34
# CHECK: }
36
35
op = test .AttributedOp (one , optional_i32 = two , unit = unit )
37
36
print (f"{ op } " )
38
37
39
- # CHECK: " python_test.attributed_op"() {
38
+ # CHECK: python_test.attributed_op {
40
39
# CHECK: mandatory_i32 = 2 : i32
41
40
# CHECK: }
42
41
op2 = test .AttributedOp (two )
@@ -48,21 +47,21 @@ def testAttributes():
48
47
49
48
assert "additional" not in op .attributes
50
49
51
- # CHECK: " python_test.attributed_op"() {
50
+ # CHECK: python_test.attributed_op {
52
51
# CHECK-DAG: additional = 1 : i32
53
52
# CHECK-DAG: mandatory_i32 = 2 : i32
54
53
# CHECK: }
55
54
op2 .attributes ["additional" ] = one
56
55
print (f"{ op2 } " )
57
56
58
- # CHECK: " python_test.attributed_op"() {
57
+ # CHECK: python_test.attributed_op {
59
58
# CHECK-DAG: additional = 2 : i32
60
59
# CHECK-DAG: mandatory_i32 = 2 : i32
61
60
# CHECK: }
62
61
op2 .attributes ["additional" ] = two
63
62
print (f"{ op2 } " )
64
63
65
- # CHECK: " python_test.attributed_op"() {
64
+ # CHECK: python_test.attributed_op {
66
65
# CHECK-NOT: additional = 2 : i32
67
66
# CHECK: mandatory_i32 = 2 : i32
68
67
# CHECK: }
@@ -139,7 +138,7 @@ def testAttributes():
139
138
@run
140
139
def attrBuilder ():
141
140
with Context () as ctx , Location .unknown ():
142
- ctx . allow_unregistered_dialects = True
141
+ test . register_python_test_dialect ( ctx )
143
142
# CHECK: python_test.attributes_op
144
143
op = test .AttributesOp (
145
144
# CHECK-DAG: x_affinemap = affine_map<() -> (2)>
@@ -177,10 +176,10 @@ def attrBuilder():
177
176
x_i16 = 42 , # CHECK-DAG: x_i16 = 42 : i16
178
177
x_i32 = 6 , # CHECK-DAG: x_i32 = 6 : i32
179
178
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 >
181
180
x_i64 = 9 , # CHECK-DAG: x_i64 = 9 : i64
182
181
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 >
184
183
x_i64svecarr = [10 , 11 ], # CHECK-DAG: x_i64svecarr = [10, 11]
185
184
x_i8 = 11 , # CHECK-DAG: x_i8 = 11 : i8
186
185
x_idx = 10 , # CHECK-DAG: x_idx = 10 : index
0 commit comments