1 // RUN: mlir-opt %s -split-input-file --test-operations-equality | FileCheck %s
4 // CHECK-LABEL: test.top_level_op
5 // CHECK-SAME: compares equals
7 "test.top_level_op"() : () -> ()
8 "test.top_level_op"() : () -> ()
12 // CHECK-LABEL: test.top_level_op_strict_loc
13 // CHECK-SAME: compares NOT equals
15 "test.top_level_op_strict_loc"() { strict_loc_check } : () -> ()
16 "test.top_level_op_strict_loc"() { strict_loc_check } : () -> ()
20 // CHECK-LABEL: test.top_level_op_loc_match
21 // CHECK-SAME: compares equals
23 "test.top_level_op_loc_match"() { strict_loc_check } : () -> () loc("foo")
24 "test.top_level_op_loc_match"() { strict_loc_check } : () -> () loc("foo")
28 // CHECK-LABEL: test.top_level_op_block_loc_mismatch
29 // CHECK-SAME: compares NOT equals
31 "test.top_level_op_block_loc_mismatch"() ({
33 }) { strict_loc_check } : () -> () loc("foo")
34 "test.top_level_op_block_loc_mismatch"() ({
36 }) { strict_loc_check } : () -> () loc("foo")
40 // CHECK-LABEL: test.top_level_op_block_loc_match
41 // CHECK-SAME: compares equals
43 "test.top_level_op_block_loc_match"() ({
44 ^bb0(%a : i32 loc("bar")):
45 }) { strict_loc_check } : () -> () loc("foo")
46 "test.top_level_op_block_loc_match"() ({
47 ^bb0(%a : i32 loc("bar")):
48 }) { strict_loc_check } : () -> () loc("foo")
52 // CHECK-LABEL: test.top_level_name_mismatch
53 // CHECK-SAME: compares NOT equals
55 "test.top_level_name_mismatch"() : () -> ()
56 "test.top_level_name_mismatch2"() : () -> ()
60 // CHECK-LABEL: test.top_level_op_attr_mismatch
61 // CHECK-SAME: compares NOT equals
63 "test.top_level_op_attr_mismatch"() { foo = "bar" } : () -> ()
64 "test.top_level_op_attr_mismatch"() { foo = "bar2"} : () -> ()
68 // CHECK-LABEL: test.top_level_op_cfg
69 // CHECK-SAME: compares equals
71 "test.top_level_op_cfg"() ({
72 ^bb0(%arg0 : i32, %arg1 : f32):
73 "test.some_branching_op"(%arg1, %arg0) [^bb1, ^bb2] : (f32, i32) -> ()
75 "test.some_branching_op"() : () -> ()
77 "test.some_branching_op"() : () -> ()
79 ^bb0(%arg0 : i32, %arg1 : f32):
80 "test.some_branching_op"(%arg1, %arg0) [^bb1, ^bb2] : (f32, i32) -> ()
82 "test.some_branching_op"() : () -> ()
84 "test.some_branching_op"() : () -> ()
86 { attr = "foo" } : () -> ()
87 "test.top_level_op_cfg"() ({
88 ^bb0(%arg0 : i32, %arg1 : f32):
89 "test.some_branching_op"(%arg1, %arg0) [^bb1, ^bb2] : (f32, i32) -> ()
91 "test.some_branching_op"() : () -> ()
93 "test.some_branching_op"() : () -> ()
95 ^bb0(%arg0 : i32, %arg1 : f32):
96 "test.some_branching_op"(%arg1, %arg0) [^bb1, ^bb2] : (f32, i32) -> ()
98 "test.some_branching_op"() : () -> ()
100 "test.some_branching_op"() : () -> ()
102 { attr = "foo" } : () -> ()
106 // CHECK-LABEL: test.operand_num_mismatch
107 // CHECK-SAME: compares NOT equals
109 "test.operand_num_mismatch"() ({
110 ^bb0(%arg0 : i32, %arg1 : f32):
111 "test.some_branching_op"(%arg1, %arg0) : (f32, i32) -> ()
113 "test.operand_num_mismatch"() ({
114 ^bb0(%arg0 : i32, %arg1 : f32):
115 "test.some_branching_op"(%arg1) : (f32) -> ()
120 // CHECK-LABEL: test.operand_type_mismatch
121 // CHECK-SAME: compares NOT equals
123 "test.operand_type_mismatch"() ({
124 ^bb0(%arg0 : i32, %arg1 : f32):
125 "test.some_branching_op"(%arg1, %arg0) : (f32, i32) -> ()
127 "test.operand_type_mismatch"() ({
128 ^bb0(%arg0 : i32, %arg1 : f32):
129 "test.some_branching_op"(%arg1, %arg1) : (f32, f32) -> ()
134 // CHECK-LABEL: test.block_type_mismatch
135 // CHECK-SAME: compares NOT equals
137 "test.block_type_mismatch"() ({
138 ^bb0(%arg0 : f32, %arg1 : f32):
139 "test.some_branching_op"() : () -> ()
141 "test.block_type_mismatch"() ({
142 ^bb0(%arg0 : i32, %arg1 : f32):
143 "test.some_branching_op"() : () -> ()
148 // CHECK-LABEL: test.block_arg_num_mismatch
149 // CHECK-SAME: compares NOT equals
151 "test.block_arg_num_mismatch"() ({
152 ^bb0(%arg0 : f32, %arg1 : f32):
153 "test.some_branching_op"() : () -> ()
155 "test.block_arg_num_mismatch"() ({
157 "test.some_branching_op"() : () -> ()
162 // CHECK-LABEL: test.dataflow_match
163 // CHECK-SAME: compares equals
165 "test.dataflow_match"() ({
166 %0:2 = "test.producer"() : () -> (i32, i32)
167 "test.consumer"(%0#0, %0#1) : (i32, i32) -> ()
169 "test.dataflow_match"() ({
170 %0:2 = "test.producer"() : () -> (i32, i32)
171 "test.consumer"(%0#0, %0#1) : (i32, i32) -> ()
176 // CHECK-LABEL: test.dataflow_mismatch
177 // CHECK-SAME: compares NOT equals
179 "test.dataflow_mismatch"() ({
180 %0:2 = "test.producer"() : () -> (i32, i32)
181 "test.consumer"(%0#0, %0#1) : (i32, i32) -> ()
183 "test.dataflow_mismatch"() ({
184 %0:2 = "test.producer"() : () -> (i32, i32)
185 "test.consumer"(%0#1, %0#0) : (i32, i32) -> ()