blob: 8453c2b7038f149bf96b6ab8dbd162e83e02db52 [file] [log] [blame]
// RUN: mlir-opt %s | mlir-opt | FileCheck %s
// RUN: mlir-opt %s --mlir-print-op-generic | mlir-opt | FileCheck %s
// CHECK-LABEL: @assert
func.func @assert(%arg : i1) {
cf.assert %arg, "Some message in case this assertion fails."
return
}
// CHECK-LABEL: func @switch(
func.func @switch(%flag : i32, %caseOperand : i32) {
cf.switch %flag : i32, [
default: ^bb1(%caseOperand : i32),
42: ^bb2(%caseOperand : i32),
43: ^bb3(%caseOperand : i32)
]
^bb1(%bb1arg : i32):
return
^bb2(%bb2arg : i32):
return
^bb3(%bb3arg : i32):
return
}
// CHECK-LABEL: func @switch_i64(
func.func @switch_i64(%flag : i64, %caseOperand : i32) {
cf.switch %flag : i64, [
default: ^bb1(%caseOperand : i32),
42: ^bb2(%caseOperand : i32),
43: ^bb3(%caseOperand : i32)
]
^bb1(%bb1arg : i32):
return
^bb2(%bb2arg : i32):
return
^bb3(%bb3arg : i32):
return
}