| ... | @@ -9,6 +9,8 @@ const maxInt = std.math.maxInt; | ... | @@ -9,6 +9,8 @@ const maxInt = std.math.maxInt; |
| 9 | top_level_field: i32, | 9 | top_level_field: i32, |
| 10 | | 10 | |
| 11 | test "top level fields" { | 11 | test "top level fields" { |
| | 12 | if (builtin.zig_backend == .stage2_x86_64 or builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| | 13 | |
| 12 | var instance = @This(){ | 14 | var instance = @This(){ |
| 13 | .top_level_field = 1234, | 15 | .top_level_field = 1234, |
| 14 | }; | 16 | }; |
| ... | @@ -29,6 +31,8 @@ const StructFoo = struct { | ... | @@ -29,6 +31,8 @@ const StructFoo = struct { |
| 29 | }; | 31 | }; |
| 30 | | 32 | |
| 31 | test "structs" { | 33 | test "structs" { |
| | 34 | if (builtin.zig_backend == .stage2_x86_64 or builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| | 35 | |
| 32 | var foo: StructFoo = undefined; | 36 | var foo: StructFoo = undefined; |
| 33 | @memset(@ptrCast([*]u8, &foo), 0, @sizeOf(StructFoo)); | 37 | @memset(@ptrCast([*]u8, &foo), 0, @sizeOf(StructFoo)); |
| 34 | foo.a += 1; | 38 | foo.a += 1; |
| ... | @@ -45,6 +49,8 @@ fn testMutation(foo: *StructFoo) void { | ... | @@ -45,6 +49,8 @@ fn testMutation(foo: *StructFoo) void { |
| 45 | } | 49 | } |
| 46 | | 50 | |
| 47 | test "struct byval assign" { | 51 | test "struct byval assign" { |
| | 52 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| | 53 | |
| 48 | var foo1: StructFoo = undefined; | 54 | var foo1: StructFoo = undefined; |
| 49 | var foo2: StructFoo = undefined; | 55 | var foo2: StructFoo = undefined; |
| 50 | | 56 | |
| ... | @@ -56,6 +62,8 @@ test "struct byval assign" { | ... | @@ -56,6 +62,8 @@ test "struct byval assign" { |
| 56 | } | 62 | } |
| 57 | | 63 | |
| 58 | test "call struct static method" { | 64 | test "call struct static method" { |
| | 65 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| | 66 | |
| 59 | const result = StructWithNoFields.add(3, 4); | 67 | const result = StructWithNoFields.add(3, 4); |
| 60 | try expect(result == 7); | 68 | try expect(result == 7); |
| 61 | } | 69 | } |
| ... | @@ -85,6 +93,8 @@ const Val = struct { | ... | @@ -85,6 +93,8 @@ const Val = struct { |
| 85 | }; | 93 | }; |
| 86 | | 94 | |
| 87 | test "fn call of struct field" { | 95 | test "fn call of struct field" { |
| | 96 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| | 97 | |
| 88 | const Foo = struct { | 98 | const Foo = struct { |
| 89 | ptr: fn () i32, | 99 | ptr: fn () i32, |
| 90 | }; | 100 | }; |
| ... | @@ -114,12 +124,16 @@ const MemberFnTestFoo = struct { | ... | @@ -114,12 +124,16 @@ const MemberFnTestFoo = struct { |
| 114 | }; | 124 | }; |
| 115 | | 125 | |
| 116 | test "call member function directly" { | 126 | test "call member function directly" { |
| | 127 | if (builtin.zig_backend == .stage2_x86_64 or builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| | 128 | |
| 117 | const instance = MemberFnTestFoo{ .x = 1234 }; | 129 | const instance = MemberFnTestFoo{ .x = 1234 }; |
| 118 | const result = MemberFnTestFoo.member(instance); | 130 | const result = MemberFnTestFoo.member(instance); |
| 119 | try expect(result == 1234); | 131 | try expect(result == 1234); |
| 120 | } | 132 | } |
| 121 | | 133 | |
| 122 | test "store member function in variable" { | 134 | test "store member function in variable" { |
| | 135 | if (builtin.zig_backend == .stage2_x86_64 or builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| | 136 | |
| 123 | const instance = MemberFnTestFoo{ .x = 1234 }; | 137 | const instance = MemberFnTestFoo{ .x = 1234 }; |
| 124 | const memberFn = MemberFnTestFoo.member; | 138 | const memberFn = MemberFnTestFoo.member; |
| 125 | const result = memberFn(instance); | 139 | const result = memberFn(instance); |
| ... | @@ -127,6 +141,8 @@ test "store member function in variable" { | ... | @@ -127,6 +141,8 @@ test "store member function in variable" { |
| 127 | } | 141 | } |
| 128 | | 142 | |
| 129 | test "member functions" { | 143 | test "member functions" { |
| | 144 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| | 145 | |
| 130 | const r = MemberFnRand{ .seed = 1234 }; | 146 | const r = MemberFnRand{ .seed = 1234 }; |
| 131 | try expect(r.getSeed() == 1234); | 147 | try expect(r.getSeed() == 1234); |
| 132 | } | 148 | } |
| ... | @@ -138,6 +154,8 @@ const MemberFnRand = struct { | ... | @@ -138,6 +154,8 @@ const MemberFnRand = struct { |
| 138 | }; | 154 | }; |
| 139 | | 155 | |
| 140 | test "return struct byval from function" { | 156 | test "return struct byval from function" { |
| | 157 | if (builtin.zig_backend == .stage2_x86_64 or builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| | 158 | |
| 141 | const bar = makeBar2(1234, 5678); | 159 | const bar = makeBar2(1234, 5678); |
| 142 | try expect(bar.y == 5678); | 160 | try expect(bar.y == 5678); |
| 143 | } | 161 | } |
| ... | @@ -153,6 +171,8 @@ fn makeBar2(x: i32, y: i32) Bar { | ... | @@ -153,6 +171,8 @@ fn makeBar2(x: i32, y: i32) Bar { |
| 153 | } | 171 | } |
| 154 | | 172 | |
| 155 | test "call method with mutable reference to struct with no fields" { | 173 | test "call method with mutable reference to struct with no fields" { |
| | 174 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| | 175 | |
| 156 | const S = struct { | 176 | const S = struct { |
| 157 | fn doC(s: *const @This()) bool { | 177 | fn doC(s: *const @This()) bool { |
| 158 | _ = s; | 178 | _ = s; |
| ... | @@ -172,6 +192,8 @@ test "call method with mutable reference to struct with no fields" { | ... | @@ -172,6 +192,8 @@ test "call method with mutable reference to struct with no fields" { |
| 172 | } | 192 | } |
| 173 | | 193 | |
| 174 | test "usingnamespace within struct scope" { | 194 | test "usingnamespace within struct scope" { |
| | 195 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| | 196 | |
| 175 | const S = struct { | 197 | const S = struct { |
| 176 | usingnamespace struct { | 198 | usingnamespace struct { |
| 177 | pub fn inner() i32 { | 199 | pub fn inner() i32 { |
| ... | @@ -183,6 +205,8 @@ test "usingnamespace within struct scope" { | ... | @@ -183,6 +205,8 @@ test "usingnamespace within struct scope" { |
| 183 | } | 205 | } |
| 184 | | 206 | |
| 185 | test "struct field init with catch" { | 207 | test "struct field init with catch" { |
| | 208 | if (builtin.zig_backend == .stage2_x86_64 or builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| | 209 | |
| 186 | const S = struct { | 210 | const S = struct { |
| 187 | fn doTheTest() !void { | 211 | fn doTheTest() !void { |
| 188 | var x: anyerror!isize = 1; | 212 | var x: anyerror!isize = 1; |