| ... | @@ -3529,4 +3529,16 @@ pub fn addCases(cases: *tests.TranslateCContext) void { | ... | @@ -3529,4 +3529,16 @@ pub fn addCases(cases: *tests.TranslateCContext) void { |
| 3529 | \\warning: unable to translate function, demoted to extern | 3529 | \\warning: unable to translate function, demoted to extern |
| 3530 | \\pub extern fn initialize() void; | 3530 | \\pub extern fn initialize() void; |
| 3531 | }); | 3531 | }); |
| | 3532 | |
| | 3533 | cases.add("Function prototype declared within function", |
| | 3534 | \\int foo(void) { |
| | 3535 | \\ extern int bar(int, int); |
| | 3536 | \\ return bar(1, 2); |
| | 3537 | \\} |
| | 3538 | , &[_][]const u8{ |
| | 3539 | \\pub extern fn bar(c_int, c_int) c_int; |
| | 3540 | \\pub export fn foo() c_int { |
| | 3541 | \\ return bar(@as(c_int, 1), @as(c_int, 2)); |
| | 3542 | \\} |
| | 3543 | }); |
| 3532 | } | 3544 | } |