Fix SingleBlockImplicitTerminator traits to catch empty blocks
authorMehdi Amini <aminim@google.com>
Mon, 29 Jul 2019 18:21:55 +0000 (11:21 -0700)
committerjpienaar <jpienaar@google.com>
Tue, 30 Jul 2019 13:17:35 +0000 (06:17 -0700)
commit395c70c600ac89401caf50c3219a3af3248b3d99
treed7f7d1f558adf9ccc4548162603fa65dcb6f2620
parentb910d89264dda62950e0a1b2b56caebcbfcce20a
Fix SingleBlockImplicitTerminator traits to catch empty blocks

The code was written with the assumption that on failure an error would be
issued by another verifier. However verification is stopping on the first
failure which lead to an empty output. Instead we make sure an error is
displayed.
Also add tests in the test dialect for this trait.

PiperOrigin-RevId: 260541290
mlir/include/mlir/IR/OpDefinition.h
mlir/test/IR/traits.mlir
mlir/test/lib/TestDialect/TestOps.td