1 // RUN: mlir-opt %s | mlir-opt | FileCheck %s
2 // RUN: mlir-opt %s --mlir-print-op-generic | mlir-opt | FileCheck %s
4 // CHECK-LABEL: @assert
5 func.func @assert(%arg : i1) {
6 cf.assert %arg, "Some message in case this assertion fails."
10 // CHECK-LABEL: func @switch(
11 func.func @switch(%flag : i32, %caseOperand : i32) {
12 cf.switch %flag : i32, [
13 default: ^bb1(%caseOperand : i32),
14 42: ^bb2(%caseOperand : i32),
15 43: ^bb3(%caseOperand : i32)
26 // CHECK-LABEL: func @switch_i64(
27 func.func @switch_i64(%flag : i64, %caseOperand : i32) {
28 cf.switch %flag : i64, [
29 default: ^bb1(%caseOperand : i32),
30 42: ^bb2(%caseOperand : i32),
31 43: ^bb3(%caseOperand : i32)
42 // CHECK-LABEL: func @switch_result_number
43 func.func @switch_result_number(%arg0: i32) {
44 %0:2 = "test.op_with_two_results"() : () -> (i32, i32)
45 cf.switch %arg0 : i32, [