We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c744a53 commit 4b84b66Copy full SHA for 4b84b66
mlir/lib/Dialect/EmitC/IR/EmitC.cpp
@@ -436,6 +436,10 @@ LogicalResult FuncOp::verify() {
436
if (getNumResults() > 1)
437
return emitOpError("requires zero or exactly one result, but has ")
438
<< getNumResults();
439
+
440
+ if (isExternal())
441
+ return emitOpError("does not support empty function bodies");
442
443
return success();
444
}
445
mlir/test/Dialect/EmitC/invalid_ops.mlir
@@ -321,3 +321,8 @@ func.func @return_inside_func.func(%0: i32) -> (i32) {
321
322
// expected-error@+1 {{expected non-function type}}
323
emitc.func @func_variadic(...)
324
325
+// -----
326
327
+// expected-error@+1 {{'emitc.func' op does not support empty function bodies}}
328
+emitc.func private @empty()
0 commit comments