translate-c: translate extern unknown-length arrays using @extern

Resolves: #14743
This commit is contained in:
mlugg
2023-03-07 22:24:50 +00:00
committed by Veikka Tuominen
parent c93e0d8618
commit a8bd55e085
3 changed files with 51 additions and 1 deletions

View File

@@ -3948,4 +3948,12 @@ pub fn addCases(cases: *tests.TranslateCContext) void {
\\}
});
}
cases.add("extern array of unknown length",
\\extern int foo[];
, &[_][]const u8{
\\const foo: [*c]c_int = @extern([*c]c_int, .{
\\ .name = "foo",
\\});
});
}