File tree 2 files changed +17
-1
lines changed
lib/Conversion/FuncToEmitC
test/Conversion/FuncToEmitC 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ class CallOpConversion final : public OpConversionPattern<func::CallOp> {
31
31
LogicalResult
32
32
matchAndRewrite (func::CallOp callOp, OpAdaptor adaptor,
33
33
ConversionPatternRewriter &rewriter) const override {
34
- // Multiple results func was not converted to `emitc.func`.
34
+ // Multiple results func cannot be converted to `emitc.func`.
35
35
if (callOp.getNumResults () > 1 )
36
36
return rewriter.notifyMatchFailure (
37
37
callOp, " only functions with zero or one result can be converted" );
Original file line number Diff line number Diff line change @@ -88,3 +88,19 @@ func.func @index_args_only(%i: index) -> f32 {
88
88
%0 = arith.constant 0.0 : f32
89
89
return %0 : f32
90
90
}
91
+
92
+ // -----
93
+
94
+ // CHECK-LABEL: emitc.func private @return_void() attributes {specifiers = ["static"]}
95
+ // CHECK-NEXT: emitc.return
96
+ func.func private @return_void () {
97
+ return
98
+ }
99
+
100
+ // CHECK-LABEL: emitc.func @call()
101
+ // CHECK-NEXT: emitc.call @return_void() : () -> ()
102
+ // CHECK-NEXT: emitc.return
103
+ func.func @call () {
104
+ call @return_void () : () -> ()
105
+ return
106
+ }
You can’t perform that action at this time.
0 commit comments