| ... | @@ -2855,7 +2855,7 @@ pub fn addCases(cases: *tests.TranslateCContext) void { | ... | @@ -2855,7 +2855,7 @@ pub fn addCases(cases: *tests.TranslateCContext) void { |
| 2855 | }); | 2855 | }); |
| 2856 | | 2856 | |
| 2857 | if (std.Target.current.abi == .msvc) { | 2857 | if (std.Target.current.abi == .msvc) { |
| 2858 | cases.add("nameless struct fields on msvc", | 2858 | cases.add("nameless struct fields", |
| 2859 | \\typedef struct NAMED | 2859 | \\typedef struct NAMED |
| 2860 | \\{ | 2860 | \\{ |
| 2861 | \\ long name; | 2861 | \\ long name; |
| ... | @@ -2876,5 +2876,26 @@ pub fn addCases(cases: *tests.TranslateCContext) void { | ... | @@ -2876,5 +2876,26 @@ pub fn addCases(cases: *tests.TranslateCContext) void { |
| 2876 | \\ b: c_long, | 2876 | \\ b: c_long, |
| 2877 | \\}; | 2877 | \\}; |
| 2878 | }); | 2878 | }); |
| | 2879 | } else { |
| | 2880 | cases.add("nameless struct fields", |
| | 2881 | \\typedef struct NAMED |
| | 2882 | \\{ |
| | 2883 | \\ long name; |
| | 2884 | \\} NAMED; |
| | 2885 | \\ |
| | 2886 | \\typedef struct ONENAMEWITHSTRUCT |
| | 2887 | \\{ |
| | 2888 | \\ NAMED; |
| | 2889 | \\ long b; |
| | 2890 | \\} ONENAMEWITHSTRUCT; |
| | 2891 | , &[_][]const u8{ |
| | 2892 | \\pub const struct_NAMED = extern struct { |
| | 2893 | \\ name: c_long, |
| | 2894 | \\}; |
| | 2895 | \\pub const NAMED = struct_NAMED; |
| | 2896 | \\pub const struct_ONENAMEWITHSTRUCT = extern struct { |
| | 2897 | \\ b: c_long, |
| | 2898 | \\}; |
| | 2899 | }); |
| 2879 | } | 2900 | } |
| 2880 | } | 2901 | } |