1 // RUN: mlir-opt -split-input-file -pass-pipeline='builtin.module(func.func(test-foo-analysis))' %s 2>&1 | FileCheck %s
3 // CHECK-LABEL: function: @test_default_init
4 func.func @test_default_init() -> () {
6 "test.foo"() {tag = "a"} : () -> ()
12 // CHECK-LABEL: function: @test_one_join
13 func.func @test_one_join() -> () {
15 "test.foo"() {tag = "a"} : () -> ()
17 "test.foo"() {tag = "b", foo = 1 : ui64} : () -> ()
23 // CHECK-LABEL: function: @test_two_join
24 func.func @test_two_join() -> () {
26 "test.foo"() {tag = "a"} : () -> ()
28 "test.foo"() {tag = "b", foo = 1 : ui64} : () -> ()
30 "test.foo"() {tag = "c", foo = 1 : ui64} : () -> ()
36 // CHECK-LABEL: function: @test_fork
37 func.func @test_fork() -> () {
39 "test.branch"() [^bb0, ^bb1] {tag = "init", foo = 1 : ui64} : () -> ()
43 "test.branch"() [^bb2] {tag = "a", foo = 2 : ui64} : () -> ()
47 "test.branch"() [^bb2] {tag = "b", foo = 4 : ui64} : () -> ()
51 "test.foo"() {tag = "end"} : () -> ()
58 // CHECK-LABEL: function: @test_simple_loop
59 func.func @test_simple_loop() -> () {
61 "test.branch"() [^bb0] {tag = "init", foo = 1 : ui64} : () -> ()
65 "test.foo"() {tag = "a", foo = 3 : ui64} : () -> ()
66 "test.branch"() [^bb0, ^bb1] : () -> ()
70 "test.foo"() {tag = "end"} : () -> ()
76 // CHECK-LABEL: function: @test_double_loop
77 func.func @test_double_loop() -> () {
79 "test.branch"() [^bb0] {tag = "init", foo = 2 : ui64} : () -> ()
83 "test.foo"() {tag = "a", foo = 3 : ui64} : () -> ()
84 "test.branch"() [^bb0, ^bb1] : () -> ()
88 "test.foo"() {tag = "b", foo = 5 : ui64} : () -> ()
89 "test.branch"() [^bb0, ^bb2] : () -> ()
93 "test.foo"() {tag = "end"} : () -> ()