brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.1 KiB · edd153d Raw
96 lines · plain
1// RUN: mlir-opt -split-input-file -pass-pipeline='builtin.module(func.func(test-foo-analysis))' %s 2>&1 | FileCheck %s2 3// CHECK-LABEL: function: @test_default_init4func.func @test_default_init() -> () {5  // CHECK: a -> 06  "test.foo"() {tag = "a"} : () -> ()7  return8}9 10// -----11 12// CHECK-LABEL: function: @test_one_join13func.func @test_one_join() -> () {14  // CHECK: a -> 015  "test.foo"() {tag = "a"} : () -> ()16  // CHECK: b -> 117  "test.foo"() {tag = "b", foo = 1 : ui64} : () -> ()18  return19}20 21// -----22 23// CHECK-LABEL: function: @test_two_join24func.func @test_two_join() -> () {25  // CHECK: a -> 026  "test.foo"() {tag = "a"} : () -> ()27  // CHECK: b -> 128  "test.foo"() {tag = "b", foo = 1 : ui64} : () -> ()29  // CHECK: c -> 030  "test.foo"() {tag = "c", foo = 1 : ui64} : () -> ()31  return32}33 34// -----35 36// CHECK-LABEL: function: @test_fork37func.func @test_fork() -> () {38  // CHECK: init -> 139  "test.branch"() [^bb0, ^bb1] {tag = "init", foo = 1 : ui64} : () -> ()40 41^bb0:42  // CHECK: a -> 343  "test.branch"() [^bb2] {tag = "a", foo = 2 : ui64} : () -> ()44 45^bb1:46  // CHECK: b -> 547  "test.branch"() [^bb2] {tag = "b", foo = 4 : ui64} : () -> ()48 49^bb2:50  // CHECK: end -> 651  "test.foo"() {tag = "end"} : () -> ()52  return53 54}55 56// -----57 58// CHECK-LABEL: function: @test_simple_loop59func.func @test_simple_loop() -> () {60  // CHECK: init -> 161  "test.branch"() [^bb0] {tag = "init", foo = 1 : ui64} : () -> ()62 63^bb0:64  // CHECK: a -> 165  "test.foo"() {tag = "a", foo = 3 : ui64} : () -> ()66  "test.branch"() [^bb0, ^bb1] : () -> ()67 68^bb1:69  // CHECK: end -> 370  "test.foo"() {tag = "end"} : () -> ()71  return72}73 74// -----75 76// CHECK-LABEL: function: @test_double_loop77func.func @test_double_loop() -> () {78  // CHECK: init -> 279  "test.branch"() [^bb0] {tag = "init", foo = 2 : ui64} : () -> ()80 81^bb0:82  // CHECK: a -> 183  "test.foo"() {tag = "a", foo = 3 : ui64} : () -> ()84  "test.branch"() [^bb0, ^bb1] : () -> ()85 86^bb1:87  // CHECK: b -> 488  "test.foo"() {tag = "b", foo = 5 : ui64} : () -> ()89  "test.branch"() [^bb0, ^bb2] : () -> ()90 91^bb2:92  // CHECK: end -> 493  "test.foo"() {tag = "end"} : () -> ()94  return95}96