aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorLemonBoy <thatlemon@gmail.com>2020-01-05 20:29:14 +0100
committerAndrew Kelley <andrew@ziglang.org>2020-01-06 19:17:47 -0500
commit2da9e0060b0ab4cbb404f55e279606766439e0cd (patch)
tree8a2d8edefdd93ad6a14e389f00f846e2cd5317aa /test
parent1dc25d75506adbd7f011c362fbcac01c27e940f4 (diff)
downloadzig-2da9e0060b0ab4cbb404f55e279606766439e0cd.tar.gz
zig-2da9e0060b0ab4cbb404f55e279606766439e0cd.zip
Add explanation about weird clang behavior on windows
Diffstat (limited to 'test')
-rw-r--r--test/translate_c.zig34
1 files changed, 19 insertions, 15 deletions
diff --git a/test/translate_c.zig b/test/translate_c.zig
index a36d9e0f6f..caa66a1fd9 100644
--- a/test/translate_c.zig
+++ b/test/translate_c.zig
@@ -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] = {};