================
@@ -0,0 +1,81 @@
+// RUN: cir-opt %s -verify-diagnostics -split-input-file
+
+!s32i = !cir.int<s, 32>
+
+cir.func private @dtor(!cir.ptr<!s32i>)
+
+cir.func @while_cleanup_missing_kind(%cond : !cir.bool, %s : !cir.ptr<!s32i>) {
+  cir.while {
+    cir.condition(%cond)
+  } do {
+    cir.yield
+  // expected-error @below {{expected valid keyword or string}}
+  // expected-error @below {{failed to parse CIR_CleanupKindAttr}}
----------------
andykaylor wrote:

I'd prefer to leave this as is. @erichkeane has been pushing back against 
custom print/parse when we can avoid them (and I think he's right to do so). 
The error already points you to the missing attribute type. The possible 
keywords here will change (we'll be adding lifetime soon), and it's slightly 
different than the set used in CleanupScopeOp (which unlike the loops accepts 
"eh"). In fact, "eh" will parse cleanly here but be rejected by the verifier.

I was a little surprised that the standard MLIR enum attribute parser didn't 
have a better error message. Maybe it will some day.

https://github.com/llvm/llvm-project/pull/210212
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to