| ... | ... | @@ -2853,4 +2853,28 @@ pub fn addCases(cases: *tests.TranslateCContext) void { |
| 2853 | 2853 | , &[_][]const u8{ |
| 2854 | 2854 | \\pub const FOO = 0x61626364; |
| 2855 | 2855 | }); |
| 2856 | |
| 2857 | if (std.Target.current.abi == .msvc) { |
| 2858 | cases.add("nameless struct fields on msvc", |
| 2859 | \\typedef struct NAMED |
| 2860 | \\{ |
| 2861 | \\ long name; |
| 2862 | \\} NAMED; |
| 2863 | \\ |
| 2864 | \\typedef struct ONENAMEWITHSTRUCT |
| 2865 | \\{ |
| 2866 | \\ NAMED; |
| 2867 | \\ long b; |
| 2868 | \\} ONENAMEWITHSTRUCT; |
| 2869 | , &[_][]const u8{ |
| 2870 | \\pub const struct_NAMED = extern struct { |
| 2871 | \\ name: c_long, |
| 2872 | \\}; |
| 2873 | \\pub const NAMED = struct_NAMED; |
| 2874 | \\pub const struct_ONENAMEWITHSTRUCT = extern struct { |
| 2875 | \\ unnamed_1: struct_NAMED, |
| 2876 | \\ b: c_long, |
| 2877 | \\}; |
| 2878 | }); |
| 2879 | } |
| 2856 | 2880 | } |