This is an archive of the discontinued LLVM Phabricator instance.

[mlir][emitc] Add test for invalid type
ClosedPublic

Authored by marbre on Apr 11 2022, 6:14 AM.

Diff Detail

Event Timeline

marbre created this revision.Apr 11 2022, 6:14 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 11 2022, 6:14 AM
marbre requested review of this revision.Apr 11 2022, 6:14 AM
jpienaar added inline comments.Apr 11 2022, 8:03 AM
mlir/test/Dialect/EmitC/invalid_types.mlir
5

This error could seemingly have been triggered by either variable name or type, the error message doesn't help much there and the test feels like either of these could be wrong.

marbre added inline comments.Apr 12 2022, 1:26 AM
mlir/test/Dialect/EmitC/invalid_types.mlir
5

mlir-opt points you to where the error occurs:

test/Dialect/EmitC/invalid_types.mlir:5:56: error: expected non empty string
    %1 = "emitc.variable"(){value = "" : !emitc.opaque<"">} : () -> !emitc.opaque<"">
                                                       ^

But I can modify the test in way that there is only one empty string:

test/Dialect/EmitC/invalid_types.mlir:5:58: error: expected non empty string
    %1 = "emitc.variable"(){value = "42" : !emitc.opaque<"">} : () -> !emitc.opaque<"mytype">
                                                         ^

Before updating the proposed patch, it seems you would prefer if I patch the error message as well, e.g. to "expected non empty string in !emitc.opaque type"?

jpienaar accepted this revision.Apr 17 2022, 3:54 PM
jpienaar added inline comments.
mlir/test/Dialect/EmitC/invalid_types.mlir
5

Updating the error message too thanks

This revision is now accepted and ready to land.Apr 17 2022, 3:54 PM
This revision was automatically updated to reflect the committed changes.