fix tests

This commit is contained in:
SuperAuguste 2020-04-07 15:19:28 -04:00
parent 882aa86843
commit 116c76cf82

View File

@ -2855,7 +2855,7 @@ pub fn addCases(cases: *tests.TranslateCContext) void {
}); });
if (std.Target.current.abi == .msvc) { if (std.Target.current.abi == .msvc) {
cases.add("nameless struct fields on msvc", cases.add("nameless struct fields",
\\typedef struct NAMED \\typedef struct NAMED
\\{ \\{
\\ long name; \\ long name;
@ -2876,5 +2876,26 @@ pub fn addCases(cases: *tests.TranslateCContext) void {
\\ b: c_long, \\ b: c_long,
\\}; \\};
}); });
} else {
cases.add("nameless struct fields",
\\typedef struct NAMED
\\{
\\ long name;
\\} NAMED;
\\
\\typedef struct ONENAMEWITHSTRUCT
\\{
\\ NAMED;
\\ long b;
\\} ONENAMEWITHSTRUCT;
, &[_][]const u8{
\\pub const struct_NAMED = extern struct {
\\ name: c_long,
\\};
\\pub const NAMED = struct_NAMED;
\\pub const struct_ONENAMEWITHSTRUCT = extern struct {
\\ b: c_long,
\\};
});
} }
} }