authorgravatar for jacobly@ziglang.orgJacob Young <jacobly@ziglang.org> 2023-10-20 04:35:29-04:00
committergravatar for jacobly@ziglang.orgJacob Young <jacobly@ziglang.org> 2023-10-21 10:55:41-04:00
log32e85d44eb72122d174de02d4020f149026dd787
treec1cdf78a31337b74fce4a70d99d9eb1384651937
parent2e6e39a7004dae626ad3088cbf1e652f157e6db8

x86_64: disable failing tests, enable test-std testing


56 files changed, 447 insertions(+), 17 deletions(-)

lib/std/Thread/Condition.zig+6
...@@ -369,6 +369,8 @@ test "Condition - signal" {...@@ -369,6 +369,8 @@ test "Condition - signal" {
369 return error.SkipZigTest;369 return error.SkipZigTest;
370 }370 }
371371
372 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
373
372 const num_threads = 4;374 const num_threads = 4;
373375
374 const SignalTest = struct {376 const SignalTest = struct {
...@@ -498,6 +500,8 @@ test "Condition - broadcasting" {...@@ -498,6 +500,8 @@ test "Condition - broadcasting" {
498 return error.SkipZigTest;500 return error.SkipZigTest;
499 }501 }
500502
503 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
504
501 const num_threads = 10;505 const num_threads = 10;
502506
503 const BroadcastTest = struct {507 const BroadcastTest = struct {
...@@ -565,6 +569,8 @@ test "Condition - broadcasting - wake all threads" {...@@ -565,6 +569,8 @@ test "Condition - broadcasting - wake all threads" {
565 return error.SkipZigTest;569 return error.SkipZigTest;
566 }570 }
567571
572 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
573
568 var num_runs: usize = 1;574 var num_runs: usize = 1;
569 const num_threads = 10;575 const num_threads = 10;
570576
lib/std/Thread/Mutex.zig+2
...@@ -289,6 +289,8 @@ test "Mutex - many contended" {...@@ -289,6 +289,8 @@ test "Mutex - many contended" {
289 return error.SkipZigTest;289 return error.SkipZigTest;
290 }290 }
291291
292 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
293
292 const num_threads = 4;294 const num_threads = 4;
293 const num_increments = 1000;295 const num_increments = 1000;
294296
lib/std/Thread/RwLock.zig+2
...@@ -297,6 +297,8 @@ test "RwLock - concurrent access" {...@@ -297,6 +297,8 @@ test "RwLock - concurrent access" {
297 if (builtin.single_threaded)297 if (builtin.single_threaded)
298 return;298 return;
299299
300 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
301
300 const num_writers: usize = 2;302 const num_writers: usize = 2;
301 const num_readers: usize = 4;303 const num_readers: usize = 4;
302 const num_writes: usize = 10000;304 const num_writes: usize = 10000;
lib/std/Uri.zig+2
...@@ -685,6 +685,8 @@ test "Special test" {...@@ -685,6 +685,8 @@ test "Special test" {
685}685}
686686
687test "URI escaping" {687test "URI escaping" {
688 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
689
688 const input = "\\ö/ äöß ~~.adas-https://canvas:123/#ads&&sad";690 const input = "\\ö/ äöß ~~.adas-https://canvas:123/#ads&&sad";
689 const expected = "%5C%C3%B6%2F%20%C3%A4%C3%B6%C3%9F%20~~.adas-https%3A%2F%2Fcanvas%3A123%2F%23ads%26%26sad";691 const expected = "%5C%C3%B6%2F%20%C3%A4%C3%B6%C3%9F%20~~.adas-https%3A%2F%2Fcanvas%3A123%2F%23ads%26%26sad";
690692
lib/std/array_hash_map.zig+15
...@@ -1,4 +1,5 @@...@@ -1,4 +1,5 @@
1const std = @import("std.zig");1const std = @import("std.zig");
2const builtin = @import("builtin");
2const debug = std.debug;3const debug = std.debug;
3const assert = debug.assert;4const assert = debug.assert;
4const testing = std.testing;5const testing = std.testing;
...@@ -2137,6 +2138,8 @@ test "ensure capacity leak" {...@@ -2137,6 +2138,8 @@ test "ensure capacity leak" {
2137}2138}
21382139
2139test "big map" {2140test "big map" {
2141 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
2142
2140 var map = AutoArrayHashMap(i32, i32).init(std.testing.allocator);2143 var map = AutoArrayHashMap(i32, i32).init(std.testing.allocator);
2141 defer map.deinit();2144 defer map.deinit();
21422145
...@@ -2190,6 +2193,8 @@ test "big map" {...@@ -2190,6 +2193,8 @@ test "big map" {
2190}2193}
21912194
2192test "clone" {2195test "clone" {
2196 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
2197
2193 var original = AutoArrayHashMap(i32, i32).init(std.testing.allocator);2198 var original = AutoArrayHashMap(i32, i32).init(std.testing.allocator);
2194 defer original.deinit();2199 defer original.deinit();
21952200
...@@ -2216,6 +2221,8 @@ test "clone" {...@@ -2216,6 +2221,8 @@ test "clone" {
2216}2221}
22172222
2218test "shrink" {2223test "shrink" {
2224 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
2225
2219 var map = AutoArrayHashMap(i32, i32).init(std.testing.allocator);2226 var map = AutoArrayHashMap(i32, i32).init(std.testing.allocator);
2220 defer map.deinit();2227 defer map.deinit();
22212228
...@@ -2256,6 +2263,8 @@ test "shrink" {...@@ -2256,6 +2263,8 @@ test "shrink" {
2256}2263}
22572264
2258test "pop" {2265test "pop" {
2266 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
2267
2259 var map = AutoArrayHashMap(i32, i32).init(std.testing.allocator);2268 var map = AutoArrayHashMap(i32, i32).init(std.testing.allocator);
2260 defer map.deinit();2269 defer map.deinit();
22612270
...@@ -2274,6 +2283,8 @@ test "pop" {...@@ -2274,6 +2283,8 @@ test "pop" {
2274}2283}
22752284
2276test "popOrNull" {2285test "popOrNull" {
2286 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
2287
2277 var map = AutoArrayHashMap(i32, i32).init(std.testing.allocator);2288 var map = AutoArrayHashMap(i32, i32).init(std.testing.allocator);
2278 defer map.deinit();2289 defer map.deinit();
22792290
...@@ -2294,6 +2305,8 @@ test "popOrNull" {...@@ -2294,6 +2305,8 @@ test "popOrNull" {
2294}2305}
22952306
2296test "reIndex" {2307test "reIndex" {
2308 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
2309
2297 var map = ArrayHashMap(i32, i32, AutoContext(i32), true).init(std.testing.allocator);2310 var map = ArrayHashMap(i32, i32, AutoContext(i32), true).init(std.testing.allocator);
2298 defer map.deinit();2311 defer map.deinit();
22992312
...@@ -2338,6 +2351,8 @@ test "auto store_hash" {...@@ -2338,6 +2351,8 @@ test "auto store_hash" {
2338}2351}
23392352
2340test "sort" {2353test "sort" {
2354 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
2355
2341 var map = AutoArrayHashMap(i32, i32).init(std.testing.allocator);2356 var map = AutoArrayHashMap(i32, i32).init(std.testing.allocator);
2342 defer map.deinit();2357 defer map.deinit();
23432358
lib/std/array_list.zig+11
...@@ -1,4 +1,5 @@...@@ -1,4 +1,5 @@
1const std = @import("std.zig");1const std = @import("std.zig");
2const builtin = @import("builtin");
2const debug = std.debug;3const debug = std.debug;
3const assert = debug.assert;4const assert = debug.assert;
4const testing = std.testing;5const testing = std.testing;
...@@ -1183,6 +1184,8 @@ test "std.ArrayList/ArrayListUnmanaged.initCapacity" {...@@ -1183,6 +1184,8 @@ test "std.ArrayList/ArrayListUnmanaged.initCapacity" {
1183}1184}
11841185
1185test "std.ArrayList/ArrayListUnmanaged.clone" {1186test "std.ArrayList/ArrayListUnmanaged.clone" {
1187 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
1188
1186 const a = testing.allocator;1189 const a = testing.allocator;
1187 {1190 {
1188 var array = ArrayList(i32).init(a);1191 var array = ArrayList(i32).init(a);
...@@ -1224,6 +1227,8 @@ test "std.ArrayList/ArrayListUnmanaged.clone" {...@@ -1224,6 +1227,8 @@ test "std.ArrayList/ArrayListUnmanaged.clone" {
1224}1227}
12251228
1226test "std.ArrayList/ArrayListUnmanaged.basic" {1229test "std.ArrayList/ArrayListUnmanaged.basic" {
1230 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
1231
1227 const a = testing.allocator;1232 const a = testing.allocator;
1228 {1233 {
1229 var list = ArrayList(i32).init(a);1234 var list = ArrayList(i32).init(a);
...@@ -1508,6 +1513,8 @@ test "std.ArrayList/ArrayListUnmanaged.insert" {...@@ -1508,6 +1513,8 @@ test "std.ArrayList/ArrayListUnmanaged.insert" {
1508}1513}
15091514
1510test "std.ArrayList/ArrayListUnmanaged.insertSlice" {1515test "std.ArrayList/ArrayListUnmanaged.insertSlice" {
1516 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
1517
1511 const a = testing.allocator;1518 const a = testing.allocator;
1512 {1519 {
1513 var list = ArrayList(i32).init(a);1520 var list = ArrayList(i32).init(a);
...@@ -1554,6 +1561,8 @@ test "std.ArrayList/ArrayListUnmanaged.insertSlice" {...@@ -1554,6 +1561,8 @@ test "std.ArrayList/ArrayListUnmanaged.insertSlice" {
1554}1561}
15551562
1556test "std.ArrayList/ArrayListUnmanaged.replaceRange" {1563test "std.ArrayList/ArrayListUnmanaged.replaceRange" {
1564 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
1565
1557 var arena = std.heap.ArenaAllocator.init(testing.allocator);1566 var arena = std.heap.ArenaAllocator.init(testing.allocator);
1558 defer arena.deinit();1567 defer arena.deinit();
1559 const a = arena.allocator();1568 const a = arena.allocator();
...@@ -1725,6 +1734,8 @@ test "shrink still sets length when resizing is disabled" {...@@ -1725,6 +1734,8 @@ test "shrink still sets length when resizing is disabled" {
1725}1734}
17261735
1727test "shrinkAndFree with a copy" {1736test "shrinkAndFree with a copy" {
1737 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
1738
1728 var failing_allocator = testing.FailingAllocator.init(testing.allocator, .{ .resize_fail_index = 0 });1739 var failing_allocator = testing.FailingAllocator.init(testing.allocator, .{ .resize_fail_index = 0 });
1729 const a = failing_allocator.allocator();1740 const a = failing_allocator.allocator();
17301741
lib/std/atomic/Atomic.zig+2
...@@ -469,6 +469,8 @@ test "Atomic.fetchSub" {...@@ -469,6 +469,8 @@ test "Atomic.fetchSub" {
469}469}
470470
471test "Atomic.fetchMin" {471test "Atomic.fetchMin" {
472 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
473
472 inline for (atomicIntTypes()) |Int| {474 inline for (atomicIntTypes()) |Int| {
473 inline for (atomic_rmw_orderings) |ordering| {475 inline for (atomic_rmw_orderings) |ordering| {
474 var x = Atomic(Int).init(5);476 var x = Atomic(Int).init(5);
lib/std/atomic/queue.zig+2
...@@ -175,6 +175,8 @@ const puts_per_thread = 500;...@@ -175,6 +175,8 @@ const puts_per_thread = 500;
175const put_thread_count = 3;175const put_thread_count = 3;
176176
177test "std.atomic.Queue" {177test "std.atomic.Queue" {
178 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
179
178 var plenty_of_memory = try std.heap.page_allocator.alloc(u8, 300 * 1024);180 var plenty_of_memory = try std.heap.page_allocator.alloc(u8, 300 * 1024);
179 defer std.heap.page_allocator.free(plenty_of_memory);181 defer std.heap.page_allocator.free(plenty_of_memory);
180182
lib/std/bit_set.zig+7-2
...@@ -33,6 +33,7 @@...@@ -33,6 +33,7 @@
33const std = @import("std.zig");33const std = @import("std.zig");
34const assert = std.debug.assert;34const assert = std.debug.assert;
35const Allocator = std.mem.Allocator;35const Allocator = std.mem.Allocator;
36const builtin = @import("builtin");
3637
37/// Returns the optimal static bit set type for the specified number38/// Returns the optimal static bit set type for the specified number
38/// of elements: either `IntegerBitSet` or `ArrayBitSet`,39/// of elements: either `IntegerBitSet` or `ArrayBitSet`,
...@@ -1636,7 +1637,7 @@ fn testStaticBitSet(comptime Set: type) !void {...@@ -1636,7 +1637,7 @@ fn testStaticBitSet(comptime Set: type) !void {
1636}1637}
16371638
1638test "IntegerBitSet" {1639test "IntegerBitSet" {
1639 switch (@import("builtin").zig_backend) {1640 switch (builtin.zig_backend) {
1640 .stage2_c, .stage2_x86_64 => return error.SkipZigTest,1641 .stage2_c, .stage2_x86_64 => return error.SkipZigTest,
1641 else => {},1642 else => {},
1642 }1643 }
...@@ -1652,7 +1653,7 @@ test "IntegerBitSet" {...@@ -1652,7 +1653,7 @@ test "IntegerBitSet" {
1652}1653}
16531654
1654test "ArrayBitSet" {1655test "ArrayBitSet" {
1655 switch (@import("builtin").zig_backend) {1656 switch (builtin.zig_backend) {
1656 .stage2_x86_64 => return error.SkipZigTest,1657 .stage2_x86_64 => return error.SkipZigTest,
1657 else => {},1658 else => {},
1658 }1659 }
...@@ -1667,6 +1668,8 @@ test "ArrayBitSet" {...@@ -1667,6 +1668,8 @@ test "ArrayBitSet" {
1667}1668}
16681669
1669test "DynamicBitSetUnmanaged" {1670test "DynamicBitSetUnmanaged" {
1671 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
1672
1670 const allocator = std.testing.allocator;1673 const allocator = std.testing.allocator;
1671 var a = try DynamicBitSetUnmanaged.initEmpty(allocator, 300);1674 var a = try DynamicBitSetUnmanaged.initEmpty(allocator, 300);
1672 try testing.expectEqual(@as(usize, 0), a.count());1675 try testing.expectEqual(@as(usize, 0), a.count());
...@@ -1720,6 +1723,8 @@ test "DynamicBitSetUnmanaged" {...@@ -1720,6 +1723,8 @@ test "DynamicBitSetUnmanaged" {
1720}1723}
17211724
1722test "DynamicBitSet" {1725test "DynamicBitSet" {
1726 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
1727
1723 const allocator = std.testing.allocator;1728 const allocator = std.testing.allocator;
1724 var a = try DynamicBitSet.initEmpty(allocator, 300);1729 var a = try DynamicBitSet.initEmpty(allocator, 300);
1725 try testing.expectEqual(@as(usize, 0), a.count());1730 try testing.expectEqual(@as(usize, 0), a.count());
lib/std/compress/deflate/compressor.zig+2
...@@ -1069,6 +1069,8 @@ var deflate_tests = [_]DeflateTest{...@@ -1069,6 +1069,8 @@ var deflate_tests = [_]DeflateTest{
1069};1069};
10701070
1071test "deflate" {1071test "deflate" {
1072 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
1073
1072 for (deflate_tests) |dt| {1074 for (deflate_tests) |dt| {
1073 var output = ArrayList(u8).init(testing.allocator);1075 var output = ArrayList(u8).init(testing.allocator);
1074 defer output.deinit();1076 defer output.deinit();
lib/std/compress/deflate/compressor_test.zig+18
...@@ -154,6 +154,8 @@ fn testToFromWithLimit(input: []const u8, limit: [11]u32) !void {...@@ -154,6 +154,8 @@ fn testToFromWithLimit(input: []const u8, limit: [11]u32) !void {
154}154}
155155
156test "deflate/inflate" {156test "deflate/inflate" {
157 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
158
157 var limits = [_]u32{0} ** 11;159 var limits = [_]u32{0} ** 11;
158160
159 var test0 = [_]u8{};161 var test0 = [_]u8{};
...@@ -178,6 +180,8 @@ test "deflate/inflate" {...@@ -178,6 +180,8 @@ test "deflate/inflate" {
178}180}
179181
180test "very long sparse chunk" {182test "very long sparse chunk" {
183 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
184
181 // A SparseReader returns a stream consisting of 0s ending with 65,536 (1<<16) 1s.185 // A SparseReader returns a stream consisting of 0s ending with 65,536 (1<<16) 1s.
182 // This tests missing hash references in a very large input.186 // This tests missing hash references in a very large input.
183 const SparseReader = struct {187 const SparseReader = struct {
...@@ -239,6 +243,8 @@ test "very long sparse chunk" {...@@ -239,6 +243,8 @@ test "very long sparse chunk" {
239}243}
240244
241test "compressor reset" {245test "compressor reset" {
246 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
247
242 for (std.enums.values(deflate.Compression)) |c| {248 for (std.enums.values(deflate.Compression)) |c| {
243 try testWriterReset(c, null);249 try testWriterReset(c, null);
244 try testWriterReset(c, "dict");250 try testWriterReset(c, "dict");
...@@ -289,6 +295,8 @@ fn testWriterReset(level: deflate.Compression, dict: ?[]const u8) !void {...@@ -289,6 +295,8 @@ fn testWriterReset(level: deflate.Compression, dict: ?[]const u8) !void {
289}295}
290296
291test "decompressor dictionary" {297test "decompressor dictionary" {
298 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
299
292 const dict = "hello world"; // dictionary300 const dict = "hello world"; // dictionary
293 const text = "hello again world";301 const text = "hello again world";
294302
...@@ -329,6 +337,8 @@ test "decompressor dictionary" {...@@ -329,6 +337,8 @@ test "decompressor dictionary" {
329}337}
330338
331test "compressor dictionary" {339test "compressor dictionary" {
340 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
341
332 const dict = "hello world";342 const dict = "hello world";
333 const text = "hello again world";343 const text = "hello again world";
334344
...@@ -375,6 +385,8 @@ test "compressor dictionary" {...@@ -375,6 +385,8 @@ test "compressor dictionary" {
375// Update the hash for best_speed only if d.index < d.maxInsertIndex385// Update the hash for best_speed only if d.index < d.maxInsertIndex
376// See https://golang.org/issue/2508386// See https://golang.org/issue/2508
377test "Go non-regression test for 2508" {387test "Go non-regression test for 2508" {
388 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
389
378 var comp = try compressor(390 var comp = try compressor(
379 testing.allocator,391 testing.allocator,
380 io.null_writer,392 io.null_writer,
...@@ -392,6 +404,8 @@ test "Go non-regression test for 2508" {...@@ -392,6 +404,8 @@ test "Go non-regression test for 2508" {
392}404}
393405
394test "deflate/inflate string" {406test "deflate/inflate string" {
407 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
408
395 const StringTest = struct {409 const StringTest = struct {
396 filename: []const u8,410 filename: []const u8,
397 limit: [11]u32,411 limit: [11]u32,
...@@ -439,6 +453,8 @@ test "deflate/inflate string" {...@@ -439,6 +453,8 @@ test "deflate/inflate string" {
439}453}
440454
441test "inflate reset" {455test "inflate reset" {
456 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
457
442 const strings = [_][]const u8{458 const strings = [_][]const u8{
443 "lorem ipsum izzle fo rizzle",459 "lorem ipsum izzle fo rizzle",
444 "the quick brown fox jumped over",460 "the quick brown fox jumped over",
...@@ -485,6 +501,8 @@ test "inflate reset" {...@@ -485,6 +501,8 @@ test "inflate reset" {
485}501}
486502
487test "inflate reset dictionary" {503test "inflate reset dictionary" {
504 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
505
488 const dict = "the lorem fox";506 const dict = "the lorem fox";
489 const strings = [_][]const u8{507 const strings = [_][]const u8{
490 "lorem ipsum izzle fo rizzle",508 "lorem ipsum izzle fo rizzle",
lib/std/compress/deflate/deflate_fast.zig+2
...@@ -649,6 +649,8 @@ test "best speed shift offsets" {...@@ -649,6 +649,8 @@ test "best speed shift offsets" {
649}649}
650650
651test "best speed reset" {651test "best speed reset" {
652 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
653
652 // test that encoding is consistent across a warparound of the table offset.654 // test that encoding is consistent across a warparound of the table offset.
653 // See https://github.com/golang/go/issues/34121655 // See https://github.com/golang/go/issues/34121
654 const fmt = std.fmt;656 const fmt = std.fmt;
lib/std/compress/deflate/deflate_fast_test.zig+5
...@@ -1,4 +1,5 @@...@@ -1,4 +1,5 @@
1const std = @import("std");1const std = @import("std");
2const builtin = @import("builtin");
2const expect = std.testing.expect;3const expect = std.testing.expect;
3const io = std.io;4const io = std.io;
4const mem = std.mem;5const mem = std.mem;
...@@ -11,6 +12,8 @@ const inflate = @import("decompressor.zig");...@@ -11,6 +12,8 @@ const inflate = @import("decompressor.zig");
11const deflate_const = @import("deflate_const.zig");12const deflate_const = @import("deflate_const.zig");
1213
13test "best speed" {14test "best speed" {
15 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
16
14 // Tests that round-tripping through deflate and then inflate recovers the original input.17 // Tests that round-tripping through deflate and then inflate recovers the original input.
15 // The Write sizes are near the thresholds in the compressor.encSpeed method (0, 16, 128), as well18 // The Write sizes are near the thresholds in the compressor.encSpeed method (0, 16, 128), as well
16 // as near `deflate_const.max_store_block_size` (65535).19 // as near `deflate_const.max_store_block_size` (65535).
...@@ -93,6 +96,8 @@ test "best speed" {...@@ -93,6 +96,8 @@ test "best speed" {
93}96}
9497
95test "best speed max match offset" {98test "best speed max match offset" {
99 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
100
96 const abc = "abcdefgh";101 const abc = "abcdefgh";
97 const xyz = "stuvwxyz";102 const xyz = "stuvwxyz";
98 const input_margin = 16 - 1;103 const input_margin = 16 - 1;
lib/std/compress/deflate/huffman_bit_writer.zig+6
...@@ -845,6 +845,8 @@ const testing = std.testing;...@@ -845,6 +845,8 @@ const testing = std.testing;
845const ArrayList = std.ArrayList;845const ArrayList = std.ArrayList;
846846
847test "writeBlockHuff" {847test "writeBlockHuff" {
848 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
849
848 // Tests huffman encoding against reference files to detect possible regressions.850 // Tests huffman encoding against reference files to detect possible regressions.
849 // If encoding/bit allocation changes you can regenerate these files851 // If encoding/bit allocation changes you can regenerate these files
850852
...@@ -1569,6 +1571,8 @@ const TestType = enum {...@@ -1569,6 +1571,8 @@ const TestType = enum {
1569};1571};
15701572
1571test "writeBlock" {1573test "writeBlock" {
1574 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
1575
1572 // tests if the writeBlock encoding has changed.1576 // tests if the writeBlock encoding has changed.
15731577
1574 const ttype: TestType = .write_block;1578 const ttype: TestType = .write_block;
...@@ -1584,6 +1588,8 @@ test "writeBlock" {...@@ -1584,6 +1588,8 @@ test "writeBlock" {
1584}1588}
15851589
1586test "writeBlockDynamic" {1590test "writeBlockDynamic" {
1591 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
1592
1587 // tests if the writeBlockDynamic encoding has changed.1593 // tests if the writeBlockDynamic encoding has changed.
15881594
1589 const ttype: TestType = .write_dyn_block;1595 const ttype: TestType = .write_dyn_block;
lib/std/compress/deflate/huffman_code.zig+2
...@@ -360,6 +360,8 @@ fn byFreq(context: void, a: LiteralNode, b: LiteralNode) bool {...@@ -360,6 +360,8 @@ fn byFreq(context: void, a: LiteralNode, b: LiteralNode) bool {
360}360}
361361
362test "generate a Huffman code from an array of frequencies" {362test "generate a Huffman code from an array of frequencies" {
363 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
364
363 var freqs: [19]u16 = [_]u16{365 var freqs: [19]u16 = [_]u16{
364 8, // 0366 8, // 0
365 1, // 1367 1, // 1
lib/std/compress/gzip.zig+2
...@@ -174,6 +174,8 @@ fn testReader(data: []const u8, comptime expected: []const u8) !void {...@@ -174,6 +174,8 @@ fn testReader(data: []const u8, comptime expected: []const u8) !void {
174// https://tools.ietf.org/rfc/rfc1952.txt length=25037 bytes174// https://tools.ietf.org/rfc/rfc1952.txt length=25037 bytes
175// SHA256=164ef0897b4cbec63abf1b57f069f3599bd0fb7c72c2a4dee21bd7e03ec9af67175// SHA256=164ef0897b4cbec63abf1b57f069f3599bd0fb7c72c2a4dee21bd7e03ec9af67
176test "compressed data" {176test "compressed data" {
177 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
178
177 try testReader(179 try testReader(
178 @embedFile("testdata/rfc1952.txt.gz"),180 @embedFile("testdata/rfc1952.txt.gz"),
179 @embedFile("testdata/rfc1952.txt"),181 @embedFile("testdata/rfc1952.txt"),
lib/std/compress/lzma/vec2d.zig+2
...@@ -50,6 +50,8 @@ const expectEqualSlices = std.testing.expectEqualSlices;...@@ -50,6 +50,8 @@ const expectEqualSlices = std.testing.expectEqualSlices;
50const expectError = std.testing.expectError;50const expectError = std.testing.expectError;
5151
52test "Vec2D.init" {52test "Vec2D.init" {
53 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
54
53 const allocator = testing.allocator;55 const allocator = testing.allocator;
54 var vec2d = try Vec2D(i32).init(allocator, 1, .{ 2, 3 });56 var vec2d = try Vec2D(i32).init(allocator, 1, .{ 2, 3 });
55 defer vec2d.deinit(allocator);57 defer vec2d.deinit(allocator);
lib/std/compress/xz/test.zig+2
...@@ -19,6 +19,8 @@ fn testReader(data: []const u8, comptime expected: []const u8) !void {...@@ -19,6 +19,8 @@ fn testReader(data: []const u8, comptime expected: []const u8) !void {
19}19}
2020
21test "compressed data" {21test "compressed data" {
22 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
23
22 try testReader(@embedFile("testdata/good-0-empty.xz"), "");24 try testReader(@embedFile("testdata/good-0-empty.xz"), "");
2325
24 inline for ([_][]const u8{26 inline for ([_][]const u8{
lib/std/compress/zlib.zig+4
...@@ -199,6 +199,8 @@ fn testDecompress(data: []const u8, expected: []const u8) !void {...@@ -199,6 +199,8 @@ fn testDecompress(data: []const u8, expected: []const u8) !void {
199// https://tools.ietf.org/rfc/rfc1951.txt length=36944 bytes199// https://tools.ietf.org/rfc/rfc1951.txt length=36944 bytes
200// SHA256=5ebf4b5b7fe1c3a0c0ab9aa3ac8c0f3853a7dc484905e76e03b0b0f301350009200// SHA256=5ebf4b5b7fe1c3a0c0ab9aa3ac8c0f3853a7dc484905e76e03b0b0f301350009
201test "compressed data" {201test "compressed data" {
202 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
203
202 const rfc1951_txt = @embedFile("testdata/rfc1951.txt");204 const rfc1951_txt = @embedFile("testdata/rfc1951.txt");
203205
204 // Compressed with compression level = 0206 // Compressed with compression level = 0
...@@ -264,6 +266,8 @@ test "sanity checks" {...@@ -264,6 +266,8 @@ test "sanity checks" {
264}266}
265267
266test "compress data" {268test "compress data" {
269 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
270
267 const allocator = testing.allocator;271 const allocator = testing.allocator;
268 const rfc1951_txt = @embedFile("testdata/rfc1951.txt");272 const rfc1951_txt = @embedFile("testdata/rfc1951.txt");
269273
lib/std/compress/zstandard.zig+2
...@@ -266,6 +266,8 @@ fn testReader(data: []const u8, comptime expected: []const u8) !void {...@@ -266,6 +266,8 @@ fn testReader(data: []const u8, comptime expected: []const u8) !void {
266}266}
267267
268test "zstandard decompression" {268test "zstandard decompression" {
269 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
270
269 const uncompressed = @embedFile("testdata/rfc8478.txt");271 const uncompressed = @embedFile("testdata/rfc8478.txt");
270 const compressed3 = @embedFile("testdata/rfc8478.txt.zst.3");272 const compressed3 = @embedFile("testdata/rfc8478.txt.zst.3");
271 const compressed19 = @embedFile("testdata/rfc8478.txt.zst.19");273 const compressed19 = @embedFile("testdata/rfc8478.txt.zst.19");
lib/std/crypto/poly1305.zig+2
...@@ -196,6 +196,8 @@ pub const Poly1305 = struct {...@@ -196,6 +196,8 @@ pub const Poly1305 = struct {
196};196};
197197
198test "poly1305 rfc7439 vector1" {198test "poly1305 rfc7439 vector1" {
199 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
200
199 const expected_mac = "\xa8\x06\x1d\xc1\x30\x51\x36\xc6\xc2\x2b\x8b\xaf\x0c\x01\x27\xa9";201 const expected_mac = "\xa8\x06\x1d\xc1\x30\x51\x36\xc6\xc2\x2b\x8b\xaf\x0c\x01\x27\xa9";
200202
201 const msg = "Cryptographic Forum Research Group";203 const msg = "Cryptographic Forum Research Group";
lib/std/crypto/scrypt.zig+4-1
...@@ -3,6 +3,7 @@...@@ -3,6 +3,7 @@
3// https://github.com/Tarsnap/scrypt3// https://github.com/Tarsnap/scrypt
44
5const std = @import("std");5const std = @import("std");
6const builtin = @import("builtin");
6const crypto = std.crypto;7const crypto = std.crypto;
7const fmt = std.fmt;8const fmt = std.fmt;
8const io = std.io;9const io = std.io;
...@@ -683,7 +684,7 @@ test "unix-scrypt" {...@@ -683,7 +684,7 @@ test "unix-scrypt" {
683}684}
684685
685test "crypt format" {686test "crypt format" {
686 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;687 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
687688
688 const str = "$7$C6..../....SodiumChloride$kBGj9fHznVYFQMEn/qDCfrDevf9YDtcDdKvEqHJLV8D";689 const str = "$7$C6..../....SodiumChloride$kBGj9fHznVYFQMEn/qDCfrDevf9YDtcDdKvEqHJLV8D";
689 const params = try crypt_format.deserialize(crypt_format.HashResult(32), str);690 const params = try crypt_format.deserialize(crypt_format.HashResult(32), str);
...@@ -693,6 +694,8 @@ test "crypt format" {...@@ -693,6 +694,8 @@ test "crypt format" {
693}694}
694695
695test "kdf fast" {696test "kdf fast" {
697 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
698
696 const TestVector = struct {699 const TestVector = struct {
697 password: []const u8,700 password: []const u8,
698 salt: []const u8,701 salt: []const u8,
lib/std/debug.zig+2
...@@ -2513,6 +2513,8 @@ pub fn dumpStackPointerAddr(prefix: []const u8) void {...@@ -2513,6 +2513,8 @@ pub fn dumpStackPointerAddr(prefix: []const u8) void {
2513}2513}
25142514
2515test "manage resources correctly" {2515test "manage resources correctly" {
2516 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
2517
2516 if (builtin.os.tag == .wasi) return error.SkipZigTest;2518 if (builtin.os.tag == .wasi) return error.SkipZigTest;
25172519
2518 if (builtin.os.tag == .windows) {2520 if (builtin.os.tag == .windows) {
lib/std/dwarf/expressions.zig+2
...@@ -1054,6 +1054,8 @@ fn isOpcodeRegisterLocation(opcode: u8) bool {...@@ -1054,6 +1054,8 @@ fn isOpcodeRegisterLocation(opcode: u8) bool {
10541054
1055const testing = std.testing;1055const testing = std.testing;
1056test "DWARF expressions" {1056test "DWARF expressions" {
1057 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
1058
1057 const allocator = std.testing.allocator;1059 const allocator = std.testing.allocator;
10581060
1059 const options = ExpressionOptions{};1061 const options = ExpressionOptions{};
lib/std/fifo.zig+2
...@@ -505,6 +505,8 @@ test "LinearFifo(u8, .Dynamic)" {...@@ -505,6 +505,8 @@ test "LinearFifo(u8, .Dynamic)" {
505}505}
506506
507test "LinearFifo" {507test "LinearFifo" {
508 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
509
508 inline for ([_]type{ u1, u8, u16, u64 }) |T| {510 inline for ([_]type{ u1, u8, u16, u64 }) |T| {
509 inline for ([_]LinearFifoBufferType{ LinearFifoBufferType{ .Static = 32 }, .Slice, .Dynamic }) |bt| {511 inline for ([_]LinearFifoBufferType{ LinearFifoBufferType{ .Static = 32 }, .Slice, .Dynamic }) |bt| {
510 const FifoType = LinearFifo(T, bt);512 const FifoType = LinearFifo(T, bt);
lib/std/fmt.zig+16
...@@ -2129,6 +2129,8 @@ test "int.small" {...@@ -2129,6 +2129,8 @@ test "int.small" {
2129}2129}
21302130
2131test "int.specifier" {2131test "int.specifier" {
2132 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
2133
2132 {2134 {
2133 const value: u8 = 'a';2135 const value: u8 = 'a';
2134 try expectFmt("u8: a\n", "u8: {c}\n", .{value});2136 try expectFmt("u8: a\n", "u8: {c}\n", .{value});
...@@ -2179,6 +2181,8 @@ test "int.padded" {...@@ -2179,6 +2181,8 @@ test "int.padded" {
2179}2181}
21802182
2181test "buffer" {2183test "buffer" {
2184 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
2185
2182 {2186 {
2183 var buf1: [32]u8 = undefined;2187 var buf1: [32]u8 = undefined;
2184 var fbs = std.io.fixedBufferStream(&buf1);2188 var fbs = std.io.fixedBufferStream(&buf1);
...@@ -2375,6 +2379,8 @@ test "float.scientific" {...@@ -2375,6 +2379,8 @@ test "float.scientific" {
2375}2379}
23762380
2377test "float.scientific.precision" {2381test "float.scientific.precision" {
2382 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
2383
2378 try expectFmt("f64: 1.40971e-42", "f64: {e:.5}", .{@as(f64, 1.409706e-42)});2384 try expectFmt("f64: 1.40971e-42", "f64: {e:.5}", .{@as(f64, 1.409706e-42)});
2379 try expectFmt("f64: 1.00000e-09", "f64: {e:.5}", .{@as(f64, @as(f32, @bitCast(@as(u32, 814313563))))});2385 try expectFmt("f64: 1.00000e-09", "f64: {e:.5}", .{@as(f64, @as(f32, @bitCast(@as(u32, 814313563))))});
2380 try expectFmt("f64: 7.81250e-03", "f64: {e:.5}", .{@as(f64, @as(f32, @bitCast(@as(u32, 1006632960))))});2386 try expectFmt("f64: 7.81250e-03", "f64: {e:.5}", .{@as(f64, @as(f32, @bitCast(@as(u32, 1006632960))))});
...@@ -2435,6 +2441,8 @@ test "float.hexadecimal" {...@@ -2435,6 +2441,8 @@ test "float.hexadecimal" {
2435}2441}
24362442
2437test "float.hexadecimal.precision" {2443test "float.hexadecimal.precision" {
2444 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
2445
2438 try expectFmt("f16: 0x1.5p-2", "f16: {x:.1}", .{@as(f16, 1.0 / 3.0)});2446 try expectFmt("f16: 0x1.5p-2", "f16: {x:.1}", .{@as(f16, 1.0 / 3.0)});
2439 try expectFmt("f32: 0x1.555p-2", "f32: {x:.3}", .{@as(f32, 1.0 / 3.0)});2447 try expectFmt("f32: 0x1.555p-2", "f32: {x:.3}", .{@as(f32, 1.0 / 3.0)});
2440 try expectFmt("f64: 0x1.55555p-2", "f64: {x:.5}", .{@as(f64, 1.0 / 3.0)});2448 try expectFmt("f64: 0x1.55555p-2", "f64: {x:.5}", .{@as(f64, 1.0 / 3.0)});
...@@ -2449,6 +2457,8 @@ test "float.hexadecimal.precision" {...@@ -2449,6 +2457,8 @@ test "float.hexadecimal.precision" {
2449}2457}
24502458
2451test "float.decimal" {2459test "float.decimal" {
2460 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
2461
2452 try expectFmt("f64: 152314000000000000000000000000", "f64: {d}", .{@as(f64, 1.52314e+29)});2462 try expectFmt("f64: 152314000000000000000000000000", "f64: {d}", .{@as(f64, 1.52314e+29)});
2453 try expectFmt("f32: 0", "f32: {d}", .{@as(f32, 0.0)});2463 try expectFmt("f32: 0", "f32: {d}", .{@as(f32, 0.0)});
2454 try expectFmt("f32: 0", "f32: {d:.0}", .{@as(f32, 0.0)});2464 try expectFmt("f32: 0", "f32: {d:.0}", .{@as(f32, 0.0)});
...@@ -2472,6 +2482,8 @@ test "float.decimal" {...@@ -2472,6 +2482,8 @@ test "float.decimal" {
2472}2482}
24732483
2474test "float.libc.sanity" {2484test "float.libc.sanity" {
2485 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
2486
2475 try expectFmt("f64: 0.00001", "f64: {d:.5}", .{@as(f64, @as(f32, @bitCast(@as(u32, 916964781))))});2487 try expectFmt("f64: 0.00001", "f64: {d:.5}", .{@as(f64, @as(f32, @bitCast(@as(u32, 916964781))))});
2476 try expectFmt("f64: 0.00001", "f64: {d:.5}", .{@as(f64, @as(f32, @bitCast(@as(u32, 925353389))))});2488 try expectFmt("f64: 0.00001", "f64: {d:.5}", .{@as(f64, @as(f32, @bitCast(@as(u32, 925353389))))});
2477 try expectFmt("f64: 0.10000", "f64: {d:.5}", .{@as(f64, @as(f32, @bitCast(@as(u32, 1036831278))))});2489 try expectFmt("f64: 0.10000", "f64: {d:.5}", .{@as(f64, @as(f32, @bitCast(@as(u32, 1036831278))))});
...@@ -2491,6 +2503,8 @@ test "float.libc.sanity" {...@@ -2491,6 +2503,8 @@ test "float.libc.sanity" {
2491}2503}
24922504
2493test "custom" {2505test "custom" {
2506 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
2507
2494 const Vec2 = struct {2508 const Vec2 = struct {
2495 const SelfType = @This();2509 const SelfType = @This();
2496 x: f32,2510 x: f32,
...@@ -2669,6 +2683,8 @@ test "formatFloatValue with comptime_float" {...@@ -2669,6 +2683,8 @@ test "formatFloatValue with comptime_float" {
2669}2683}
26702684
2671test "formatType max_depth" {2685test "formatType max_depth" {
2686 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
2687
2672 const Vec2 = struct {2688 const Vec2 = struct {
2673 const SelfType = @This();2689 const SelfType = @This();
2674 x: f32,2690 x: f32,
lib/std/hash/auto_hash.zig+21
...@@ -1,5 +1,6 @@...@@ -1,5 +1,6 @@
1const std = @import("std");1const std = @import("std");
2const assert = std.debug.assert;2const assert = std.debug.assert;
3const builtin = @import("builtin");
3const mem = std.mem;4const mem = std.mem;
4const meta = std.meta;5const meta = std.meta;
56
...@@ -252,6 +253,8 @@ test "typeContainsSlice" {...@@ -252,6 +253,8 @@ test "typeContainsSlice" {
252}253}
253254
254test "hash pointer" {255test "hash pointer" {
256 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
257
255 const array = [_]u32{ 123, 123, 123 };258 const array = [_]u32{ 123, 123, 123 };
256 const a = &array[0];259 const a = &array[0];
257 const b = &array[1];260 const b = &array[1];
...@@ -272,6 +275,8 @@ test "hash pointer" {...@@ -272,6 +275,8 @@ test "hash pointer" {
272}275}
273276
274test "hash slice shallow" {277test "hash slice shallow" {
278 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
279
275 // Allocate one array dynamically so that we're assured it is not merged280 // Allocate one array dynamically so that we're assured it is not merged
276 // with the other by the optimization passes.281 // with the other by the optimization passes.
277 const array1 = try std.testing.allocator.create([6]u32);282 const array1 = try std.testing.allocator.create([6]u32);
...@@ -290,6 +295,8 @@ test "hash slice shallow" {...@@ -290,6 +295,8 @@ test "hash slice shallow" {
290}295}
291296
292test "hash slice deep" {297test "hash slice deep" {
298 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
299
293 // Allocate one array dynamically so that we're assured it is not merged300 // Allocate one array dynamically so that we're assured it is not merged
294 // with the other by the optimization passes.301 // with the other by the optimization passes.
295 const array1 = try std.testing.allocator.create([6]u32);302 const array1 = try std.testing.allocator.create([6]u32);
...@@ -306,6 +313,8 @@ test "hash slice deep" {...@@ -306,6 +313,8 @@ test "hash slice deep" {
306}313}
307314
308test "hash struct deep" {315test "hash struct deep" {
316 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
317
309 const Foo = struct {318 const Foo = struct {
310 a: u32,319 a: u32,
311 b: u16,320 b: u16,
...@@ -345,6 +354,8 @@ test "hash struct deep" {...@@ -345,6 +354,8 @@ test "hash struct deep" {
345}354}
346355
347test "testHash optional" {356test "testHash optional" {
357 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
358
348 const a: ?u32 = 123;359 const a: ?u32 = 123;
349 const b: ?u32 = null;360 const b: ?u32 = null;
350 try testing.expectEqual(testHash(a), testHash(@as(u32, 123)));361 try testing.expectEqual(testHash(a), testHash(@as(u32, 123)));
...@@ -353,6 +364,8 @@ test "testHash optional" {...@@ -353,6 +364,8 @@ test "testHash optional" {
353}364}
354365
355test "testHash array" {366test "testHash array" {
367 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
368
356 const a = [_]u32{ 1, 2, 3 };369 const a = [_]u32{ 1, 2, 3 };
357 const h = testHash(a);370 const h = testHash(a);
358 var hasher = Wyhash.init(0);371 var hasher = Wyhash.init(0);
...@@ -369,6 +382,8 @@ test "testHash multi-dimensional array" {...@@ -369,6 +382,8 @@ test "testHash multi-dimensional array" {
369}382}
370383
371test "testHash struct" {384test "testHash struct" {
385 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
386
372 const Foo = struct {387 const Foo = struct {
373 a: u32 = 1,388 a: u32 = 1,
374 b: u32 = 2,389 b: u32 = 2,
...@@ -384,6 +399,8 @@ test "testHash struct" {...@@ -384,6 +399,8 @@ test "testHash struct" {
384}399}
385400
386test "testHash union" {401test "testHash union" {
402 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
403
387 const Foo = union(enum) {404 const Foo = union(enum) {
388 A: u32,405 A: u32,
389 B: bool,406 B: bool,
...@@ -408,6 +425,8 @@ test "testHash union" {...@@ -408,6 +425,8 @@ test "testHash union" {
408}425}
409426
410test "testHash vector" {427test "testHash vector" {
428 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
429
411 const a: @Vector(4, u32) = [_]u32{ 1, 2, 3, 4 };430 const a: @Vector(4, u32) = [_]u32{ 1, 2, 3, 4 };
412 const b: @Vector(4, u32) = [_]u32{ 1, 2, 3, 5 };431 const b: @Vector(4, u32) = [_]u32{ 1, 2, 3, 5 };
413 try testing.expect(testHash(a) == testHash(a));432 try testing.expect(testHash(a) == testHash(a));
...@@ -420,6 +439,8 @@ test "testHash vector" {...@@ -420,6 +439,8 @@ test "testHash vector" {
420}439}
421440
422test "testHash error union" {441test "testHash error union" {
442 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
443
423 const Errors = error{Test};444 const Errors = error{Test};
424 const Foo = struct {445 const Foo = struct {
425 a: u32 = 1,446 a: u32 = 1,
lib/std/hash/wyhash.zig+2
...@@ -242,6 +242,8 @@ test "smhasher" {...@@ -242,6 +242,8 @@ test "smhasher" {
242}242}
243243
244test "iterative api" {244test "iterative api" {
245 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
246
245 const Test = struct {247 const Test = struct {
246 fn do() !void {248 fn do() !void {
247 try verify.iterativeApi(Wyhash);249 try verify.iterativeApi(Wyhash);
lib/std/hash_map.zig+2
...@@ -1872,6 +1872,8 @@ test "std.hash_map multiple removes on same metadata" {...@@ -1872,6 +1872,8 @@ test "std.hash_map multiple removes on same metadata" {
1872}1872}
18731873
1874test "std.hash_map put and remove loop in random order" {1874test "std.hash_map put and remove loop in random order" {
1875 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
1876
1875 var map = AutoHashMap(u32, u32).init(std.testing.allocator);1877 var map = AutoHashMap(u32, u32).init(std.testing.allocator);
1876 defer map.deinit();1878 defer map.deinit();
18771879
lib/std/heap/general_purpose_allocator.zig+4
...@@ -1042,6 +1042,8 @@ const TraceKind = enum {...@@ -1042,6 +1042,8 @@ const TraceKind = enum {
1042const test_config = Config{};1042const test_config = Config{};
10431043
1044test "small allocations - free in same order" {1044test "small allocations - free in same order" {
1045 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
1046
1045 var gpa = GeneralPurposeAllocator(test_config){};1047 var gpa = GeneralPurposeAllocator(test_config){};
1046 defer std.testing.expect(gpa.deinit() == .ok) catch @panic("leak");1048 defer std.testing.expect(gpa.deinit() == .ok) catch @panic("leak");
1047 const allocator = gpa.allocator();1049 const allocator = gpa.allocator();
...@@ -1061,6 +1063,8 @@ test "small allocations - free in same order" {...@@ -1061,6 +1063,8 @@ test "small allocations - free in same order" {
1061}1063}
10621064
1063test "small allocations - free in reverse order" {1065test "small allocations - free in reverse order" {
1066 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
1067
1064 var gpa = GeneralPurposeAllocator(test_config){};1068 var gpa = GeneralPurposeAllocator(test_config){};
1065 defer std.testing.expect(gpa.deinit() == .ok) catch @panic("leak");1069 defer std.testing.expect(gpa.deinit() == .ok) catch @panic("leak");
1066 const allocator = gpa.allocator();1070 const allocator = gpa.allocator();
lib/std/io/bit_reader.zig+2
...@@ -164,6 +164,8 @@ pub fn bitReader(...@@ -164,6 +164,8 @@ pub fn bitReader(
164}164}
165165
166test "api coverage" {166test "api coverage" {
167 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
168
167 const mem_be = [_]u8{ 0b11001101, 0b00001011 };169 const mem_be = [_]u8{ 0b11001101, 0b00001011 };
168 const mem_le = [_]u8{ 0b00011101, 0b10010101 };170 const mem_le = [_]u8{ 0b00011101, 0b10010101 };
169171
lib/std/json.zig+5-1
...@@ -38,12 +38,16 @@ test parseFromSlice {...@@ -38,12 +38,16 @@ test parseFromSlice {
38}38}
3939
40test Value {40test Value {
41 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
42
41 var parsed = try parseFromSlice(Value, testing.allocator, "{\"anything\": \"goes\"}", .{});43 var parsed = try parseFromSlice(Value, testing.allocator, "{\"anything\": \"goes\"}", .{});
42 defer parsed.deinit();44 defer parsed.deinit();
43 try testing.expectEqualSlices(u8, "goes", parsed.value.object.get("anything").?.string);45 try testing.expectEqualSlices(u8, "goes", parsed.value.object.get("anything").?.string);
44}46}
4547
46test writeStream {48test writeStream {
49 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
50
47 var out = ArrayList(u8).init(testing.allocator);51 var out = ArrayList(u8).init(testing.allocator);
48 defer out.deinit();52 defer out.deinit();
49 var write_stream = writeStream(out.writer(), .{ .whitespace = .indent_2 });53 var write_stream = writeStream(out.writer(), .{ .whitespace = .indent_2 });
...@@ -61,7 +65,7 @@ test writeStream {...@@ -61,7 +65,7 @@ test writeStream {
61}65}
6266
63test stringify {67test stringify {
64 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;68 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
6569
66 var out = ArrayList(u8).init(testing.allocator);70 var out = ArrayList(u8).init(testing.allocator);
67 defer out.deinit();71 defer out.deinit();
lib/std/json/JSONTestSuite_test.zig+72
...@@ -104,6 +104,8 @@ test "i_string_utf16LE_no_BOM.json" {...@@ -104,6 +104,8 @@ test "i_string_utf16LE_no_BOM.json" {
104 try any("[\x00\"\x00\xe9\x00\"\x00]\x00");104 try any("[\x00\"\x00\xe9\x00\"\x00]\x00");
105}105}
106test "i_structure_500_nested_arrays.json" {106test "i_structure_500_nested_arrays.json" {
107 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
108
107 try any("[" ** 500 ++ "]" ** 500);109 try any("[" ** 500 ++ "]" ** 500);
108}110}
109test "i_structure_UTF-8_BOM_empty_object.json" {111test "i_structure_UTF-8_BOM_empty_object.json" {
...@@ -359,15 +361,21 @@ test "n_object_bracket_key.json" {...@@ -359,15 +361,21 @@ test "n_object_bracket_key.json" {
359 try err("{[: \"x\"}\n");361 try err("{[: \"x\"}\n");
360}362}
361test "n_object_comma_instead_of_colon.json" {363test "n_object_comma_instead_of_colon.json" {
364 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
365
362 try err("{\"x\", null}");366 try err("{\"x\", null}");
363}367}
364test "n_object_double_colon.json" {368test "n_object_double_colon.json" {
369 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
370
365 try err("{\"x\"::\"b\"}");371 try err("{\"x\"::\"b\"}");
366}372}
367test "n_object_emoji.json" {373test "n_object_emoji.json" {
368 try err("{\xf0\x9f\x87\xa8\xf0\x9f\x87\xad}");374 try err("{\xf0\x9f\x87\xa8\xf0\x9f\x87\xad}");
369}375}
370test "n_object_garbage_at_end.json" {376test "n_object_garbage_at_end.json" {
377 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
378
371 try err("{\"a\":\"a\" 123}");379 try err("{\"a\":\"a\" 123}");
372}380}
373test "n_object_key_with_single_quotes.json" {381test "n_object_key_with_single_quotes.json" {
...@@ -377,18 +385,26 @@ test "n_object_lone_continuation_byte_in_key_and_trailing_comma.json" {...@@ -377,18 +385,26 @@ test "n_object_lone_continuation_byte_in_key_and_trailing_comma.json" {
377 try err("{\"\xb9\":\"0\",}");385 try err("{\"\xb9\":\"0\",}");
378}386}
379test "n_object_missing_colon.json" {387test "n_object_missing_colon.json" {
388 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
389
380 try err("{\"a\" b}");390 try err("{\"a\" b}");
381}391}
382test "n_object_missing_key.json" {392test "n_object_missing_key.json" {
383 try err("{:\"b\"}");393 try err("{:\"b\"}");
384}394}
385test "n_object_missing_semicolon.json" {395test "n_object_missing_semicolon.json" {
396 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
397
386 try err("{\"a\" \"b\"}");398 try err("{\"a\" \"b\"}");
387}399}
388test "n_object_missing_value.json" {400test "n_object_missing_value.json" {
401 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
402
389 try err("{\"a\":");403 try err("{\"a\":");
390}404}
391test "n_object_no-colon.json" {405test "n_object_no-colon.json" {
406 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
407
392 try err("{\"a\"");408 try err("{\"a\"");
393}409}
394test "n_object_non_string_key.json" {410test "n_object_non_string_key.json" {
...@@ -401,39 +417,59 @@ test "n_object_repeated_null_null.json" {...@@ -401,39 +417,59 @@ test "n_object_repeated_null_null.json" {
401 try err("{null:null,null:null}");417 try err("{null:null,null:null}");
402}418}
403test "n_object_several_trailing_commas.json" {419test "n_object_several_trailing_commas.json" {
420 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
421
404 try err("{\"id\":0,,,,,}");422 try err("{\"id\":0,,,,,}");
405}423}
406test "n_object_single_quote.json" {424test "n_object_single_quote.json" {
407 try err("{'a':0}");425 try err("{'a':0}");
408}426}
409test "n_object_trailing_comma.json" {427test "n_object_trailing_comma.json" {
428 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
429
410 try err("{\"id\":0,}");430 try err("{\"id\":0,}");
411}431}
412test "n_object_trailing_comment.json" {432test "n_object_trailing_comment.json" {
433 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
434
413 try err("{\"a\":\"b\"}/**/");435 try err("{\"a\":\"b\"}/**/");
414}436}
415test "n_object_trailing_comment_open.json" {437test "n_object_trailing_comment_open.json" {
438 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
439
416 try err("{\"a\":\"b\"}/**//");440 try err("{\"a\":\"b\"}/**//");
417}441}
418test "n_object_trailing_comment_slash_open.json" {442test "n_object_trailing_comment_slash_open.json" {
443 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
444
419 try err("{\"a\":\"b\"}//");445 try err("{\"a\":\"b\"}//");
420}446}
421test "n_object_trailing_comment_slash_open_incomplete.json" {447test "n_object_trailing_comment_slash_open_incomplete.json" {
448 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
449
422 try err("{\"a\":\"b\"}/");450 try err("{\"a\":\"b\"}/");
423}451}
424test "n_object_two_commas_in_a_row.json" {452test "n_object_two_commas_in_a_row.json" {
453 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
454
425 try err("{\"a\":\"b\",,\"c\":\"d\"}");455 try err("{\"a\":\"b\",,\"c\":\"d\"}");
426}456}
427test "n_object_unquoted_key.json" {457test "n_object_unquoted_key.json" {
428 try err("{a: \"b\"}");458 try err("{a: \"b\"}");
429}459}
430test "n_object_unterminated-value.json" {460test "n_object_unterminated-value.json" {
461 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
462
431 try err("{\"a\":\"a");463 try err("{\"a\":\"a");
432}464}
433test "n_object_with_single_string.json" {465test "n_object_with_single_string.json" {
466 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
467
434 try err("{ \"foo\" : \"bar\", \"a\" }");468 try err("{ \"foo\" : \"bar\", \"a\" }");
435}469}
436test "n_object_with_trailing_garbage.json" {470test "n_object_with_trailing_garbage.json" {
471 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
472
437 try err("{\"a\":\"b\"}#");473 try err("{\"a\":\"b\"}#");
438}474}
439test "n_single_space.json" {475test "n_single_space.json" {
...@@ -560,6 +596,8 @@ test "n_structure_close_unopened_array.json" {...@@ -560,6 +596,8 @@ test "n_structure_close_unopened_array.json" {
560 try err("1]");596 try err("1]");
561}597}
562test "n_structure_comma_instead_of_closing_brace.json" {598test "n_structure_comma_instead_of_closing_brace.json" {
599 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
600
563 try err("{\"x\": true,");601 try err("{\"x\": true,");
564}602}
565test "n_structure_double_array.json" {603test "n_structure_double_array.json" {
...@@ -590,12 +628,18 @@ test "n_structure_object_followed_by_closing_object.json" {...@@ -590,12 +628,18 @@ test "n_structure_object_followed_by_closing_object.json" {
590 try err("{}}");628 try err("{}}");
591}629}
592test "n_structure_object_unclosed_no_value.json" {630test "n_structure_object_unclosed_no_value.json" {
631 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
632
593 try err("{\"\":");633 try err("{\"\":");
594}634}
595test "n_structure_object_with_comment.json" {635test "n_structure_object_with_comment.json" {
636 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
637
596 try err("{\"a\":/*comment*/\"b\"}");638 try err("{\"a\":/*comment*/\"b\"}");
597}639}
598test "n_structure_object_with_trailing_garbage.json" {640test "n_structure_object_with_trailing_garbage.json" {
641 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
642
599 try err("{\"a\": true} \"x\"");643 try err("{\"a\": true} \"x\"");
600}644}
601test "n_structure_open_array_apostrophe.json" {645test "n_structure_open_array_apostrophe.json" {
...@@ -605,6 +649,8 @@ test "n_structure_open_array_comma.json" {...@@ -605,6 +649,8 @@ test "n_structure_open_array_comma.json" {
605 try err("[,");649 try err("[,");
606}650}
607test "n_structure_open_array_object.json" {651test "n_structure_open_array_object.json" {
652 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
653
608 try err("[{\"\":" ** 50000 ++ "\n");654 try err("[{\"\":" ** 50000 ++ "\n");
609}655}
610test "n_structure_open_array_open_object.json" {656test "n_structure_open_array_open_object.json" {
...@@ -644,6 +690,8 @@ test "n_structure_single_star.json" {...@@ -644,6 +690,8 @@ test "n_structure_single_star.json" {
644 try err("*");690 try err("*");
645}691}
646test "n_structure_trailing_#.json" {692test "n_structure_trailing_#.json" {
693 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
694
647 try err("{\"a\":\"b\"}#{}");695 try err("{\"a\":\"b\"}#{}");
648}696}
649test "n_structure_uescaped_LF_before_string.json" {697test "n_structure_uescaped_LF_before_string.json" {
...@@ -662,6 +710,8 @@ test "n_structure_unclosed_array_unfinished_true.json" {...@@ -662,6 +710,8 @@ test "n_structure_unclosed_array_unfinished_true.json" {
662 try err("[ false, tru");710 try err("[ false, tru");
663}711}
664test "n_structure_unclosed_object.json" {712test "n_structure_unclosed_object.json" {
713 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
714
665 try err("{\"asd\":\"asd\"");715 try err("{\"asd\":\"asd\"");
666}716}
667test "n_structure_unicode-identifier.json" {717test "n_structure_unicode-identifier.json" {
...@@ -764,39 +814,61 @@ test "y_number_simple_real.json" {...@@ -764,39 +814,61 @@ test "y_number_simple_real.json" {
764 try ok("[123.456789]");814 try ok("[123.456789]");
765}815}
766test "y_object.json" {816test "y_object.json" {
817 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
818
767 try ok("{\"asd\":\"sdf\", \"dfg\":\"fgh\"}");819 try ok("{\"asd\":\"sdf\", \"dfg\":\"fgh\"}");
768}820}
769test "y_object_basic.json" {821test "y_object_basic.json" {
822 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
823
770 try ok("{\"asd\":\"sdf\"}");824 try ok("{\"asd\":\"sdf\"}");
771}825}
772test "y_object_duplicated_key.json" {826test "y_object_duplicated_key.json" {
827 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
828
773 try ok("{\"a\":\"b\",\"a\":\"c\"}");829 try ok("{\"a\":\"b\",\"a\":\"c\"}");
774}830}
775test "y_object_duplicated_key_and_value.json" {831test "y_object_duplicated_key_and_value.json" {
832 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
833
776 try ok("{\"a\":\"b\",\"a\":\"b\"}");834 try ok("{\"a\":\"b\",\"a\":\"b\"}");
777}835}
778test "y_object_empty.json" {836test "y_object_empty.json" {
779 try ok("{}");837 try ok("{}");
780}838}
781test "y_object_empty_key.json" {839test "y_object_empty_key.json" {
840 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
841
782 try ok("{\"\":0}");842 try ok("{\"\":0}");
783}843}
784test "y_object_escaped_null_in_key.json" {844test "y_object_escaped_null_in_key.json" {
845 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
846
785 try ok("{\"foo\\u0000bar\": 42}");847 try ok("{\"foo\\u0000bar\": 42}");
786}848}
787test "y_object_extreme_numbers.json" {849test "y_object_extreme_numbers.json" {
850 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
851
788 try ok("{ \"min\": -1.0e+28, \"max\": 1.0e+28 }");852 try ok("{ \"min\": -1.0e+28, \"max\": 1.0e+28 }");
789}853}
790test "y_object_long_strings.json" {854test "y_object_long_strings.json" {
855 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
856
791 try ok("{\"x\":[{\"id\": \"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"}], \"id\": \"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"}");857 try ok("{\"x\":[{\"id\": \"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"}], \"id\": \"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"}");
792}858}
793test "y_object_simple.json" {859test "y_object_simple.json" {
860 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
861
794 try ok("{\"a\":[]}");862 try ok("{\"a\":[]}");
795}863}
796test "y_object_string_unicode.json" {864test "y_object_string_unicode.json" {
865 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
866
797 try ok("{\"title\":\"\\u041f\\u043e\\u043b\\u0442\\u043e\\u0440\\u0430 \\u0417\\u0435\\u043c\\u043b\\u0435\\u043a\\u043e\\u043f\\u0430\" }");867 try ok("{\"title\":\"\\u041f\\u043e\\u043b\\u0442\\u043e\\u0440\\u0430 \\u0417\\u0435\\u043c\\u043b\\u0435\\u043a\\u043e\\u043f\\u0430\" }");
798}868}
799test "y_object_with_newlines.json" {869test "y_object_with_newlines.json" {
870 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
871
800 try ok("{\n\"a\": \"b\"\n}");872 try ok("{\n\"a\": \"b\"\n}");
801}873}
802test "y_string_1_2_3_bytes_UTF-8_sequences.json" {874test "y_string_1_2_3_bytes_UTF-8_sequences.json" {
lib/std/json/test.zig+4-1
...@@ -1,4 +1,5 @@...@@ -1,4 +1,5 @@
1const std = @import("std");1const std = @import("std");
2const builtin = @import("builtin");
2const testing = std.testing;3const testing = std.testing;
3const parseFromSlice = @import("./static.zig").parseFromSlice;4const parseFromSlice = @import("./static.zig").parseFromSlice;
4const validate = @import("./scanner.zig").validate;5const validate = @import("./scanner.zig").validate;
...@@ -34,13 +35,15 @@ fn testHighLevelDynamicParser(s: []const u8) !void {...@@ -34,13 +35,15 @@ fn testHighLevelDynamicParser(s: []const u8) !void {
3435
35// Additional tests not part of test JSONTestSuite.36// Additional tests not part of test JSONTestSuite.
36test "y_trailing_comma_after_empty" {37test "y_trailing_comma_after_empty" {
37 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;38 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
3839
39 try roundTrip(40 try roundTrip(
40 \\{"1":[],"2":{},"3":"4"}41 \\{"1":[],"2":{},"3":"4"}
41 );42 );
42}43}
43test "n_object_closed_missing_value" {44test "n_object_closed_missing_value" {
45 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
46
44 try err(47 try err(
45 \\{"a":}48 \\{"a":}
46 );49 );
lib/std/leb128.zig+4
...@@ -215,6 +215,8 @@ fn test_read_uleb128_seq(comptime T: type, comptime N: usize, encoded: []const u...@@ -215,6 +215,8 @@ fn test_read_uleb128_seq(comptime T: type, comptime N: usize, encoded: []const u
215}215}
216216
217test "deserialize signed LEB128" {217test "deserialize signed LEB128" {
218 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
219
218 // Truncated220 // Truncated
219 try testing.expectError(error.EndOfStream, test_read_stream_ileb128(i64, "\x80"));221 try testing.expectError(error.EndOfStream, test_read_stream_ileb128(i64, "\x80"));
220222
...@@ -361,6 +363,8 @@ test "serialize unsigned LEB128" {...@@ -361,6 +363,8 @@ test "serialize unsigned LEB128" {
361}363}
362364
363test "serialize signed LEB128" {365test "serialize signed LEB128" {
366 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
367
364 // explicitly test i0 because starting `t` at 0368 // explicitly test i0 because starting `t` at 0
365 // will break the while loop369 // will break the while loop
366 try test_write_leb128(@as(i0, 0));370 try test_write_leb128(@as(i0, 0));
lib/std/math/big/int_test.zig+122-8
...@@ -71,6 +71,8 @@ test "big.int set negative minimum" {...@@ -71,6 +71,8 @@ test "big.int set negative minimum" {
71}71}
7272
73test "big.int set double-width maximum then zero" {73test "big.int set double-width maximum then zero" {
74 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
75
74 var a = try Managed.initSet(testing.allocator, maxInt(DoubleLimb));76 var a = try Managed.initSet(testing.allocator, maxInt(DoubleLimb));
75 defer a.deinit();77 defer a.deinit();
76 try a.set(@as(DoubleLimb, 0));78 try a.set(@as(DoubleLimb, 0));
...@@ -244,6 +246,8 @@ test "big.int fits" {...@@ -244,6 +246,8 @@ test "big.int fits" {
244}246}
245247
246test "big.int string set" {248test "big.int string set" {
249 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
250
247 var a = try Managed.init(testing.allocator);251 var a = try Managed.init(testing.allocator);
248 defer a.deinit();252 defer a.deinit();
249253
...@@ -260,6 +264,8 @@ test "big.int string negative" {...@@ -260,6 +264,8 @@ test "big.int string negative" {
260}264}
261265
262test "big.int string set number with underscores" {266test "big.int string set number with underscores" {
267 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
268
263 var a = try Managed.init(testing.allocator);269 var a = try Managed.init(testing.allocator);
264 defer a.deinit();270 defer a.deinit();
265271
...@@ -268,6 +274,8 @@ test "big.int string set number with underscores" {...@@ -268,6 +274,8 @@ test "big.int string set number with underscores" {
268}274}
269275
270test "big.int string set case insensitive number" {276test "big.int string set case insensitive number" {
277 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
278
271 var a = try Managed.init(testing.allocator);279 var a = try Managed.init(testing.allocator);
272 defer a.deinit();280 defer a.deinit();
273281
...@@ -318,6 +326,8 @@ test "big.int twos complement limit set" {...@@ -318,6 +326,8 @@ test "big.int twos complement limit set" {
318}326}
319327
320test "big.int string to" {328test "big.int string to" {
329 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
330
321 var a = try Managed.initSet(testing.allocator, 120317241209124781241290847124);331 var a = try Managed.initSet(testing.allocator, 120317241209124781241290847124);
322 defer a.deinit();332 defer a.deinit();
323333
...@@ -358,6 +368,8 @@ test "big.int string to base 16" {...@@ -358,6 +368,8 @@ test "big.int string to base 16" {
358}368}
359369
360test "big.int neg string to" {370test "big.int neg string to" {
371 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
372
361 var a = try Managed.initSet(testing.allocator, -123907434);373 var a = try Managed.initSet(testing.allocator, -123907434);
362 defer a.deinit();374 defer a.deinit();
363375
...@@ -380,6 +392,8 @@ test "big.int zero string to" {...@@ -380,6 +392,8 @@ test "big.int zero string to" {
380}392}
381393
382test "big.int clone" {394test "big.int clone" {
395 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
396
383 var a = try Managed.initSet(testing.allocator, 1234);397 var a = try Managed.initSet(testing.allocator, 1234);
384 defer a.deinit();398 defer a.deinit();
385 var b = try a.clone();399 var b = try a.clone();
...@@ -517,6 +531,8 @@ test "big.int add multi-single" {...@@ -517,6 +531,8 @@ test "big.int add multi-single" {
517}531}
518532
519test "big.int add multi-multi" {533test "big.int add multi-multi" {
534 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
535
520 var op1: u128 = 0xefefefef7f7f7f7f;536 var op1: u128 = 0xefefefef7f7f7f7f;
521 var op2: u128 = 0xfefefefe9f9f9f9f;537 var op2: u128 = 0xfefefefe9f9f9f9f;
522 var a = try Managed.initSet(testing.allocator, op1);538 var a = try Managed.initSet(testing.allocator, op1);
...@@ -618,6 +634,8 @@ test "big.int addWrap single-single, unsigned" {...@@ -618,6 +634,8 @@ test "big.int addWrap single-single, unsigned" {
618}634}
619635
620test "big.int subWrap single-single, unsigned" {636test "big.int subWrap single-single, unsigned" {
637 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
638
621 var a = try Managed.initSet(testing.allocator, 0);639 var a = try Managed.initSet(testing.allocator, 0);
622 defer a.deinit();640 defer a.deinit();
623641
...@@ -631,6 +649,8 @@ test "big.int subWrap single-single, unsigned" {...@@ -631,6 +649,8 @@ test "big.int subWrap single-single, unsigned" {
631}649}
632650
633test "big.int addWrap multi-multi, unsigned, limb aligned" {651test "big.int addWrap multi-multi, unsigned, limb aligned" {
652 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
653
634 var a = try Managed.initSet(testing.allocator, maxInt(DoubleLimb));654 var a = try Managed.initSet(testing.allocator, maxInt(DoubleLimb));
635 defer a.deinit();655 defer a.deinit();
636656
...@@ -683,6 +703,8 @@ test "big.int subWrap single-single, signed" {...@@ -683,6 +703,8 @@ test "big.int subWrap single-single, signed" {
683}703}
684704
685test "big.int addWrap multi-multi, signed, limb aligned" {705test "big.int addWrap multi-multi, signed, limb aligned" {
706 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
707
686 var a = try Managed.initSet(testing.allocator, maxInt(SignedDoubleLimb));708 var a = try Managed.initSet(testing.allocator, maxInt(SignedDoubleLimb));
687 defer a.deinit();709 defer a.deinit();
688710
...@@ -733,6 +755,8 @@ test "big.int subSat single-single, unsigned" {...@@ -733,6 +755,8 @@ test "big.int subSat single-single, unsigned" {
733}755}
734756
735test "big.int addSat multi-multi, unsigned, limb aligned" {757test "big.int addSat multi-multi, unsigned, limb aligned" {
758 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
759
736 var a = try Managed.initSet(testing.allocator, maxInt(DoubleLimb));760 var a = try Managed.initSet(testing.allocator, maxInt(DoubleLimb));
737 defer a.deinit();761 defer a.deinit();
738762
...@@ -818,6 +842,8 @@ test "big.int sub single-single" {...@@ -818,6 +842,8 @@ test "big.int sub single-single" {
818}842}
819843
820test "big.int sub multi-single" {844test "big.int sub multi-single" {
845 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
846
821 var a = try Managed.initSet(testing.allocator, maxInt(Limb) + 1);847 var a = try Managed.initSet(testing.allocator, maxInt(Limb) + 1);
822 defer a.deinit();848 defer a.deinit();
823 var b = try Managed.initSet(testing.allocator, 1);849 var b = try Managed.initSet(testing.allocator, 1);
...@@ -831,6 +857,8 @@ test "big.int sub multi-single" {...@@ -831,6 +857,8 @@ test "big.int sub multi-single" {
831}857}
832858
833test "big.int sub multi-multi" {859test "big.int sub multi-multi" {
860 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
861
834 var op1: u128 = 0xefefefefefefefefefefefef;862 var op1: u128 = 0xefefefefefefefefefefefef;
835 var op2: u128 = 0xabababababababababababab;863 var op2: u128 = 0xabababababababababababab;
836864
...@@ -935,6 +963,8 @@ test "big.int mul multi-multi" {...@@ -935,6 +963,8 @@ test "big.int mul multi-multi" {
935}963}
936964
937test "big.int mul alias r with a" {965test "big.int mul alias r with a" {
966 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
967
938 var a = try Managed.initSet(testing.allocator, maxInt(Limb));968 var a = try Managed.initSet(testing.allocator, maxInt(Limb));
939 defer a.deinit();969 defer a.deinit();
940 var b = try Managed.initSet(testing.allocator, 2);970 var b = try Managed.initSet(testing.allocator, 2);
...@@ -946,6 +976,8 @@ test "big.int mul alias r with a" {...@@ -946,6 +976,8 @@ test "big.int mul alias r with a" {
946}976}
947977
948test "big.int mul alias r with b" {978test "big.int mul alias r with b" {
979 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
980
949 var a = try Managed.initSet(testing.allocator, maxInt(Limb));981 var a = try Managed.initSet(testing.allocator, maxInt(Limb));
950 defer a.deinit();982 defer a.deinit();
951 var b = try Managed.initSet(testing.allocator, 2);983 var b = try Managed.initSet(testing.allocator, 2);
...@@ -957,6 +989,8 @@ test "big.int mul alias r with b" {...@@ -957,6 +989,8 @@ test "big.int mul alias r with b" {
957}989}
958990
959test "big.int mul alias r with a and b" {991test "big.int mul alias r with a and b" {
992 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
993
960 var a = try Managed.initSet(testing.allocator, maxInt(Limb));994 var a = try Managed.initSet(testing.allocator, maxInt(Limb));
961 defer a.deinit();995 defer a.deinit();
962996
...@@ -992,6 +1026,8 @@ test "big.int mul 0*0" {...@@ -992,6 +1026,8 @@ test "big.int mul 0*0" {
992}1026}
9931027
994test "big.int mul large" {1028test "big.int mul large" {
1029 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
1030
995 var a = try Managed.initCapacity(testing.allocator, 50);1031 var a = try Managed.initCapacity(testing.allocator, 50);
996 defer a.deinit();1032 defer a.deinit();
997 var b = try Managed.initCapacity(testing.allocator, 100);1033 var b = try Managed.initCapacity(testing.allocator, 100);
...@@ -1077,6 +1113,8 @@ test "big.int mulWrap multi-multi signed" {...@@ -1077,6 +1113,8 @@ test "big.int mulWrap multi-multi signed" {
1077}1113}
10781114
1079test "big.int mulWrap large" {1115test "big.int mulWrap large" {
1116 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
1117
1080 var a = try Managed.initCapacity(testing.allocator, 50);1118 var a = try Managed.initCapacity(testing.allocator, 50);
1081 defer a.deinit();1119 defer a.deinit();
1082 var b = try Managed.initCapacity(testing.allocator, 100);1120 var b = try Managed.initCapacity(testing.allocator, 100);
...@@ -1133,6 +1171,8 @@ test "big.int div single-half with rem" {...@@ -1133,6 +1171,8 @@ test "big.int div single-half with rem" {
1133}1171}
11341172
1135test "big.int div single-single no rem" {1173test "big.int div single-single no rem" {
1174 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
1175
1136 // assumes usize is <= 64 bits.1176 // assumes usize is <= 64 bits.
1137 var a = try Managed.initSet(testing.allocator, 1 << 52);1177 var a = try Managed.initSet(testing.allocator, 1 << 52);
1138 defer a.deinit();1178 defer a.deinit();
...@@ -1150,6 +1190,8 @@ test "big.int div single-single no rem" {...@@ -1150,6 +1190,8 @@ test "big.int div single-single no rem" {
1150}1190}
11511191
1152test "big.int div single-single with rem" {1192test "big.int div single-single with rem" {
1193 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
1194
1153 var a = try Managed.initSet(testing.allocator, (1 << 52) | (1 << 33));1195 var a = try Managed.initSet(testing.allocator, (1 << 52) | (1 << 33));
1154 defer a.deinit();1196 defer a.deinit();
1155 var b = try Managed.initSet(testing.allocator, (1 << 35));1197 var b = try Managed.initSet(testing.allocator, (1 << 35));
...@@ -1166,6 +1208,8 @@ test "big.int div single-single with rem" {...@@ -1166,6 +1208,8 @@ test "big.int div single-single with rem" {
1166}1208}
11671209
1168test "big.int div multi-single no rem" {1210test "big.int div multi-single no rem" {
1211 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
1212
1169 var op1: u128 = 0xffffeeeeddddcccc;1213 var op1: u128 = 0xffffeeeeddddcccc;
1170 var op2: u128 = 34;1214 var op2: u128 = 34;
11711215
...@@ -1185,6 +1229,8 @@ test "big.int div multi-single no rem" {...@@ -1185,6 +1229,8 @@ test "big.int div multi-single no rem" {
1185}1229}
11861230
1187test "big.int div multi-single with rem" {1231test "big.int div multi-single with rem" {
1232 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
1233
1188 var op1: u128 = 0xffffeeeeddddcccf;1234 var op1: u128 = 0xffffeeeeddddcccf;
1189 var op2: u128 = 34;1235 var op2: u128 = 34;
11901236
...@@ -1204,6 +1250,8 @@ test "big.int div multi-single with rem" {...@@ -1204,6 +1250,8 @@ test "big.int div multi-single with rem" {
1204}1250}
12051251
1206test "big.int div multi>2-single" {1252test "big.int div multi>2-single" {
1253 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
1254
1207 var op1: u128 = 0xfefefefefefefefefefefefefefefefe;1255 var op1: u128 = 0xfefefefefefefefefefefefefefefefe;
1208 var op2: u128 = 0xefab8;1256 var op2: u128 = 0xefab8;
12091257
...@@ -1223,6 +1271,8 @@ test "big.int div multi>2-single" {...@@ -1223,6 +1271,8 @@ test "big.int div multi>2-single" {
1223}1271}
12241272
1225test "big.int div single-single q < r" {1273test "big.int div single-single q < r" {
1274 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
1275
1226 var a = try Managed.initSet(testing.allocator, 0x0078f432);1276 var a = try Managed.initSet(testing.allocator, 0x0078f432);
1227 defer a.deinit();1277 defer a.deinit();
1228 var b = try Managed.initSet(testing.allocator, 0x01000000);1278 var b = try Managed.initSet(testing.allocator, 0x01000000);
...@@ -1267,7 +1317,10 @@ test "big.int div q=0 alias" {...@@ -1267,7 +1317,10 @@ test "big.int div q=0 alias" {
1267}1317}
12681318
1269test "big.int div multi-multi q < r" {1319test "big.int div multi-multi q < r" {
1270 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;1320 switch (builtin.zig_backend) {
1321 .stage2_c, .stage2_x86_64 => return error.SkipZigTest,
1322 else => {},
1323 }
12711324
1272 const op1 = 0x1ffffffff0078f432;1325 const op1 = 0x1ffffffff0078f432;
1273 const op2 = 0x1ffffffff01000000;1326 const op2 = 0x1ffffffff01000000;
...@@ -1398,6 +1451,8 @@ test "big.int divTrunc #15535" {...@@ -1398,6 +1451,8 @@ test "big.int divTrunc #15535" {
1398}1451}
13991452
1400test "big.int divFloor #10932" {1453test "big.int divFloor #10932" {
1454 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
1455
1401 var a = try Managed.init(testing.allocator);1456 var a = try Managed.init(testing.allocator);
1402 defer a.deinit();1457 defer a.deinit();
14031458
...@@ -1422,6 +1477,8 @@ test "big.int divFloor #10932" {...@@ -1422,6 +1477,8 @@ test "big.int divFloor #10932" {
1422}1477}
14231478
1424test "big.int divFloor #11166" {1479test "big.int divFloor #11166" {
1480 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
1481
1425 var a = try Managed.init(testing.allocator);1482 var a = try Managed.init(testing.allocator);
1426 defer a.deinit();1483 defer a.deinit();
14271484
...@@ -1585,6 +1642,8 @@ test "big.int div floor single-single -/-" {...@@ -1585,6 +1642,8 @@ test "big.int div floor single-single -/-" {
1585}1642}
15861643
1587test "big.int div floor no remainder negative quotient" {1644test "big.int div floor no remainder negative quotient" {
1645 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
1646
1588 const u: i32 = -0x80000000;1647 const u: i32 = -0x80000000;
1589 const v: i32 = 1;1648 const v: i32 = 1;
15901649
...@@ -1642,7 +1701,10 @@ test "big.int div floor positive close to zero" {...@@ -1642,7 +1701,10 @@ test "big.int div floor positive close to zero" {
1642}1701}
16431702
1644test "big.int div multi-multi with rem" {1703test "big.int div multi-multi with rem" {
1645 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;1704 switch (builtin.zig_backend) {
1705 .stage2_c, .stage2_x86_64 => return error.SkipZigTest,
1706 else => {},
1707 }
16461708
1647 var a = try Managed.initSet(testing.allocator, 0x8888999911110000ffffeeeeddddccccbbbbaaaa9999);1709 var a = try Managed.initSet(testing.allocator, 0x8888999911110000ffffeeeeddddccccbbbbaaaa9999);
1648 defer a.deinit();1710 defer a.deinit();
...@@ -1660,7 +1722,10 @@ test "big.int div multi-multi with rem" {...@@ -1660,7 +1722,10 @@ test "big.int div multi-multi with rem" {
1660}1722}
16611723
1662test "big.int div multi-multi no rem" {1724test "big.int div multi-multi no rem" {
1663 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;1725 switch (builtin.zig_backend) {
1726 .stage2_c, .stage2_x86_64 => return error.SkipZigTest,
1727 else => {},
1728 }
16641729
1665 var a = try Managed.initSet(testing.allocator, 0x8888999911110000ffffeeeedb4fec200ee3a4286361);1730 var a = try Managed.initSet(testing.allocator, 0x8888999911110000ffffeeeedb4fec200ee3a4286361);
1666 defer a.deinit();1731 defer a.deinit();
...@@ -1678,7 +1743,10 @@ test "big.int div multi-multi no rem" {...@@ -1678,7 +1743,10 @@ test "big.int div multi-multi no rem" {
1678}1743}
16791744
1680test "big.int div multi-multi (2 branch)" {1745test "big.int div multi-multi (2 branch)" {
1681 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;1746 switch (builtin.zig_backend) {
1747 .stage2_c, .stage2_x86_64 => return error.SkipZigTest,
1748 else => {},
1749 }
16821750
1683 var a = try Managed.initSet(testing.allocator, 0x866666665555555588888887777777761111111111111111);1751 var a = try Managed.initSet(testing.allocator, 0x866666665555555588888887777777761111111111111111);
1684 defer a.deinit();1752 defer a.deinit();
...@@ -1717,7 +1785,10 @@ test "big.int div multi-multi (3.1/3.3 branch)" {...@@ -1717,7 +1785,10 @@ test "big.int div multi-multi (3.1/3.3 branch)" {
1717}1785}
17181786
1719test "big.int div multi-single zero-limb trailing" {1787test "big.int div multi-single zero-limb trailing" {
1720 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;1788 switch (builtin.zig_backend) {
1789 .stage2_c, .stage2_x86_64 => return error.SkipZigTest,
1790 else => {},
1791 }
17211792
1722 var a = try Managed.initSet(testing.allocator, 0x60000000000000000000000000000000000000000000000000000000000000000);1793 var a = try Managed.initSet(testing.allocator, 0x60000000000000000000000000000000000000000000000000000000000000000);
1723 defer a.deinit();1794 defer a.deinit();
...@@ -1737,7 +1808,10 @@ test "big.int div multi-single zero-limb trailing" {...@@ -1737,7 +1808,10 @@ test "big.int div multi-single zero-limb trailing" {
1737}1808}
17381809
1739test "big.int div multi-multi zero-limb trailing (with rem)" {1810test "big.int div multi-multi zero-limb trailing (with rem)" {
1740 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;1811 switch (builtin.zig_backend) {
1812 .stage2_c, .stage2_x86_64 => return error.SkipZigTest,
1813 else => {},
1814 }
17411815
1742 var a = try Managed.initSet(testing.allocator, 0x86666666555555558888888777777776111111111111111100000000000000000000000000000000);1816 var a = try Managed.initSet(testing.allocator, 0x86666666555555558888888777777776111111111111111100000000000000000000000000000000);
1743 defer a.deinit();1817 defer a.deinit();
...@@ -1758,7 +1832,10 @@ test "big.int div multi-multi zero-limb trailing (with rem)" {...@@ -1758,7 +1832,10 @@ test "big.int div multi-multi zero-limb trailing (with rem)" {
1758}1832}
17591833
1760test "big.int div multi-multi zero-limb trailing (with rem) and dividend zero-limb count > divisor zero-limb count" {1834test "big.int div multi-multi zero-limb trailing (with rem) and dividend zero-limb count > divisor zero-limb count" {
1761 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;1835 switch (builtin.zig_backend) {
1836 .stage2_c, .stage2_x86_64 => return error.SkipZigTest,
1837 else => {},
1838 }
17621839
1763 var a = try Managed.initSet(testing.allocator, 0x8666666655555555888888877777777611111111111111110000000000000000);1840 var a = try Managed.initSet(testing.allocator, 0x8666666655555555888888877777777611111111111111110000000000000000);
1764 defer a.deinit();1841 defer a.deinit();
...@@ -1779,7 +1856,10 @@ test "big.int div multi-multi zero-limb trailing (with rem) and dividend zero-li...@@ -1779,7 +1856,10 @@ test "big.int div multi-multi zero-limb trailing (with rem) and dividend zero-li
1779}1856}
17801857
1781test "big.int div multi-multi zero-limb trailing (with rem) and dividend zero-limb count < divisor zero-limb count" {1858test "big.int div multi-multi zero-limb trailing (with rem) and dividend zero-limb count < divisor zero-limb count" {
1782 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;1859 switch (builtin.zig_backend) {
1860 .stage2_c, .stage2_x86_64 => return error.SkipZigTest,
1861 else => {},
1862 }
17831863
1784 var a = try Managed.initSet(testing.allocator, 0x86666666555555558888888777777776111111111111111100000000000000000000000000000000);1864 var a = try Managed.initSet(testing.allocator, 0x86666666555555558888888777777776111111111111111100000000000000000000000000000000);
1785 defer a.deinit();1865 defer a.deinit();
...@@ -1802,6 +1882,8 @@ test "big.int div multi-multi zero-limb trailing (with rem) and dividend zero-li...@@ -1802,6 +1882,8 @@ test "big.int div multi-multi zero-limb trailing (with rem) and dividend zero-li
1802}1882}
18031883
1804test "big.int div multi-multi fuzz case #1" {1884test "big.int div multi-multi fuzz case #1" {
1885 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
1886
1805 var a = try Managed.init(testing.allocator);1887 var a = try Managed.init(testing.allocator);
1806 defer a.deinit();1888 defer a.deinit();
1807 var b = try Managed.init(testing.allocator);1889 var b = try Managed.init(testing.allocator);
...@@ -1826,6 +1908,8 @@ test "big.int div multi-multi fuzz case #1" {...@@ -1826,6 +1908,8 @@ test "big.int div multi-multi fuzz case #1" {
1826}1908}
18271909
1828test "big.int div multi-multi fuzz case #2" {1910test "big.int div multi-multi fuzz case #2" {
1911 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
1912
1829 var a = try Managed.init(testing.allocator);1913 var a = try Managed.init(testing.allocator);
1830 defer a.deinit();1914 defer a.deinit();
1831 var b = try Managed.init(testing.allocator);1915 var b = try Managed.init(testing.allocator);
...@@ -1898,6 +1982,8 @@ test "big.int truncate multi to multi unsigned" {...@@ -1898,6 +1982,8 @@ test "big.int truncate multi to multi unsigned" {
1898}1982}
18991983
1900test "big.int truncate multi to multi signed" {1984test "big.int truncate multi to multi signed" {
1985 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
1986
1901 var a = try Managed.initSet(testing.allocator, 3 << @bitSizeOf(Limb));1987 var a = try Managed.initSet(testing.allocator, 3 << @bitSizeOf(Limb));
1902 defer a.deinit();1988 defer a.deinit();
19031989
...@@ -1907,6 +1993,8 @@ test "big.int truncate multi to multi signed" {...@@ -1907,6 +1993,8 @@ test "big.int truncate multi to multi signed" {
1907}1993}
19081994
1909test "big.int truncate negative multi to single" {1995test "big.int truncate negative multi to single" {
1996 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
1997
1910 var a = try Managed.initSet(testing.allocator, -@as(SignedDoubleLimb, maxInt(Limb) + 1));1998 var a = try Managed.initSet(testing.allocator, -@as(SignedDoubleLimb, maxInt(Limb) + 1));
1911 defer a.deinit();1999 defer a.deinit();
19122000
...@@ -2013,6 +2101,8 @@ test "big.int shift-right multi" {...@@ -2013,6 +2101,8 @@ test "big.int shift-right multi" {
2013}2101}
20142102
2015test "big.int shift-left single" {2103test "big.int shift-left single" {
2104 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
2105
2016 var a = try Managed.initSet(testing.allocator, 0xffff);2106 var a = try Managed.initSet(testing.allocator, 0xffff);
2017 defer a.deinit();2107 defer a.deinit();
2018 try a.shiftLeft(&a, 16);2108 try a.shiftLeft(&a, 16);
...@@ -2057,6 +2147,8 @@ test "big.int sat shift-left simple unsigned" {...@@ -2057,6 +2147,8 @@ test "big.int sat shift-left simple unsigned" {
2057}2147}
20582148
2059test "big.int sat shift-left simple unsigned no sat" {2149test "big.int sat shift-left simple unsigned no sat" {
2150 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
2151
2060 var a = try Managed.initSet(testing.allocator, 1);2152 var a = try Managed.initSet(testing.allocator, 1);
2061 defer a.deinit();2153 defer a.deinit();
2062 try a.shiftLeftSat(&a, 16, .unsigned, 21);2154 try a.shiftLeftSat(&a, 16, .unsigned, 21);
...@@ -2314,6 +2406,8 @@ test "big.int bitwise xor simple" {...@@ -2314,6 +2406,8 @@ test "big.int bitwise xor simple" {
2314}2406}
23152407
2316test "big.int bitwise xor multi-limb" {2408test "big.int bitwise xor multi-limb" {
2409 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
2410
2317 var x: DoubleLimb = maxInt(Limb) + 1;2411 var x: DoubleLimb = maxInt(Limb) + 1;
2318 var y: DoubleLimb = maxInt(Limb);2412 var y: DoubleLimb = maxInt(Limb);
2319 var a = try Managed.initSet(testing.allocator, x);2413 var a = try Managed.initSet(testing.allocator, x);
...@@ -2578,6 +2672,8 @@ test "big.int mutable to managed" {...@@ -2578,6 +2672,8 @@ test "big.int mutable to managed" {
2578}2672}
25792673
2580test "big.int const to managed" {2674test "big.int const to managed" {
2675 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
2676
2581 var a = try Managed.initSet(testing.allocator, 123423453456);2677 var a = try Managed.initSet(testing.allocator, 123423453456);
2582 defer a.deinit();2678 defer a.deinit();
25832679
...@@ -2588,6 +2684,8 @@ test "big.int const to managed" {...@@ -2588,6 +2684,8 @@ test "big.int const to managed" {
2588}2684}
25892685
2590test "big.int pow" {2686test "big.int pow" {
2687 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
2688
2591 {2689 {
2592 var a = try Managed.initSet(testing.allocator, -3);2690 var a = try Managed.initSet(testing.allocator, -3);
2593 defer a.deinit();2691 defer a.deinit();
...@@ -2643,6 +2741,8 @@ test "big.int pow" {...@@ -2643,6 +2741,8 @@ test "big.int pow" {
2643}2741}
26442742
2645test "big.int sqrt" {2743test "big.int sqrt" {
2744 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
2745
2646 var r = try Managed.init(testing.allocator);2746 var r = try Managed.init(testing.allocator);
2647 defer r.deinit();2747 defer r.deinit();
2648 var a = try Managed.init(testing.allocator);2748 var a = try Managed.init(testing.allocator);
...@@ -2673,6 +2773,8 @@ test "big.int sqrt" {...@@ -2673,6 +2773,8 @@ test "big.int sqrt" {
2673}2773}
26742774
2675test "big.int regression test for 1 limb overflow with alias" {2775test "big.int regression test for 1 limb overflow with alias" {
2776 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
2777
2676 // Note these happen to be two consecutive Fibonacci sequence numbers, the2778 // Note these happen to be two consecutive Fibonacci sequence numbers, the
2677 // first two whose sum exceeds 2**64.2779 // first two whose sum exceeds 2**64.
2678 var a = try Managed.initSet(testing.allocator, 7540113804746346429);2780 var a = try Managed.initSet(testing.allocator, 7540113804746346429);
...@@ -2687,6 +2789,8 @@ test "big.int regression test for 1 limb overflow with alias" {...@@ -2687,6 +2789,8 @@ test "big.int regression test for 1 limb overflow with alias" {
2687}2789}
26882790
2689test "big.int regression test for realloc with alias" {2791test "big.int regression test for realloc with alias" {
2792 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
2793
2690 // Note these happen to be two consecutive Fibonacci sequence numbers, the2794 // Note these happen to be two consecutive Fibonacci sequence numbers, the
2691 // second of which is the first such number to exceed 2**192.2795 // second of which is the first such number to exceed 2**192.
2692 var a = try Managed.initSet(testing.allocator, 5611500259351924431073312796924978741056961814867751431689);2796 var a = try Managed.initSet(testing.allocator, 5611500259351924431073312796924978741056961814867751431689);
...@@ -2701,6 +2805,8 @@ test "big.int regression test for realloc with alias" {...@@ -2701,6 +2805,8 @@ test "big.int regression test for realloc with alias" {
2701}2805}
27022806
2703test "big int popcount" {2807test "big int popcount" {
2808 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
2809
2704 var a = try Managed.init(testing.allocator);2810 var a = try Managed.init(testing.allocator);
2705 defer a.deinit();2811 defer a.deinit();
27062812
...@@ -2781,6 +2887,8 @@ fn popCountTest(val: *const Managed, bit_count: usize, expected: usize) !void {...@@ -2781,6 +2887,8 @@ fn popCountTest(val: *const Managed, bit_count: usize, expected: usize) !void {
2781}2887}
27822888
2783test "big int conversion read/write twos complement" {2889test "big int conversion read/write twos complement" {
2890 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
2891
2784 var a = try Managed.initSet(testing.allocator, (1 << 493) - 1);2892 var a = try Managed.initSet(testing.allocator, (1 << 493) - 1);
2785 defer a.deinit();2893 defer a.deinit();
2786 var b = try Managed.initSet(testing.allocator, (1 << 493) - 1);2894 var b = try Managed.initSet(testing.allocator, (1 << 493) - 1);
...@@ -2879,6 +2987,8 @@ test "big int write twos complement +/- zero" {...@@ -2879,6 +2987,8 @@ test "big int write twos complement +/- zero" {
2879}2987}
28802988
2881test "big int conversion write twos complement with padding" {2989test "big int conversion write twos complement with padding" {
2990 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
2991
2882 var a = try Managed.initSet(testing.allocator, 0x01_ffffffff_ffffffff_ffffffff);2992 var a = try Managed.initSet(testing.allocator, 0x01_ffffffff_ffffffff_ffffffff);
2883 defer a.deinit();2993 defer a.deinit();
28842994
...@@ -3108,6 +3218,8 @@ test "big int byte swap" {...@@ -3108,6 +3218,8 @@ test "big int byte swap" {
3108}3218}
31093219
3110test "big.int mul multi-multi alias r with a and b" {3220test "big.int mul multi-multi alias r with a and b" {
3221 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
3222
3111 var a = try Managed.initSet(testing.allocator, 2 * maxInt(Limb));3223 var a = try Managed.initSet(testing.allocator, 2 * maxInt(Limb));
3112 defer a.deinit();3224 defer a.deinit();
31133225
...@@ -3124,6 +3236,8 @@ test "big.int mul multi-multi alias r with a and b" {...@@ -3124,6 +3236,8 @@ test "big.int mul multi-multi alias r with a and b" {
3124}3236}
31253237
3126test "big.int sqr multi alias r with a" {3238test "big.int sqr multi alias r with a" {
3239 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
3240
3127 var a = try Managed.initSet(testing.allocator, 2 * maxInt(Limb));3241 var a = try Managed.initSet(testing.allocator, 2 * maxInt(Limb));
3128 defer a.deinit();3242 defer a.deinit();
31293243
lib/std/math/ilogb.zig+9
...@@ -6,6 +6,7 @@...@@ -6,6 +6,7 @@
6// https://git.musl-libc.org/cgit/musl/tree/src/math/ilogb.c6// https://git.musl-libc.org/cgit/musl/tree/src/math/ilogb.c
77
8const std = @import("../std.zig");8const std = @import("../std.zig");
9const builtin = @import("builtin");
9const math = std.math;10const math = std.math;
10const expect = std.testing.expect;11const expect = std.testing.expect;
11const maxInt = std.math.maxInt;12const maxInt = std.math.maxInt;
...@@ -108,6 +109,8 @@ test "64" {...@@ -108,6 +109,8 @@ test "64" {
108}109}
109110
110test "80" {111test "80" {
112 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
113
111 try expect(ilogbX(f80, 0.0) == fp_ilogb0);114 try expect(ilogbX(f80, 0.0) == fp_ilogb0);
112 try expect(ilogbX(f80, 0.5) == -1);115 try expect(ilogbX(f80, 0.5) == -1);
113 try expect(ilogbX(f80, 0.8923) == -1);116 try expect(ilogbX(f80, 0.8923) == -1);
...@@ -122,6 +125,8 @@ test "80" {...@@ -122,6 +125,8 @@ test "80" {
122}125}
123126
124test "128" {127test "128" {
128 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
129
125 try expect(ilogbX(f128, 0.0) == fp_ilogb0);130 try expect(ilogbX(f128, 0.0) == fp_ilogb0);
126 try expect(ilogbX(f128, 0.5) == -1);131 try expect(ilogbX(f128, 0.5) == -1);
127 try expect(ilogbX(f128, 0.8923) == -1);132 try expect(ilogbX(f128, 0.8923) == -1);
...@@ -157,6 +162,8 @@ test "64 special" {...@@ -157,6 +162,8 @@ test "64 special" {
157}162}
158163
159test "80 special" {164test "80 special" {
165 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
166
160 try expect(ilogbX(f80, math.inf(f80)) == maxInt(i32));167 try expect(ilogbX(f80, math.inf(f80)) == maxInt(i32));
161 try expect(ilogbX(f80, -math.inf(f80)) == maxInt(i32));168 try expect(ilogbX(f80, -math.inf(f80)) == maxInt(i32));
162 try expect(ilogbX(f80, 0.0) == minInt(i32));169 try expect(ilogbX(f80, 0.0) == minInt(i32));
...@@ -164,6 +171,8 @@ test "80 special" {...@@ -164,6 +171,8 @@ test "80 special" {
164}171}
165172
166test "128 special" {173test "128 special" {
174 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
175
167 try expect(ilogbX(f128, math.inf(f128)) == maxInt(i32));176 try expect(ilogbX(f128, math.inf(f128)) == maxInt(i32));
168 try expect(ilogbX(f128, -math.inf(f128)) == maxInt(i32));177 try expect(ilogbX(f128, -math.inf(f128)) == maxInt(i32));
169 try expect(ilogbX(f128, 0.0) == minInt(i32));178 try expect(ilogbX(f128, 0.0) == minInt(i32));
lib/std/math/ldexp.zig+1
...@@ -67,6 +67,7 @@ pub fn ldexp(x: anytype, n: i32) @TypeOf(x) {...@@ -67,6 +67,7 @@ pub fn ldexp(x: anytype, n: i32) @TypeOf(x) {
67}67}
6868
69test "math.ldexp" {69test "math.ldexp" {
70 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
7071
71 // subnormals72 // subnormals
72 try expect(ldexp(@as(f16, 0x1.1FFp14), -14 - 9 - 15) == math.floatTrueMin(f16));73 try expect(ldexp(@as(f16, 0x1.1FFp14), -14 - 9 - 15) == math.floatTrueMin(f16));
lib/std/math/log_int.zig+2
...@@ -56,6 +56,8 @@ pub fn log_int(comptime T: type, base: T, x: T) Log2Int(T) {...@@ -56,6 +56,8 @@ pub fn log_int(comptime T: type, base: T, x: T) Log2Int(T) {
56}56}
5757
58test "math.log_int" {58test "math.log_int" {
59 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
60
59 // Test all unsigned integers with 2, 3, ..., 64 bits.61 // Test all unsigned integers with 2, 3, ..., 64 bits.
60 // We cannot test 0 or 1 bits since base must be > 1.62 // We cannot test 0 or 1 bits since base must be > 1.
61 inline for (2..64 + 1) |bits| {63 inline for (2..64 + 1) |bits| {
lib/std/math/scalbn.zig+2
...@@ -7,6 +7,8 @@ const expect = std.testing.expect;...@@ -7,6 +7,8 @@ const expect = std.testing.expect;
7pub const scalbn = @import("ldexp.zig").ldexp;7pub const scalbn = @import("ldexp.zig").ldexp;
88
9test "math.scalbn" {9test "math.scalbn" {
10 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
11
10 // Verify we are using base 2.12 // Verify we are using base 2.
11 try expect(scalbn(@as(f16, 1.5), 4) == 24.0);13 try expect(scalbn(@as(f16, 1.5), 4) == 24.0);
12 try expect(scalbn(@as(f32, 1.5), 4) == 24.0);14 try expect(scalbn(@as(f32, 1.5), 4) == 24.0);
lib/std/mem.zig+2
...@@ -1025,6 +1025,8 @@ pub fn indexOfSentinel(comptime T: type, comptime sentinel: T, p: [*:sentinel]co...@@ -1025,6 +1025,8 @@ pub fn indexOfSentinel(comptime T: type, comptime sentinel: T, p: [*:sentinel]co
1025}1025}
10261026
1027test "indexOfSentinel vector paths" {1027test "indexOfSentinel vector paths" {
1028 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
1029
1028 const Types = [_]type{ u8, u16, u32, u64 };1030 const Types = [_]type{ u8, u16, u32, u64 };
1029 const allocator = std.testing.allocator;1031 const allocator = std.testing.allocator;
10301032
lib/std/net/test.zig+2
...@@ -5,6 +5,7 @@ const mem = std.mem;...@@ -5,6 +5,7 @@ const mem = std.mem;
5const testing = std.testing;5const testing = std.testing;
66
7test "parse and render IPv6 addresses" {7test "parse and render IPv6 addresses" {
8 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
8 if (builtin.os.tag == .wasi) return error.SkipZigTest;9 if (builtin.os.tag == .wasi) return error.SkipZigTest;
910
10 var buffer: [100]u8 = undefined;11 var buffer: [100]u8 = undefined;
...@@ -70,6 +71,7 @@ test "invalid but parseable IPv6 scope ids" {...@@ -70,6 +71,7 @@ test "invalid but parseable IPv6 scope ids" {
70}71}
7172
72test "parse and render IPv4 addresses" {73test "parse and render IPv4 addresses" {
74 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
73 if (builtin.os.tag == .wasi) return error.SkipZigTest;75 if (builtin.os.tag == .wasi) return error.SkipZigTest;
7476
75 var buffer: [18]u8 = undefined;77 var buffer: [18]u8 = undefined;
lib/std/once.zig+2
...@@ -46,6 +46,8 @@ fn incr() void {...@@ -46,6 +46,8 @@ fn incr() void {
46}46}
4747
48test "Once executes its function just once" {48test "Once executes its function just once" {
49 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
50
49 if (builtin.single_threaded) {51 if (builtin.single_threaded) {
50 global_once.call();52 global_once.call();
51 global_once.call();53 global_once.call();
lib/std/os/linux/io_uring.zig+4
...@@ -1862,6 +1862,8 @@ test "write/read" {...@@ -1862,6 +1862,8 @@ test "write/read" {
1862test "splice/read" {1862test "splice/read" {
1863 if (builtin.os.tag != .linux) return error.SkipZigTest;1863 if (builtin.os.tag != .linux) return error.SkipZigTest;
18641864
1865 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
1866
1865 var ring = IO_Uring.init(4, 0) catch |err| switch (err) {1867 var ring = IO_Uring.init(4, 0) catch |err| switch (err) {
1866 error.SystemOutdated => return error.SkipZigTest,1868 error.SystemOutdated => return error.SkipZigTest,
1867 error.PermissionDenied => return error.SkipZigTest,1869 error.PermissionDenied => return error.SkipZigTest,
...@@ -2280,6 +2282,8 @@ test "timeout (after a number of completions)" {...@@ -2280,6 +2282,8 @@ test "timeout (after a number of completions)" {
2280test "timeout_remove" {2282test "timeout_remove" {
2281 if (builtin.os.tag != .linux) return error.SkipZigTest;2283 if (builtin.os.tag != .linux) return error.SkipZigTest;
22822284
2285 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
2286
2283 var ring = IO_Uring.init(2, 0) catch |err| switch (err) {2287 var ring = IO_Uring.init(2, 0) catch |err| switch (err) {
2284 error.SystemOutdated => return error.SkipZigTest,2288 error.SystemOutdated => return error.SkipZigTest,
2285 error.PermissionDenied => return error.SkipZigTest,2289 error.PermissionDenied => return error.SkipZigTest,
lib/std/os/test.zig+11
...@@ -385,6 +385,8 @@ fn testThreadIdFn(thread_id: *Thread.Id) void {...@@ -385,6 +385,8 @@ fn testThreadIdFn(thread_id: *Thread.Id) void {
385test "std.Thread.getCurrentId" {385test "std.Thread.getCurrentId" {
386 if (builtin.single_threaded) return error.SkipZigTest;386 if (builtin.single_threaded) return error.SkipZigTest;
387387
388 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
389
388 var thread_current_id: Thread.Id = undefined;390 var thread_current_id: Thread.Id = undefined;
389 const thread = try Thread.spawn(.{}, testThreadIdFn, .{&thread_current_id});391 const thread = try Thread.spawn(.{}, testThreadIdFn, .{&thread_current_id});
390 thread.join();392 thread.join();
...@@ -427,6 +429,9 @@ test "cpu count" {...@@ -427,6 +429,9 @@ test "cpu count" {
427429
428test "thread local storage" {430test "thread local storage" {
429 if (builtin.single_threaded) return error.SkipZigTest;431 if (builtin.single_threaded) return error.SkipZigTest;
432
433 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
434
430 const thread1 = try Thread.spawn(.{}, testTls, .{});435 const thread1 = try Thread.spawn(.{}, testTls, .{});
431 const thread2 = try Thread.spawn(.{}, testTls, .{});436 const thread2 = try Thread.spawn(.{}, testTls, .{});
432 try testTls();437 try testTls();
...@@ -514,6 +519,8 @@ fn iter_fn(info: *dl_phdr_info, size: usize, counter: *usize) IterFnError!void {...@@ -514,6 +519,8 @@ fn iter_fn(info: *dl_phdr_info, size: usize, counter: *usize) IterFnError!void {
514test "dl_iterate_phdr" {519test "dl_iterate_phdr" {
515 if (builtin.object_format != .elf) return error.SkipZigTest;520 if (builtin.object_format != .elf) return error.SkipZigTest;
516521
522 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
523
517 var counter: usize = 0;524 var counter: usize = 0;
518 try os.dl_iterate_phdr(&counter, IterFnError, iter_fn);525 try os.dl_iterate_phdr(&counter, IterFnError, iter_fn);
519 try expect(counter != 0);526 try expect(counter != 0);
...@@ -773,6 +780,8 @@ test "getrlimit and setrlimit" {...@@ -773,6 +780,8 @@ test "getrlimit and setrlimit" {
773 return error.SkipZigTest;780 return error.SkipZigTest;
774 }781 }
775782
783 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
784
776 inline for (std.meta.fields(os.rlimit_resource)) |field| {785 inline for (std.meta.fields(os.rlimit_resource)) |field| {
777 const resource = @as(os.rlimit_resource, @enumFromInt(field.value));786 const resource = @as(os.rlimit_resource, @enumFromInt(field.value));
778 const limit = try os.getrlimit(resource);787 const limit = try os.getrlimit(resource);
...@@ -815,6 +824,8 @@ test "sigaction" {...@@ -815,6 +824,8 @@ test "sigaction" {
815 if (native_os == .wasi or native_os == .windows)824 if (native_os == .wasi or native_os == .windows)
816 return error.SkipZigTest;825 return error.SkipZigTest;
817826
827 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
828
818 // https://github.com/ziglang/zig/issues/7427829 // https://github.com/ziglang/zig/issues/7427
819 if (native_os == .linux and builtin.target.cpu.arch == .x86)830 if (native_os == .linux and builtin.target.cpu.arch == .x86)
820 return error.SkipZigTest;831 return error.SkipZigTest;
lib/std/os/windows.zig+2
...@@ -2491,6 +2491,8 @@ pub fn ntToWin32Namespace(path: []const u16) !PathSpace {...@@ -2491,6 +2491,8 @@ pub fn ntToWin32Namespace(path: []const u16) !PathSpace {
2491}2491}
24922492
2493test "ntToWin32Namespace" {2493test "ntToWin32Namespace" {
2494 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
2495
2494 const L = std.unicode.utf8ToUtf16LeStringLiteral;2496 const L = std.unicode.utf8ToUtf16LeStringLiteral;
24952497
2496 try testNtToWin32Namespace(L("UNC"), L("\\??\\UNC"));2498 try testNtToWin32Namespace(L("UNC"), L("\\??\\UNC"));
lib/std/priority_dequeue.zig+2
...@@ -705,6 +705,8 @@ test "std.PriorityDequeue: fromOwnedSlice trivial case 1" {...@@ -705,6 +705,8 @@ test "std.PriorityDequeue: fromOwnedSlice trivial case 1" {
705}705}
706706
707test "std.PriorityDequeue: fromOwnedSlice" {707test "std.PriorityDequeue: fromOwnedSlice" {
708 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
709
708 const items = [_]u32{ 15, 7, 21, 14, 13, 22, 12, 6, 7, 25, 5, 24, 11, 16, 15, 24, 2, 1 };710 const items = [_]u32{ 15, 7, 21, 14, 13, 22, 12, 6, 7, 25, 5, 24, 11, 16, 15, 24, 2, 1 };
709 const queue_items = try testing.allocator.dupe(u32, items[0..]);711 const queue_items = try testing.allocator.dupe(u32, items[0..]);
710 var queue = PDQ.fromOwnedSlice(testing.allocator, queue_items[0..], {});712 var queue = PDQ.fromOwnedSlice(testing.allocator, queue_items[0..], {});
lib/std/priority_queue.zig+2
...@@ -385,6 +385,8 @@ test "std.PriorityQueue: fromOwnedSlice trivial case 1" {...@@ -385,6 +385,8 @@ test "std.PriorityQueue: fromOwnedSlice trivial case 1" {
385}385}
386386
387test "std.PriorityQueue: fromOwnedSlice" {387test "std.PriorityQueue: fromOwnedSlice" {
388 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
389
388 const items = [_]u32{ 15, 7, 21, 14, 13, 22, 12, 6, 7, 25, 5, 24, 11, 16, 15, 24, 2, 1 };390 const items = [_]u32{ 15, 7, 21, 14, 13, 22, 12, 6, 7, 25, 5, 24, 11, 16, 15, 24, 2, 1 };
389 const heap_items = try testing.allocator.dupe(u32, items[0..]);391 const heap_items = try testing.allocator.dupe(u32, items[0..]);
390 var queue = PQlt.fromOwnedSlice(testing.allocator, heap_items[0..], {});392 var queue = PQlt.fromOwnedSlice(testing.allocator, heap_items[0..], {});
lib/std/rand/test.zig+10-1
...@@ -1,4 +1,5 @@...@@ -1,4 +1,5 @@
1const std = @import("../std.zig");1const std = @import("../std.zig");
2const builtin = @import("builtin");
2const math = std.math;3const math = std.math;
3const DefaultPrng = std.rand.DefaultPrng;4const DefaultPrng = std.rand.DefaultPrng;
4const Random = std.rand.Random;5const Random = std.rand.Random;
...@@ -157,6 +158,8 @@ fn testRandomEnumValue() !void {...@@ -157,6 +158,8 @@ fn testRandomEnumValue() !void {
157}158}
158159
159test "Random intLessThan" {160test "Random intLessThan" {
161 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
162
160 @setEvalBranchQuota(10000);163 @setEvalBranchQuota(10000);
161 try testRandomIntLessThan();164 try testRandomIntLessThan();
162 try comptime testRandomIntLessThan();165 try comptime testRandomIntLessThan();
...@@ -199,6 +202,8 @@ fn testRandomIntLessThan() !void {...@@ -199,6 +202,8 @@ fn testRandomIntLessThan() !void {
199}202}
200203
201test "Random intAtMost" {204test "Random intAtMost" {
205 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
206
202 @setEvalBranchQuota(10000);207 @setEvalBranchQuota(10000);
203 try testRandomIntAtMost();208 try testRandomIntAtMost();
204 try comptime testRandomIntAtMost();209 try comptime testRandomIntAtMost();
...@@ -239,6 +244,8 @@ fn testRandomIntAtMost() !void {...@@ -239,6 +244,8 @@ fn testRandomIntAtMost() !void {
239}244}
240245
241test "Random Biased" {246test "Random Biased" {
247 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
248
242 var prng = DefaultPrng.init(0);249 var prng = DefaultPrng.init(0);
243 const random = prng.random();250 const random = prng.random();
244 // Not thoroughly checking the logic here.251 // Not thoroughly checking the logic here.
...@@ -436,7 +443,7 @@ fn testRangeBias(r: Random, start: i8, end: i8, biased: bool) !void {...@@ -436,7 +443,7 @@ fn testRangeBias(r: Random, start: i8, end: i8, biased: bool) !void {
436}443}
437444
438test "CSPRNG" {445test "CSPRNG" {
439 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;446 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
440447
441 var secret_seed: [DefaultCsprng.secret_seed_length]u8 = undefined;448 var secret_seed: [DefaultCsprng.secret_seed_length]u8 = undefined;
442 std.crypto.random.bytes(&secret_seed);449 std.crypto.random.bytes(&secret_seed);
...@@ -449,6 +456,8 @@ test "CSPRNG" {...@@ -449,6 +456,8 @@ test "CSPRNG" {
449}456}
450457
451test "Random weightedIndex" {458test "Random weightedIndex" {
459 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
460
452 // Make sure weightedIndex works for various integers and floats461 // Make sure weightedIndex works for various integers and floats
453 inline for (.{ u64, i4, f32, f64 }) |T| {462 inline for (.{ u64, i4, f32, f64 }) |T| {
454 var prng = DefaultPrng.init(0);463 var prng = DefaultPrng.init(0);
lib/std/segmented_list.zig+2
...@@ -409,6 +409,8 @@ pub fn SegmentedList(comptime T: type, comptime prealloc_item_count: usize) type...@@ -409,6 +409,8 @@ pub fn SegmentedList(comptime T: type, comptime prealloc_item_count: usize) type
409}409}
410410
411test "SegmentedList basic usage" {411test "SegmentedList basic usage" {
412 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
413
412 try testSegmentedList(0);414 try testSegmentedList(0);
413 try testSegmentedList(1);415 try testSegmentedList(1);
414 try testSegmentedList(2);416 try testSegmentedList(2);
lib/std/sort.zig+11
...@@ -1,5 +1,6 @@...@@ -1,5 +1,6 @@
1const std = @import("std.zig");1const std = @import("std.zig");
2const assert = std.debug.assert;2const assert = std.debug.assert;
3const builtin = @import("builtin");
3const testing = std.testing;4const testing = std.testing;
4const mem = std.mem;5const mem = std.mem;
5const math = std.math;6const math = std.math;
...@@ -176,6 +177,8 @@ const IdAndValue = struct {...@@ -176,6 +177,8 @@ const IdAndValue = struct {
176};177};
177178
178test "stable sort" {179test "stable sort" {
180 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
181
179 const expected = [_]IdAndValue{182 const expected = [_]IdAndValue{
180 IdAndValue{ .id = 0, .value = 0 },183 IdAndValue{ .id = 0, .value = 0 },
181 IdAndValue{ .id = 1, .value = 0 },184 IdAndValue{ .id = 1, .value = 0 },
...@@ -223,6 +226,8 @@ test "stable sort" {...@@ -223,6 +226,8 @@ test "stable sort" {
223}226}
224227
225test "sort" {228test "sort" {
229 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
230
226 const u8cases = [_][]const []const u8{231 const u8cases = [_][]const []const u8{
227 &[_][]const u8{232 &[_][]const u8{
228 "",233 "",
...@@ -301,6 +306,8 @@ test "sort" {...@@ -301,6 +306,8 @@ test "sort" {
301}306}
302307
303test "sort descending" {308test "sort descending" {
309 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
310
304 const rev_cases = [_][]const []const i32{311 const rev_cases = [_][]const []const i32{
305 &[_][]const i32{312 &[_][]const i32{
306 &[_]i32{},313 &[_]i32{},
...@@ -340,6 +347,8 @@ test "sort descending" {...@@ -340,6 +347,8 @@ test "sort descending" {
340}347}
341348
342test "sort with context in the middle of a slice" {349test "sort with context in the middle of a slice" {
350 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
351
343 const Context = struct {352 const Context = struct {
344 items: []i32,353 items: []i32,
345354
...@@ -379,6 +388,8 @@ test "sort with context in the middle of a slice" {...@@ -379,6 +388,8 @@ test "sort with context in the middle of a slice" {
379}388}
380389
381test "sort fuzz testing" {390test "sort fuzz testing" {
391 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
392
382 var prng = std.rand.DefaultPrng.init(0x12345678);393 var prng = std.rand.DefaultPrng.init(0x12345678);
383 const random = prng.random();394 const random = prng.random();
384 const test_case_count = 10;395 const test_case_count = 10;
lib/std/treap.zig+2
...@@ -350,6 +350,8 @@ const TestTreap = Treap(u64, std.math.order);...@@ -350,6 +350,8 @@ const TestTreap = Treap(u64, std.math.order);
350const TestNode = TestTreap.Node;350const TestNode = TestTreap.Node;
351351
352test "std.Treap: insert, find, replace, remove" {352test "std.Treap: insert, find, replace, remove" {
353 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
354
353 var treap = TestTreap{};355 var treap = TestTreap{};
354 var nodes: [10]TestNode = undefined;356 var nodes: [10]TestNode = undefined;
355357
lib/std/zig/Parse.zig+2
...@@ -4102,5 +4102,7 @@ const TokenIndex = Ast.TokenIndex;...@@ -4102,5 +4102,7 @@ const TokenIndex = Ast.TokenIndex;
4102const Token = std.zig.Token;4102const Token = std.zig.Token;
41034103
4104test {4104test {
4105 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
4106
4105 _ = @import("parser_test.zig");4107 _ = @import("parser_test.zig");
4106}4108}
lib/std/zig/fmt.zig+3
...@@ -1,4 +1,5 @@...@@ -1,4 +1,5 @@
1const std = @import("std");1const std = @import("std");
2const builtin = @import("builtin");
2const mem = std.mem;3const mem = std.mem;
34
4/// Print the string as a Zig identifier escaping it with @"" syntax if needed.5/// Print the string as a Zig identifier escaping it with @"" syntax if needed.
...@@ -95,6 +96,8 @@ pub fn fmtEscapes(bytes: []const u8) std.fmt.Formatter(stringEscape) {...@@ -95,6 +96,8 @@ pub fn fmtEscapes(bytes: []const u8) std.fmt.Formatter(stringEscape) {
95}96}
9697
97test "escape invalid identifiers" {98test "escape invalid identifiers" {
99 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
100
98 const expectFmt = std.testing.expectFmt;101 const expectFmt = std.testing.expectFmt;
99 try expectFmt("@\"while\"", "{}", .{fmtId("while")});102 try expectFmt("@\"while\"", "{}", .{fmtId("while")});
100 try expectFmt("hello", "{}", .{fmtId("hello")});103 try expectFmt("hello", "{}", .{fmtId("hello")});
lib/std/zig/tokenizer.zig+10-1
...@@ -1,4 +1,5 @@...@@ -1,4 +1,5 @@
1const std = @import("../std.zig");1const std = @import("../std.zig");
2const builtin = @import("builtin");
23
3pub const Token = struct {4pub const Token = struct {
4 tag: Tag,5 tag: Tag,
...@@ -1449,6 +1450,8 @@ test "chars" {...@@ -1449,6 +1450,8 @@ test "chars" {
1449}1450}
14501451
1451test "invalid token characters" {1452test "invalid token characters" {
1453 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
1454
1452 try testTokenize("#", &.{.invalid});1455 try testTokenize("#", &.{.invalid});
1453 try testTokenize("`", &.{.invalid});1456 try testTokenize("`", &.{.invalid});
1454 try testTokenize("'c", &.{.invalid});1457 try testTokenize("'c", &.{.invalid});
...@@ -1478,7 +1481,7 @@ test "utf8" {...@@ -1478,7 +1481,7 @@ test "utf8" {
1478}1481}
14791482
1480test "invalid utf8" {1483test "invalid utf8" {
1481 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;1484 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
14821485
1483 try testTokenize("//\x80", &.{1486 try testTokenize("//\x80", &.{
1484 .invalid,1487 .invalid,
...@@ -1570,6 +1573,8 @@ test "pipe and then invalid" {...@@ -1570,6 +1573,8 @@ test "pipe and then invalid" {
1570}1573}
15711574
1572test "line comment and doc comment" {1575test "line comment and doc comment" {
1576 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
1577
1573 try testTokenize("//", &.{});1578 try testTokenize("//", &.{});
1574 try testTokenize("// a / b", &.{});1579 try testTokenize("// a / b", &.{});
1575 try testTokenize("// /", &.{});1580 try testTokenize("// /", &.{});
...@@ -1644,6 +1649,8 @@ test "range literals" {...@@ -1644,6 +1649,8 @@ test "range literals" {
1644}1649}
16451650
1646test "number literals decimal" {1651test "number literals decimal" {
1652 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
1653
1647 try testTokenize("0", &.{.number_literal});1654 try testTokenize("0", &.{.number_literal});
1648 try testTokenize("1", &.{.number_literal});1655 try testTokenize("1", &.{.number_literal});
1649 try testTokenize("2", &.{.number_literal});1656 try testTokenize("2", &.{.number_literal});
...@@ -1892,6 +1899,8 @@ test "invalid token with unfinished escape right before eof" {...@@ -1892,6 +1899,8 @@ test "invalid token with unfinished escape right before eof" {
1892}1899}
18931900
1894test "saturating operators" {1901test "saturating operators" {
1902 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
1903
1895 try testTokenize("<<", &.{.angle_bracket_angle_bracket_left});1904 try testTokenize("<<", &.{.angle_bracket_angle_bracket_left});
1896 try testTokenize("<<|", &.{.angle_bracket_angle_bracket_left_pipe});1905 try testTokenize("<<|", &.{.angle_bracket_angle_bracket_left_pipe});
1897 try testTokenize("<<|=", &.{.angle_bracket_angle_bracket_left_pipe_equal});1906 try testTokenize("<<|=", &.{.angle_bracket_angle_bracket_left_pipe_equal});
test/tests.zig+4-2
...@@ -1002,8 +1002,10 @@ pub fn addModuleTests(b: *std.Build, options: ModuleTestOptions) *Step {...@@ -1002,8 +1002,10 @@ pub fn addModuleTests(b: *std.Build, options: ModuleTestOptions) *Step {
1002 test_target.use_llvm == false and mem.eql(u8, options.name, "universal-libc"))1002 test_target.use_llvm == false and mem.eql(u8, options.name, "universal-libc"))
1003 continue;1003 continue;
10041004
1005 // TODO get std lib tests passing for self-hosted backends.1005 // TODO get std lib tests passing for other self-hosted backends.
1006 if (test_target.use_llvm == false and mem.eql(u8, options.name, "std"))1006 if ((test_target.target.getCpuArch() != .x86_64 or
1007 test_target.target.os_tag != .linux) and
1008 test_target.use_llvm == false and mem.eql(u8, options.name, "std"))
1007 continue;1009 continue;
10081010
1009 const want_this_mode = for (options.optimize_modes) |m| {1011 const want_this_mode = for (options.optimize_modes) |m| {