39 lines · plain
1// RUN: mlir-opt %s -pass-pipeline="builtin.module(func.func(test-print-topological-sort))" --split-input-file | FileCheck %s2 3// CHECK-LABEL: single_element4func.func @single_element() {5 // CHECK: test_sort_index = 06 return {test_to_sort}7}8 9// -----10 11// CHECK-LABEL: @simple_region12func.func @simple_region(%cond: i1) {13 // CHECK: test_sort_index = 014 %0 = arith.constant {test_to_sort} 42 : i3215 scf.if %cond {16 %1 = arith.addi %0, %0 : i3217 // CHECK: test_sort_index = 218 %2 = arith.subi %0, %1 {test_to_sort} : i3219 // CHECK: test_sort_index = 120 } {test_to_sort}21 return22}23 24// -----25 26// CHECK-LABEL: @multi_region27func.func @multi_region(%cond: i1) {28 scf.if %cond {29 // CHECK: test_sort_index = 030 %0 = arith.constant {test_to_sort} 42 : i3231 }32 33 scf.if %cond {34 // CHECK: test_sort_index = 135 %0 = arith.constant {test_to_sort} 24 : i3236 }37 return38}39