1- // RUN: mlir-opt -allow-unregistered-dialect %s -pass-pipeline="builtin.module(func.func(test-clone))" | FileCheck %s
1+ // RUN: mlir-opt -allow-unregistered-dialect %s -pass-pipeline="builtin.module(func.func(test-clone))" --split-input-file | FileCheck %s
22
33module {
44 func.func @fixpoint (%arg1 : i32 ) -> i32 {
@@ -18,7 +18,8 @@ module {
1818// CHECK-NEXT: notifyOperationInserted: test.yield
1919// CHECK-NEXT: notifyOperationInserted: func.return
2020
21- // CHECK: func @fixpoint(%[[arg0:.+]]: i32) -> i32 {
21+ // CHECK-LABEL: func @fixpoint
22+ // CHECK-SAME: (%[[arg0:.+]]: i32) -> i32 {
2223// CHECK-NEXT: %[[i0:.+]] = "test.use"(%[[arg0]]) ({
2324// CHECK-NEXT: %[[r2:.+]] = "test.use2"(%[[arg0]]) ({
2425// CHECK-NEXT: "test.yield2"(%[[arg0]]) : (i32) -> ()
@@ -33,3 +34,33 @@ module {
3334// CHECK-NEXT: }) : (i32) -> i32
3435// CHECK-NEXT: return %[[i1]] : i32
3536// CHECK-NEXT: }
37+
38+ // -----
39+
40+ func.func @clone_unregistered_with_attrs () {
41+ " unregistered.foo" () <{bar = 1 : i64 , flag = true , name = " test" , value = 3.14 : f32 }> : () -> ()
42+ " unregistered.bar" () : () -> ()
43+ " unregistered.empty_dict" () <{}> : () -> ()
44+ " unregistered.complex" () <{
45+ array = [1 , 2 , 3 ],
46+ dict = {key1 = 42 : i32 , key2 = " value" },
47+ nested = {inner = {deep = 100 : i64 }}
48+ }> : () -> ()
49+ return
50+ }
51+
52+ // CHECK: notifyOperationInserted: unregistered.foo
53+ // CHECK-NEXT: notifyOperationInserted: unregistered.bar
54+ // CHECK-NEXT: notifyOperationInserted: unregistered.empty_dict
55+ // CHECK-NEXT: notifyOperationInserted: unregistered.complex
56+ // CHECK-NEXT: notifyOperationInserted: func.return
57+
58+ // CHECK-LABEL: func @clone_unregistered_with_attrs() {
59+ // CHECK-NEXT: "unregistered.foo"() <{bar = 1 : i64, flag = true, name = "test", value = [[PI:.+]] : f32}> : () -> ()
60+ // CHECK-NEXT: "unregistered.bar"() : () -> ()
61+ // CHECK-NEXT: "unregistered.empty_dict"() <{}> : () -> ()
62+ // CHECK-NEXT: "unregistered.complex"() <{array = [1, 2, 3], dict = {key1 = 42 : i32, key2 = "value"}, nested = {inner = {deep = 100 : i64}}}> : () -> ()
63+ // CHECK-NEXT: "unregistered.foo"() <{bar = 1 : i64, flag = true, name = "test", value = [[PI]] : f32}> : () -> ()
64+ // CHECK-NEXT: "unregistered.bar"() : () -> ()
65+ // CHECK-NEXT: "unregistered.empty_dict"() <{}> : () -> ()
66+ // CHECK-NEXT: "unregistered.complex"() <{array = [1, 2, 3], dict = {key1 = 42 : i32, key2 = "value"}, nested = {inner = {deep = 100 : i64}}}> : () -> ()
0 commit comments