Files
clang-p2996/mlir/test/Integration/Dialect/ControlFlow/assert.mlir
Matthias Springer 325b58d59f [mlir][cf] Print message in cf.assert to LLVM lowering
The assert message was previously ignored. The lowered IR now calls `puts` it in case of a failed assertion.

Differential Revision: https://reviews.llvm.org/D138647
2022-12-15 17:45:34 +01:00

15 lines
368 B
MLIR

// RUN: mlir-opt %s -test-cf-assert \
// RUN: -convert-func-to-llvm | \
// RUN: mlir-cpu-runner -e main -entry-point-result=void | \
// RUN: FileCheck %s
func.func @main() {
%a = arith.constant 0 : i1
%b = arith.constant 1 : i1
// CHECK: assertion foo
cf.assert %a, "assertion foo"
// CHECK-NOT: assertion bar
cf.assert %b, "assertion bar"
return
}