1 // RUN: mlir-opt %s -convert-cf-to-llvm | FileCheck %s
3 func.func @name(%flag: i32, %pred: i1){
4 // Test cf.br lowering failure with type mismatch
6 %c0 = arith.constant 0 : index
7 cf.br ^bb1(%c0 : index)
9 // Test cf.cond_br lowering failure with type mismatch in false_dest
11 ^bb1(%0: index): // 2 preds: ^bb0, ^bb2
12 %c1 = arith.constant 1 : i1
13 %c2 = arith.constant 1 : index
14 cf.cond_br %pred, ^bb2(%c1: i1), ^bb3(%c2: index)
16 // Test cf.cond_br lowering failure with type mismatch in true_dest
19 %c3 = arith.constant 1 : i1
20 %c4 = arith.constant 1 : index
21 cf.cond_br %pred, ^bb3(%c4: index), ^bb2(%c3: i1)
23 // Test cf.switch lowering failure with type mismatch in default case
25 ^bb3(%2: index): // pred: ^bb1
26 %c5 = arith.constant 1 : i1
27 %c6 = arith.constant 1 : index
28 cf.switch %flag : i32, [
29 default: ^bb1(%c6 : index),
33 // Test cf.switch lowering failure with type mismatch in non-default case
35 ^bb4(%3: i1): // pred: ^bb1
36 %c7 = arith.constant 1 : i1
37 %c8 = arith.constant 1 : index
38 cf.switch %flag : i32, [
39 default: ^bb2(%c7 : i1),