mirror of
https://github.com/ziglang/zig.git
synced 2026-01-09 08:55:36 +00:00
Add explanation about weird clang behavior on windows
This commit is contained in:
parent
1dc25d7550
commit
2da9e0060b
@ -1471,21 +1471,25 @@ pub fn addCases(cases: *tests.TranslateCContext) void {
|
||||
\\}
|
||||
});
|
||||
|
||||
cases.add("type referenced struct",
|
||||
\\struct Foo {
|
||||
\\ struct Bar{
|
||||
\\ int b;
|
||||
\\ };
|
||||
\\ struct Bar c;
|
||||
\\};
|
||||
, &[_][]const u8{
|
||||
\\pub const struct_Bar = extern struct {
|
||||
\\ b: c_int,
|
||||
\\};
|
||||
\\pub const struct_Foo = extern struct {
|
||||
\\ c: struct_Bar,
|
||||
\\};
|
||||
});
|
||||
if (builtin.os != .windows) {
|
||||
// When clang uses the <arch>-windows-none triple it behaves as MSVC and
|
||||
// interprets the inner `struct Bar` as an anonymous structure
|
||||
cases.add("type referenced struct",
|
||||
\\struct Foo {
|
||||
\\ struct Bar{
|
||||
\\ int b;
|
||||
\\ };
|
||||
\\ struct Bar c;
|
||||
\\};
|
||||
, &[_][]const u8{
|
||||
\\pub const struct_Bar = extern struct {
|
||||
\\ b: c_int,
|
||||
\\};
|
||||
\\pub const struct_Foo = extern struct {
|
||||
\\ c: struct_Bar,
|
||||
\\};
|
||||
});
|
||||
}
|
||||
|
||||
cases.add("undefined array global",
|
||||
\\int array[100] = {};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user