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" {
369369 return error.SkipZigTest;
370370 }
371371
372 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
373
372374 const num_threads = 4;
373375
374376 const SignalTest = struct {
......@@ -498,6 +500,8 @@ test "Condition - broadcasting" {
498500 return error.SkipZigTest;
499501 }
500502
503 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
504
501505 const num_threads = 10;
502506
503507 const BroadcastTest = struct {
......@@ -565,6 +569,8 @@ test "Condition - broadcasting - wake all threads" {
565569 return error.SkipZigTest;
566570 }
567571
572 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
573
568574 var num_runs: usize = 1;
569575 const num_threads = 10;
570576
lib/std/Thread/Mutex.zig+2
......@@ -289,6 +289,8 @@ test "Mutex - many contended" {
289289 return error.SkipZigTest;
290290 }
291291
292 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
293
292294 const num_threads = 4;
293295 const num_increments = 1000;
294296
lib/std/Thread/RwLock.zig+2
......@@ -297,6 +297,8 @@ test "RwLock - concurrent access" {
297297 if (builtin.single_threaded)
298298 return;
299299
300 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
301
300302 const num_writers: usize = 2;
301303 const num_readers: usize = 4;
302304 const num_writes: usize = 10000;
lib/std/Uri.zig+2
......@@ -685,6 +685,8 @@ test "Special test" {
685685}
686686
687687test "URI escaping" {
688 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
689
688690 const input = "\\ö/ äöß ~~.adas-https://canvas:123/#ads&&sad";
689691 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 @@
11const std = @import("std.zig");
2const builtin = @import("builtin");
23const debug = std.debug;
34const assert = debug.assert;
45const testing = std.testing;
......@@ -2137,6 +2138,8 @@ test "ensure capacity leak" {
21372138}
21382139
21392140test "big map" {
2141 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
2142
21402143 var map = AutoArrayHashMap(i32, i32).init(std.testing.allocator);
21412144 defer map.deinit();
21422145
......@@ -2190,6 +2193,8 @@ test "big map" {
21902193}
21912194
21922195test "clone" {
2196 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
2197
21932198 var original = AutoArrayHashMap(i32, i32).init(std.testing.allocator);
21942199 defer original.deinit();
21952200
......@@ -2216,6 +2221,8 @@ test "clone" {
22162221}
22172222
22182223test "shrink" {
2224 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
2225
22192226 var map = AutoArrayHashMap(i32, i32).init(std.testing.allocator);
22202227 defer map.deinit();
22212228
......@@ -2256,6 +2263,8 @@ test "shrink" {
22562263}
22572264
22582265test "pop" {
2266 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
2267
22592268 var map = AutoArrayHashMap(i32, i32).init(std.testing.allocator);
22602269 defer map.deinit();
22612270
......@@ -2274,6 +2283,8 @@ test "pop" {
22742283}
22752284
22762285test "popOrNull" {
2286 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
2287
22772288 var map = AutoArrayHashMap(i32, i32).init(std.testing.allocator);
22782289 defer map.deinit();
22792290
......@@ -2294,6 +2305,8 @@ test "popOrNull" {
22942305}
22952306
22962307test "reIndex" {
2308 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
2309
22972310 var map = ArrayHashMap(i32, i32, AutoContext(i32), true).init(std.testing.allocator);
22982311 defer map.deinit();
22992312
......@@ -2338,6 +2351,8 @@ test "auto store_hash" {
23382351}
23392352
23402353test "sort" {
2354 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
2355
23412356 var map = AutoArrayHashMap(i32, i32).init(std.testing.allocator);
23422357 defer map.deinit();
23432358
lib/std/array_list.zig+11
......@@ -1,4 +1,5 @@
11const std = @import("std.zig");
2const builtin = @import("builtin");
23const debug = std.debug;
34const assert = debug.assert;
45const testing = std.testing;
......@@ -1183,6 +1184,8 @@ test "std.ArrayList/ArrayListUnmanaged.initCapacity" {
11831184}
11841185
11851186test "std.ArrayList/ArrayListUnmanaged.clone" {
1187 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
1188
11861189 const a = testing.allocator;
11871190 {
11881191 var array = ArrayList(i32).init(a);
......@@ -1224,6 +1227,8 @@ test "std.ArrayList/ArrayListUnmanaged.clone" {
12241227}
12251228
12261229test "std.ArrayList/ArrayListUnmanaged.basic" {
1230 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
1231
12271232 const a = testing.allocator;
12281233 {
12291234 var list = ArrayList(i32).init(a);
......@@ -1508,6 +1513,8 @@ test "std.ArrayList/ArrayListUnmanaged.insert" {
15081513}
15091514
15101515test "std.ArrayList/ArrayListUnmanaged.insertSlice" {
1516 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
1517
15111518 const a = testing.allocator;
15121519 {
15131520 var list = ArrayList(i32).init(a);
......@@ -1554,6 +1561,8 @@ test "std.ArrayList/ArrayListUnmanaged.insertSlice" {
15541561}
15551562
15561563test "std.ArrayList/ArrayListUnmanaged.replaceRange" {
1564 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
1565
15571566 var arena = std.heap.ArenaAllocator.init(testing.allocator);
15581567 defer arena.deinit();
15591568 const a = arena.allocator();
......@@ -1725,6 +1734,8 @@ test "shrink still sets length when resizing is disabled" {
17251734}
17261735
17271736test "shrinkAndFree with a copy" {
1737 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
1738
17281739 var failing_allocator = testing.FailingAllocator.init(testing.allocator, .{ .resize_fail_index = 0 });
17291740 const a = failing_allocator.allocator();
17301741
lib/std/atomic/Atomic.zig+2
......@@ -469,6 +469,8 @@ test "Atomic.fetchSub" {
469469}
470470
471471test "Atomic.fetchMin" {
472 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
473
472474 inline for (atomicIntTypes()) |Int| {
473475 inline for (atomic_rmw_orderings) |ordering| {
474476 var x = Atomic(Int).init(5);
lib/std/atomic/queue.zig+2
......@@ -175,6 +175,8 @@ const puts_per_thread = 500;
175175const put_thread_count = 3;
176176
177177test "std.atomic.Queue" {
178 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
179
178180 var plenty_of_memory = try std.heap.page_allocator.alloc(u8, 300 * 1024);
179181 defer std.heap.page_allocator.free(plenty_of_memory);
180182
lib/std/bit_set.zig+7-2
......@@ -33,6 +33,7 @@
3333const std = @import("std.zig");
3434const assert = std.debug.assert;
3535const Allocator = std.mem.Allocator;
36const builtin = @import("builtin");
3637
3738/// Returns the optimal static bit set type for the specified number
3839/// of elements: either `IntegerBitSet` or `ArrayBitSet`,
......@@ -1636,7 +1637,7 @@ fn testStaticBitSet(comptime Set: type) !void {
16361637}
16371638
16381639test "IntegerBitSet" {
1639 switch (@import("builtin").zig_backend) {
1640 switch (builtin.zig_backend) {
16401641 .stage2_c, .stage2_x86_64 => return error.SkipZigTest,
16411642 else => {},
16421643 }
......@@ -1652,7 +1653,7 @@ test "IntegerBitSet" {
16521653}
16531654
16541655test "ArrayBitSet" {
1655 switch (@import("builtin").zig_backend) {
1656 switch (builtin.zig_backend) {
16561657 .stage2_x86_64 => return error.SkipZigTest,
16571658 else => {},
16581659 }
......@@ -1667,6 +1668,8 @@ test "ArrayBitSet" {
16671668}
16681669
16691670test "DynamicBitSetUnmanaged" {
1671 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
1672
16701673 const allocator = std.testing.allocator;
16711674 var a = try DynamicBitSetUnmanaged.initEmpty(allocator, 300);
16721675 try testing.expectEqual(@as(usize, 0), a.count());
......@@ -1720,6 +1723,8 @@ test "DynamicBitSetUnmanaged" {
17201723}
17211724
17221725test "DynamicBitSet" {
1726 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
1727
17231728 const allocator = std.testing.allocator;
17241729 var a = try DynamicBitSet.initEmpty(allocator, 300);
17251730 try testing.expectEqual(@as(usize, 0), a.count());
lib/std/compress/deflate/compressor.zig+2
......@@ -1069,6 +1069,8 @@ var deflate_tests = [_]DeflateTest{
10691069};
10701070
10711071test "deflate" {
1072 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
1073
10721074 for (deflate_tests) |dt| {
10731075 var output = ArrayList(u8).init(testing.allocator);
10741076 defer output.deinit();
lib/std/compress/deflate/compressor_test.zig+18
......@@ -154,6 +154,8 @@ fn testToFromWithLimit(input: []const u8, limit: [11]u32) !void {
154154}
155155
156156test "deflate/inflate" {
157 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
158
157159 var limits = [_]u32{0} ** 11;
158160
159161 var test0 = [_]u8{};
......@@ -178,6 +180,8 @@ test "deflate/inflate" {
178180}
179181
180182test "very long sparse chunk" {
183 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
184
181185 // A SparseReader returns a stream consisting of 0s ending with 65,536 (1<<16) 1s.
182186 // This tests missing hash references in a very large input.
183187 const SparseReader = struct {
......@@ -239,6 +243,8 @@ test "very long sparse chunk" {
239243}
240244
241245test "compressor reset" {
246 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
247
242248 for (std.enums.values(deflate.Compression)) |c| {
243249 try testWriterReset(c, null);
244250 try testWriterReset(c, "dict");
......@@ -289,6 +295,8 @@ fn testWriterReset(level: deflate.Compression, dict: ?[]const u8) !void {
289295}
290296
291297test "decompressor dictionary" {
298 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
299
292300 const dict = "hello world"; // dictionary
293301 const text = "hello again world";
294302
......@@ -329,6 +337,8 @@ test "decompressor dictionary" {
329337}
330338
331339test "compressor dictionary" {
340 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
341
332342 const dict = "hello world";
333343 const text = "hello again world";
334344
......@@ -375,6 +385,8 @@ test "compressor dictionary" {
375385// Update the hash for best_speed only if d.index < d.maxInsertIndex
376386// See https://golang.org/issue/2508
377387test "Go non-regression test for 2508" {
388 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
389
378390 var comp = try compressor(
379391 testing.allocator,
380392 io.null_writer,
......@@ -392,6 +404,8 @@ test "Go non-regression test for 2508" {
392404}
393405
394406test "deflate/inflate string" {
407 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
408
395409 const StringTest = struct {
396410 filename: []const u8,
397411 limit: [11]u32,
......@@ -439,6 +453,8 @@ test "deflate/inflate string" {
439453}
440454
441455test "inflate reset" {
456 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
457
442458 const strings = [_][]const u8{
443459 "lorem ipsum izzle fo rizzle",
444460 "the quick brown fox jumped over",
......@@ -485,6 +501,8 @@ test "inflate reset" {
485501}
486502
487503test "inflate reset dictionary" {
504 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
505
488506 const dict = "the lorem fox";
489507 const strings = [_][]const u8{
490508 "lorem ipsum izzle fo rizzle",
lib/std/compress/deflate/deflate_fast.zig+2
......@@ -649,6 +649,8 @@ test "best speed shift offsets" {
649649}
650650
651651test "best speed reset" {
652 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
653
652654 // test that encoding is consistent across a warparound of the table offset.
653655 // See https://github.com/golang/go/issues/34121
654656 const fmt = std.fmt;
lib/std/compress/deflate/deflate_fast_test.zig+5
......@@ -1,4 +1,5 @@
11const std = @import("std");
2const builtin = @import("builtin");
23const expect = std.testing.expect;
34const io = std.io;
45const mem = std.mem;
......@@ -11,6 +12,8 @@ const inflate = @import("decompressor.zig");
1112const deflate_const = @import("deflate_const.zig");
1213
1314test "best speed" {
15 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
16
1417 // Tests that round-tripping through deflate and then inflate recovers the original input.
1518 // The Write sizes are near the thresholds in the compressor.encSpeed method (0, 16, 128), as well
1619 // as near `deflate_const.max_store_block_size` (65535).
......@@ -93,6 +96,8 @@ test "best speed" {
9396}
9497
9598test "best speed max match offset" {
99 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
100
96101 const abc = "abcdefgh";
97102 const xyz = "stuvwxyz";
98103 const input_margin = 16 - 1;
lib/std/compress/deflate/huffman_bit_writer.zig+6
......@@ -845,6 +845,8 @@ const testing = std.testing;
845845const ArrayList = std.ArrayList;
846846
847847test "writeBlockHuff" {
848 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
849
848850 // Tests huffman encoding against reference files to detect possible regressions.
849851 // If encoding/bit allocation changes you can regenerate these files
850852
......@@ -1569,6 +1571,8 @@ const TestType = enum {
15691571};
15701572
15711573test "writeBlock" {
1574 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
1575
15721576 // tests if the writeBlock encoding has changed.
15731577
15741578 const ttype: TestType = .write_block;
......@@ -1584,6 +1588,8 @@ test "writeBlock" {
15841588}
15851589
15861590test "writeBlockDynamic" {
1591 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
1592
15871593 // tests if the writeBlockDynamic encoding has changed.
15881594
15891595 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 {
360360}
361361
362362test "generate a Huffman code from an array of frequencies" {
363 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
364
363365 var freqs: [19]u16 = [_]u16{
364366 8, // 0
365367 1, // 1
lib/std/compress/gzip.zig+2
......@@ -174,6 +174,8 @@ fn testReader(data: []const u8, comptime expected: []const u8) !void {
174174// https://tools.ietf.org/rfc/rfc1952.txt length=25037 bytes
175175// SHA256=164ef0897b4cbec63abf1b57f069f3599bd0fb7c72c2a4dee21bd7e03ec9af67
176176test "compressed data" {
177 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
178
177179 try testReader(
178180 @embedFile("testdata/rfc1952.txt.gz"),
179181 @embedFile("testdata/rfc1952.txt"),
lib/std/compress/lzma/vec2d.zig+2
......@@ -50,6 +50,8 @@ const expectEqualSlices = std.testing.expectEqualSlices;
5050const expectError = std.testing.expectError;
5151
5252test "Vec2D.init" {
53 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
54
5355 const allocator = testing.allocator;
5456 var vec2d = try Vec2D(i32).init(allocator, 1, .{ 2, 3 });
5557 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 {
1919}
2020
2121test "compressed data" {
22 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
23
2224 try testReader(@embedFile("testdata/good-0-empty.xz"), "");
2325
2426 inline for ([_][]const u8{
lib/std/compress/zlib.zig+4
......@@ -199,6 +199,8 @@ fn testDecompress(data: []const u8, expected: []const u8) !void {
199199// https://tools.ietf.org/rfc/rfc1951.txt length=36944 bytes
200200// SHA256=5ebf4b5b7fe1c3a0c0ab9aa3ac8c0f3853a7dc484905e76e03b0b0f301350009
201201test "compressed data" {
202 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
203
202204 const rfc1951_txt = @embedFile("testdata/rfc1951.txt");
203205
204206 // Compressed with compression level = 0
......@@ -264,6 +266,8 @@ test "sanity checks" {
264266}
265267
266268test "compress data" {
269 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
270
267271 const allocator = testing.allocator;
268272 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 {
266266}
267267
268268test "zstandard decompression" {
269 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
270
269271 const uncompressed = @embedFile("testdata/rfc8478.txt");
270272 const compressed3 = @embedFile("testdata/rfc8478.txt.zst.3");
271273 const compressed19 = @embedFile("testdata/rfc8478.txt.zst.19");
lib/std/crypto/poly1305.zig+2
......@@ -196,6 +196,8 @@ pub const Poly1305 = struct {
196196};
197197
198198test "poly1305 rfc7439 vector1" {
199 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
200
199201 const expected_mac = "\xa8\x06\x1d\xc1\x30\x51\x36\xc6\xc2\x2b\x8b\xaf\x0c\x01\x27\xa9";
200202
201203 const msg = "Cryptographic Forum Research Group";
lib/std/crypto/scrypt.zig+4-1
......@@ -3,6 +3,7 @@
33// https://github.com/Tarsnap/scrypt
44
55const std = @import("std");
6const builtin = @import("builtin");
67const crypto = std.crypto;
78const fmt = std.fmt;
89const io = std.io;
......@@ -683,7 +684,7 @@ test "unix-scrypt" {
683684}
684685
685686test "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
688689 const str = "$7$C6..../....SodiumChloride$kBGj9fHznVYFQMEn/qDCfrDevf9YDtcDdKvEqHJLV8D";
689690 const params = try crypt_format.deserialize(crypt_format.HashResult(32), str);
......@@ -693,6 +694,8 @@ test "crypt format" {
693694}
694695
695696test "kdf fast" {
697 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
698
696699 const TestVector = struct {
697700 password: []const u8,
698701 salt: []const u8,
lib/std/debug.zig+2
......@@ -2513,6 +2513,8 @@ pub fn dumpStackPointerAddr(prefix: []const u8) void {
25132513}
25142514
25152515test "manage resources correctly" {
2516 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
2517
25162518 if (builtin.os.tag == .wasi) return error.SkipZigTest;
25172519
25182520 if (builtin.os.tag == .windows) {
lib/std/dwarf/expressions.zig+2
......@@ -1054,6 +1054,8 @@ fn isOpcodeRegisterLocation(opcode: u8) bool {
10541054
10551055const testing = std.testing;
10561056test "DWARF expressions" {
1057 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
1058
10571059 const allocator = std.testing.allocator;
10581060
10591061 const options = ExpressionOptions{};
lib/std/fifo.zig+2
......@@ -505,6 +505,8 @@ test "LinearFifo(u8, .Dynamic)" {
505505}
506506
507507test "LinearFifo" {
508 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
509
508510 inline for ([_]type{ u1, u8, u16, u64 }) |T| {
509511 inline for ([_]LinearFifoBufferType{ LinearFifoBufferType{ .Static = 32 }, .Slice, .Dynamic }) |bt| {
510512 const FifoType = LinearFifo(T, bt);
lib/std/fmt.zig+16
......@@ -2129,6 +2129,8 @@ test "int.small" {
21292129}
21302130
21312131test "int.specifier" {
2132 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
2133
21322134 {
21332135 const value: u8 = 'a';
21342136 try expectFmt("u8: a\n", "u8: {c}\n", .{value});
......@@ -2179,6 +2181,8 @@ test "int.padded" {
21792181}
21802182
21812183test "buffer" {
2184 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
2185
21822186 {
21832187 var buf1: [32]u8 = undefined;
21842188 var fbs = std.io.fixedBufferStream(&buf1);
......@@ -2375,6 +2379,8 @@ test "float.scientific" {
23752379}
23762380
23772381test "float.scientific.precision" {
2382 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
2383
23782384 try expectFmt("f64: 1.40971e-42", "f64: {e:.5}", .{@as(f64, 1.409706e-42)});
23792385 try expectFmt("f64: 1.00000e-09", "f64: {e:.5}", .{@as(f64, @as(f32, @bitCast(@as(u32, 814313563))))});
23802386 try expectFmt("f64: 7.81250e-03", "f64: {e:.5}", .{@as(f64, @as(f32, @bitCast(@as(u32, 1006632960))))});
......@@ -2435,6 +2441,8 @@ test "float.hexadecimal" {
24352441}
24362442
24372443test "float.hexadecimal.precision" {
2444 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
2445
24382446 try expectFmt("f16: 0x1.5p-2", "f16: {x:.1}", .{@as(f16, 1.0 / 3.0)});
24392447 try expectFmt("f32: 0x1.555p-2", "f32: {x:.3}", .{@as(f32, 1.0 / 3.0)});
24402448 try expectFmt("f64: 0x1.55555p-2", "f64: {x:.5}", .{@as(f64, 1.0 / 3.0)});
......@@ -2449,6 +2457,8 @@ test "float.hexadecimal.precision" {
24492457}
24502458
24512459test "float.decimal" {
2460 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
2461
24522462 try expectFmt("f64: 152314000000000000000000000000", "f64: {d}", .{@as(f64, 1.52314e+29)});
24532463 try expectFmt("f32: 0", "f32: {d}", .{@as(f32, 0.0)});
24542464 try expectFmt("f32: 0", "f32: {d:.0}", .{@as(f32, 0.0)});
......@@ -2472,6 +2482,8 @@ test "float.decimal" {
24722482}
24732483
24742484test "float.libc.sanity" {
2485 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
2486
24752487 try expectFmt("f64: 0.00001", "f64: {d:.5}", .{@as(f64, @as(f32, @bitCast(@as(u32, 916964781))))});
24762488 try expectFmt("f64: 0.00001", "f64: {d:.5}", .{@as(f64, @as(f32, @bitCast(@as(u32, 925353389))))});
24772489 try expectFmt("f64: 0.10000", "f64: {d:.5}", .{@as(f64, @as(f32, @bitCast(@as(u32, 1036831278))))});
......@@ -2491,6 +2503,8 @@ test "float.libc.sanity" {
24912503}
24922504
24932505test "custom" {
2506 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
2507
24942508 const Vec2 = struct {
24952509 const SelfType = @This();
24962510 x: f32,
......@@ -2669,6 +2683,8 @@ test "formatFloatValue with comptime_float" {
26692683}
26702684
26712685test "formatType max_depth" {
2686 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
2687
26722688 const Vec2 = struct {
26732689 const SelfType = @This();
26742690 x: f32,
lib/std/hash/auto_hash.zig+21
......@@ -1,5 +1,6 @@
11const std = @import("std");
22const assert = std.debug.assert;
3const builtin = @import("builtin");
34const mem = std.mem;
45const meta = std.meta;
56
......@@ -252,6 +253,8 @@ test "typeContainsSlice" {
252253}
253254
254255test "hash pointer" {
256 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
257
255258 const array = [_]u32{ 123, 123, 123 };
256259 const a = &array[0];
257260 const b = &array[1];
......@@ -272,6 +275,8 @@ test "hash pointer" {
272275}
273276
274277test "hash slice shallow" {
278 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
279
275280 // Allocate one array dynamically so that we're assured it is not merged
276281 // with the other by the optimization passes.
277282 const array1 = try std.testing.allocator.create([6]u32);
......@@ -290,6 +295,8 @@ test "hash slice shallow" {
290295}
291296
292297test "hash slice deep" {
298 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
299
293300 // Allocate one array dynamically so that we're assured it is not merged
294301 // with the other by the optimization passes.
295302 const array1 = try std.testing.allocator.create([6]u32);
......@@ -306,6 +313,8 @@ test "hash slice deep" {
306313}
307314
308315test "hash struct deep" {
316 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
317
309318 const Foo = struct {
310319 a: u32,
311320 b: u16,
......@@ -345,6 +354,8 @@ test "hash struct deep" {
345354}
346355
347356test "testHash optional" {
357 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
358
348359 const a: ?u32 = 123;
349360 const b: ?u32 = null;
350361 try testing.expectEqual(testHash(a), testHash(@as(u32, 123)));
......@@ -353,6 +364,8 @@ test "testHash optional" {
353364}
354365
355366test "testHash array" {
367 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
368
356369 const a = [_]u32{ 1, 2, 3 };
357370 const h = testHash(a);
358371 var hasher = Wyhash.init(0);
......@@ -369,6 +382,8 @@ test "testHash multi-dimensional array" {
369382}
370383
371384test "testHash struct" {
385 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
386
372387 const Foo = struct {
373388 a: u32 = 1,
374389 b: u32 = 2,
......@@ -384,6 +399,8 @@ test "testHash struct" {
384399}
385400
386401test "testHash union" {
402 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
403
387404 const Foo = union(enum) {
388405 A: u32,
389406 B: bool,
......@@ -408,6 +425,8 @@ test "testHash union" {
408425}
409426
410427test "testHash vector" {
428 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
429
411430 const a: @Vector(4, u32) = [_]u32{ 1, 2, 3, 4 };
412431 const b: @Vector(4, u32) = [_]u32{ 1, 2, 3, 5 };
413432 try testing.expect(testHash(a) == testHash(a));
......@@ -420,6 +439,8 @@ test "testHash vector" {
420439}
421440
422441test "testHash error union" {
442 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
443
423444 const Errors = error{Test};
424445 const Foo = struct {
425446 a: u32 = 1,
lib/std/hash/wyhash.zig+2
......@@ -242,6 +242,8 @@ test "smhasher" {
242242}
243243
244244test "iterative api" {
245 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
246
245247 const Test = struct {
246248 fn do() !void {
247249 try verify.iterativeApi(Wyhash);
lib/std/hash_map.zig+2
......@@ -1872,6 +1872,8 @@ test "std.hash_map multiple removes on same metadata" {
18721872}
18731873
18741874test "std.hash_map put and remove loop in random order" {
1875 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
1876
18751877 var map = AutoHashMap(u32, u32).init(std.testing.allocator);
18761878 defer map.deinit();
18771879
lib/std/heap/general_purpose_allocator.zig+4
......@@ -1042,6 +1042,8 @@ const TraceKind = enum {
10421042const test_config = Config{};
10431043
10441044test "small allocations - free in same order" {
1045 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
1046
10451047 var gpa = GeneralPurposeAllocator(test_config){};
10461048 defer std.testing.expect(gpa.deinit() == .ok) catch @panic("leak");
10471049 const allocator = gpa.allocator();
......@@ -1061,6 +1063,8 @@ test "small allocations - free in same order" {
10611063}
10621064
10631065test "small allocations - free in reverse order" {
1066 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
1067
10641068 var gpa = GeneralPurposeAllocator(test_config){};
10651069 defer std.testing.expect(gpa.deinit() == .ok) catch @panic("leak");
10661070 const allocator = gpa.allocator();
lib/std/io/bit_reader.zig+2
......@@ -164,6 +164,8 @@ pub fn bitReader(
164164}
165165
166166test "api coverage" {
167 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
168
167169 const mem_be = [_]u8{ 0b11001101, 0b00001011 };
168170 const mem_le = [_]u8{ 0b00011101, 0b10010101 };
169171
lib/std/json.zig+5-1
......@@ -38,12 +38,16 @@ test parseFromSlice {
3838}
3939
4040test Value {
41 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
42
4143 var parsed = try parseFromSlice(Value, testing.allocator, "{\"anything\": \"goes\"}", .{});
4244 defer parsed.deinit();
4345 try testing.expectEqualSlices(u8, "goes", parsed.value.object.get("anything").?.string);
4446}
4547
4648test writeStream {
49 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
50
4751 var out = ArrayList(u8).init(testing.allocator);
4852 defer out.deinit();
4953 var write_stream = writeStream(out.writer(), .{ .whitespace = .indent_2 });
......@@ -61,7 +65,7 @@ test writeStream {
6165}
6266
6367test 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
6670 var out = ArrayList(u8).init(testing.allocator);
6771 defer out.deinit();
lib/std/json/JSONTestSuite_test.zig+72
......@@ -104,6 +104,8 @@ test "i_string_utf16LE_no_BOM.json" {
104104 try any("[\x00\"\x00\xe9\x00\"\x00]\x00");
105105}
106106test "i_structure_500_nested_arrays.json" {
107 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
108
107109 try any("[" ** 500 ++ "]" ** 500);
108110}
109111test "i_structure_UTF-8_BOM_empty_object.json" {
......@@ -359,15 +361,21 @@ test "n_object_bracket_key.json" {
359361 try err("{[: \"x\"}\n");
360362}
361363test "n_object_comma_instead_of_colon.json" {
364 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
365
362366 try err("{\"x\", null}");
363367}
364368test "n_object_double_colon.json" {
369 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
370
365371 try err("{\"x\"::\"b\"}");
366372}
367373test "n_object_emoji.json" {
368374 try err("{\xf0\x9f\x87\xa8\xf0\x9f\x87\xad}");
369375}
370376test "n_object_garbage_at_end.json" {
377 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
378
371379 try err("{\"a\":\"a\" 123}");
372380}
373381test "n_object_key_with_single_quotes.json" {
......@@ -377,18 +385,26 @@ test "n_object_lone_continuation_byte_in_key_and_trailing_comma.json" {
377385 try err("{\"\xb9\":\"0\",}");
378386}
379387test "n_object_missing_colon.json" {
388 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
389
380390 try err("{\"a\" b}");
381391}
382392test "n_object_missing_key.json" {
383393 try err("{:\"b\"}");
384394}
385395test "n_object_missing_semicolon.json" {
396 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
397
386398 try err("{\"a\" \"b\"}");
387399}
388400test "n_object_missing_value.json" {
401 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
402
389403 try err("{\"a\":");
390404}
391405test "n_object_no-colon.json" {
406 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
407
392408 try err("{\"a\"");
393409}
394410test "n_object_non_string_key.json" {
......@@ -401,39 +417,59 @@ test "n_object_repeated_null_null.json" {
401417 try err("{null:null,null:null}");
402418}
403419test "n_object_several_trailing_commas.json" {
420 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
421
404422 try err("{\"id\":0,,,,,}");
405423}
406424test "n_object_single_quote.json" {
407425 try err("{'a':0}");
408426}
409427test "n_object_trailing_comma.json" {
428 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
429
410430 try err("{\"id\":0,}");
411431}
412432test "n_object_trailing_comment.json" {
433 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
434
413435 try err("{\"a\":\"b\"}/**/");
414436}
415437test "n_object_trailing_comment_open.json" {
438 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
439
416440 try err("{\"a\":\"b\"}/**//");
417441}
418442test "n_object_trailing_comment_slash_open.json" {
443 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
444
419445 try err("{\"a\":\"b\"}//");
420446}
421447test "n_object_trailing_comment_slash_open_incomplete.json" {
448 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
449
422450 try err("{\"a\":\"b\"}/");
423451}
424452test "n_object_two_commas_in_a_row.json" {
453 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
454
425455 try err("{\"a\":\"b\",,\"c\":\"d\"}");
426456}
427457test "n_object_unquoted_key.json" {
428458 try err("{a: \"b\"}");
429459}
430460test "n_object_unterminated-value.json" {
461 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
462
431463 try err("{\"a\":\"a");
432464}
433465test "n_object_with_single_string.json" {
466 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
467
434468 try err("{ \"foo\" : \"bar\", \"a\" }");
435469}
436470test "n_object_with_trailing_garbage.json" {
471 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
472
437473 try err("{\"a\":\"b\"}#");
438474}
439475test "n_single_space.json" {
......@@ -560,6 +596,8 @@ test "n_structure_close_unopened_array.json" {
560596 try err("1]");
561597}
562598test "n_structure_comma_instead_of_closing_brace.json" {
599 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
600
563601 try err("{\"x\": true,");
564602}
565603test "n_structure_double_array.json" {
......@@ -590,12 +628,18 @@ test "n_structure_object_followed_by_closing_object.json" {
590628 try err("{}}");
591629}
592630test "n_structure_object_unclosed_no_value.json" {
631 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
632
593633 try err("{\"\":");
594634}
595635test "n_structure_object_with_comment.json" {
636 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
637
596638 try err("{\"a\":/*comment*/\"b\"}");
597639}
598640test "n_structure_object_with_trailing_garbage.json" {
641 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
642
599643 try err("{\"a\": true} \"x\"");
600644}
601645test "n_structure_open_array_apostrophe.json" {
......@@ -605,6 +649,8 @@ test "n_structure_open_array_comma.json" {
605649 try err("[,");
606650}
607651test "n_structure_open_array_object.json" {
652 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
653
608654 try err("[{\"\":" ** 50000 ++ "\n");
609655}
610656test "n_structure_open_array_open_object.json" {
......@@ -644,6 +690,8 @@ test "n_structure_single_star.json" {
644690 try err("*");
645691}
646692test "n_structure_trailing_#.json" {
693 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
694
647695 try err("{\"a\":\"b\"}#{}");
648696}
649697test "n_structure_uescaped_LF_before_string.json" {
......@@ -662,6 +710,8 @@ test "n_structure_unclosed_array_unfinished_true.json" {
662710 try err("[ false, tru");
663711}
664712test "n_structure_unclosed_object.json" {
713 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
714
665715 try err("{\"asd\":\"asd\"");
666716}
667717test "n_structure_unicode-identifier.json" {
......@@ -764,39 +814,61 @@ test "y_number_simple_real.json" {
764814 try ok("[123.456789]");
765815}
766816test "y_object.json" {
817 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
818
767819 try ok("{\"asd\":\"sdf\", \"dfg\":\"fgh\"}");
768820}
769821test "y_object_basic.json" {
822 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
823
770824 try ok("{\"asd\":\"sdf\"}");
771825}
772826test "y_object_duplicated_key.json" {
827 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
828
773829 try ok("{\"a\":\"b\",\"a\":\"c\"}");
774830}
775831test "y_object_duplicated_key_and_value.json" {
832 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
833
776834 try ok("{\"a\":\"b\",\"a\":\"b\"}");
777835}
778836test "y_object_empty.json" {
779837 try ok("{}");
780838}
781839test "y_object_empty_key.json" {
840 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
841
782842 try ok("{\"\":0}");
783843}
784844test "y_object_escaped_null_in_key.json" {
845 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
846
785847 try ok("{\"foo\\u0000bar\": 42}");
786848}
787849test "y_object_extreme_numbers.json" {
850 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
851
788852 try ok("{ \"min\": -1.0e+28, \"max\": 1.0e+28 }");
789853}
790854test "y_object_long_strings.json" {
855 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
856
791857 try ok("{\"x\":[{\"id\": \"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"}], \"id\": \"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"}");
792858}
793859test "y_object_simple.json" {
860 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
861
794862 try ok("{\"a\":[]}");
795863}
796864test "y_object_string_unicode.json" {
865 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
866
797867 try ok("{\"title\":\"\\u041f\\u043e\\u043b\\u0442\\u043e\\u0440\\u0430 \\u0417\\u0435\\u043c\\u043b\\u0435\\u043a\\u043e\\u043f\\u0430\" }");
798868}
799869test "y_object_with_newlines.json" {
870 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
871
800872 try ok("{\n\"a\": \"b\"\n}");
801873}
802874test "y_string_1_2_3_bytes_UTF-8_sequences.json" {
lib/std/json/test.zig+4-1
......@@ -1,4 +1,5 @@
11const std = @import("std");
2const builtin = @import("builtin");
23const testing = std.testing;
34const parseFromSlice = @import("./static.zig").parseFromSlice;
45const validate = @import("./scanner.zig").validate;
......@@ -34,13 +35,15 @@ fn testHighLevelDynamicParser(s: []const u8) !void {
3435
3536// Additional tests not part of test JSONTestSuite.
3637test "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
3940 try roundTrip(
4041 \\{"1":[],"2":{},"3":"4"}
4142 );
4243}
4344test "n_object_closed_missing_value" {
45 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
46
4447 try err(
4548 \\{"a":}
4649 );
lib/std/leb128.zig+4
......@@ -215,6 +215,8 @@ fn test_read_uleb128_seq(comptime T: type, comptime N: usize, encoded: []const u
215215}
216216
217217test "deserialize signed LEB128" {
218 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
219
218220 // Truncated
219221 try testing.expectError(error.EndOfStream, test_read_stream_ileb128(i64, "\x80"));
220222
......@@ -361,6 +363,8 @@ test "serialize unsigned LEB128" {
361363}
362364
363365test "serialize signed LEB128" {
366 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
367
364368 // explicitly test i0 because starting `t` at 0
365369 // will break the while loop
366370 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" {
7171}
7272
7373test "big.int set double-width maximum then zero" {
74 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
75
7476 var a = try Managed.initSet(testing.allocator, maxInt(DoubleLimb));
7577 defer a.deinit();
7678 try a.set(@as(DoubleLimb, 0));
......@@ -244,6 +246,8 @@ test "big.int fits" {
244246}
245247
246248test "big.int string set" {
249 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
250
247251 var a = try Managed.init(testing.allocator);
248252 defer a.deinit();
249253
......@@ -260,6 +264,8 @@ test "big.int string negative" {
260264}
261265
262266test "big.int string set number with underscores" {
267 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
268
263269 var a = try Managed.init(testing.allocator);
264270 defer a.deinit();
265271
......@@ -268,6 +274,8 @@ test "big.int string set number with underscores" {
268274}
269275
270276test "big.int string set case insensitive number" {
277 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
278
271279 var a = try Managed.init(testing.allocator);
272280 defer a.deinit();
273281
......@@ -318,6 +326,8 @@ test "big.int twos complement limit set" {
318326}
319327
320328test "big.int string to" {
329 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
330
321331 var a = try Managed.initSet(testing.allocator, 120317241209124781241290847124);
322332 defer a.deinit();
323333
......@@ -358,6 +368,8 @@ test "big.int string to base 16" {
358368}
359369
360370test "big.int neg string to" {
371 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
372
361373 var a = try Managed.initSet(testing.allocator, -123907434);
362374 defer a.deinit();
363375
......@@ -380,6 +392,8 @@ test "big.int zero string to" {
380392}
381393
382394test "big.int clone" {
395 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
396
383397 var a = try Managed.initSet(testing.allocator, 1234);
384398 defer a.deinit();
385399 var b = try a.clone();
......@@ -517,6 +531,8 @@ test "big.int add multi-single" {
517531}
518532
519533test "big.int add multi-multi" {
534 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
535
520536 var op1: u128 = 0xefefefef7f7f7f7f;
521537 var op2: u128 = 0xfefefefe9f9f9f9f;
522538 var a = try Managed.initSet(testing.allocator, op1);
......@@ -618,6 +634,8 @@ test "big.int addWrap single-single, unsigned" {
618634}
619635
620636test "big.int subWrap single-single, unsigned" {
637 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
638
621639 var a = try Managed.initSet(testing.allocator, 0);
622640 defer a.deinit();
623641
......@@ -631,6 +649,8 @@ test "big.int subWrap single-single, unsigned" {
631649}
632650
633651test "big.int addWrap multi-multi, unsigned, limb aligned" {
652 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
653
634654 var a = try Managed.initSet(testing.allocator, maxInt(DoubleLimb));
635655 defer a.deinit();
636656
......@@ -683,6 +703,8 @@ test "big.int subWrap single-single, signed" {
683703}
684704
685705test "big.int addWrap multi-multi, signed, limb aligned" {
706 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
707
686708 var a = try Managed.initSet(testing.allocator, maxInt(SignedDoubleLimb));
687709 defer a.deinit();
688710
......@@ -733,6 +755,8 @@ test "big.int subSat single-single, unsigned" {
733755}
734756
735757test "big.int addSat multi-multi, unsigned, limb aligned" {
758 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
759
736760 var a = try Managed.initSet(testing.allocator, maxInt(DoubleLimb));
737761 defer a.deinit();
738762
......@@ -818,6 +842,8 @@ test "big.int sub single-single" {
818842}
819843
820844test "big.int sub multi-single" {
845 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
846
821847 var a = try Managed.initSet(testing.allocator, maxInt(Limb) + 1);
822848 defer a.deinit();
823849 var b = try Managed.initSet(testing.allocator, 1);
......@@ -831,6 +857,8 @@ test "big.int sub multi-single" {
831857}
832858
833859test "big.int sub multi-multi" {
860 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
861
834862 var op1: u128 = 0xefefefefefefefefefefefef;
835863 var op2: u128 = 0xabababababababababababab;
836864
......@@ -935,6 +963,8 @@ test "big.int mul multi-multi" {
935963}
936964
937965test "big.int mul alias r with a" {
966 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
967
938968 var a = try Managed.initSet(testing.allocator, maxInt(Limb));
939969 defer a.deinit();
940970 var b = try Managed.initSet(testing.allocator, 2);
......@@ -946,6 +976,8 @@ test "big.int mul alias r with a" {
946976}
947977
948978test "big.int mul alias r with b" {
979 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
980
949981 var a = try Managed.initSet(testing.allocator, maxInt(Limb));
950982 defer a.deinit();
951983 var b = try Managed.initSet(testing.allocator, 2);
......@@ -957,6 +989,8 @@ test "big.int mul alias r with b" {
957989}
958990
959991test "big.int mul alias r with a and b" {
992 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
993
960994 var a = try Managed.initSet(testing.allocator, maxInt(Limb));
961995 defer a.deinit();
962996
......@@ -992,6 +1026,8 @@ test "big.int mul 0*0" {
9921026}
9931027
9941028test "big.int mul large" {
1029 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
1030
9951031 var a = try Managed.initCapacity(testing.allocator, 50);
9961032 defer a.deinit();
9971033 var b = try Managed.initCapacity(testing.allocator, 100);
......@@ -1077,6 +1113,8 @@ test "big.int mulWrap multi-multi signed" {
10771113}
10781114
10791115test "big.int mulWrap large" {
1116 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
1117
10801118 var a = try Managed.initCapacity(testing.allocator, 50);
10811119 defer a.deinit();
10821120 var b = try Managed.initCapacity(testing.allocator, 100);
......@@ -1133,6 +1171,8 @@ test "big.int div single-half with rem" {
11331171}
11341172
11351173test "big.int div single-single no rem" {
1174 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
1175
11361176 // assumes usize is <= 64 bits.
11371177 var a = try Managed.initSet(testing.allocator, 1 << 52);
11381178 defer a.deinit();
......@@ -1150,6 +1190,8 @@ test "big.int div single-single no rem" {
11501190}
11511191
11521192test "big.int div single-single with rem" {
1193 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
1194
11531195 var a = try Managed.initSet(testing.allocator, (1 << 52) | (1 << 33));
11541196 defer a.deinit();
11551197 var b = try Managed.initSet(testing.allocator, (1 << 35));
......@@ -1166,6 +1208,8 @@ test "big.int div single-single with rem" {
11661208}
11671209
11681210test "big.int div multi-single no rem" {
1211 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
1212
11691213 var op1: u128 = 0xffffeeeeddddcccc;
11701214 var op2: u128 = 34;
11711215
......@@ -1185,6 +1229,8 @@ test "big.int div multi-single no rem" {
11851229}
11861230
11871231test "big.int div multi-single with rem" {
1232 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
1233
11881234 var op1: u128 = 0xffffeeeeddddcccf;
11891235 var op2: u128 = 34;
11901236
......@@ -1204,6 +1250,8 @@ test "big.int div multi-single with rem" {
12041250}
12051251
12061252test "big.int div multi>2-single" {
1253 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
1254
12071255 var op1: u128 = 0xfefefefefefefefefefefefefefefefe;
12081256 var op2: u128 = 0xefab8;
12091257
......@@ -1223,6 +1271,8 @@ test "big.int div multi>2-single" {
12231271}
12241272
12251273test "big.int div single-single q < r" {
1274 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
1275
12261276 var a = try Managed.initSet(testing.allocator, 0x0078f432);
12271277 defer a.deinit();
12281278 var b = try Managed.initSet(testing.allocator, 0x01000000);
......@@ -1267,7 +1317,10 @@ test "big.int div q=0 alias" {
12671317}
12681318
12691319test "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
12721325 const op1 = 0x1ffffffff0078f432;
12731326 const op2 = 0x1ffffffff01000000;
......@@ -1398,6 +1451,8 @@ test "big.int divTrunc #15535" {
13981451}
13991452
14001453test "big.int divFloor #10932" {
1454 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
1455
14011456 var a = try Managed.init(testing.allocator);
14021457 defer a.deinit();
14031458
......@@ -1422,6 +1477,8 @@ test "big.int divFloor #10932" {
14221477}
14231478
14241479test "big.int divFloor #11166" {
1480 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
1481
14251482 var a = try Managed.init(testing.allocator);
14261483 defer a.deinit();
14271484
......@@ -1585,6 +1642,8 @@ test "big.int div floor single-single -/-" {
15851642}
15861643
15871644test "big.int div floor no remainder negative quotient" {
1645 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
1646
15881647 const u: i32 = -0x80000000;
15891648 const v: i32 = 1;
15901649
......@@ -1642,7 +1701,10 @@ test "big.int div floor positive close to zero" {
16421701}
16431702
16441703test "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
16471709 var a = try Managed.initSet(testing.allocator, 0x8888999911110000ffffeeeeddddccccbbbbaaaa9999);
16481710 defer a.deinit();
......@@ -1660,7 +1722,10 @@ test "big.int div multi-multi with rem" {
16601722}
16611723
16621724test "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
16651730 var a = try Managed.initSet(testing.allocator, 0x8888999911110000ffffeeeedb4fec200ee3a4286361);
16661731 defer a.deinit();
......@@ -1678,7 +1743,10 @@ test "big.int div multi-multi no rem" {
16781743}
16791744
16801745test "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
16831751 var a = try Managed.initSet(testing.allocator, 0x866666665555555588888887777777761111111111111111);
16841752 defer a.deinit();
......@@ -1717,7 +1785,10 @@ test "big.int div multi-multi (3.1/3.3 branch)" {
17171785}
17181786
17191787test "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
17221793 var a = try Managed.initSet(testing.allocator, 0x60000000000000000000000000000000000000000000000000000000000000000);
17231794 defer a.deinit();
......@@ -1737,7 +1808,10 @@ test "big.int div multi-single zero-limb trailing" {
17371808}
17381809
17391810test "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
17421816 var a = try Managed.initSet(testing.allocator, 0x86666666555555558888888777777776111111111111111100000000000000000000000000000000);
17431817 defer a.deinit();
......@@ -1758,7 +1832,10 @@ test "big.int div multi-multi zero-limb trailing (with rem)" {
17581832}
17591833
17601834test "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
17631840 var a = try Managed.initSet(testing.allocator, 0x8666666655555555888888877777777611111111111111110000000000000000);
17641841 defer a.deinit();
......@@ -1779,7 +1856,10 @@ test "big.int div multi-multi zero-limb trailing (with rem) and dividend zero-li
17791856}
17801857
17811858test "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
17841864 var a = try Managed.initSet(testing.allocator, 0x86666666555555558888888777777776111111111111111100000000000000000000000000000000);
17851865 defer a.deinit();
......@@ -1802,6 +1882,8 @@ test "big.int div multi-multi zero-limb trailing (with rem) and dividend zero-li
18021882}
18031883
18041884test "big.int div multi-multi fuzz case #1" {
1885 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
1886
18051887 var a = try Managed.init(testing.allocator);
18061888 defer a.deinit();
18071889 var b = try Managed.init(testing.allocator);
......@@ -1826,6 +1908,8 @@ test "big.int div multi-multi fuzz case #1" {
18261908}
18271909
18281910test "big.int div multi-multi fuzz case #2" {
1911 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
1912
18291913 var a = try Managed.init(testing.allocator);
18301914 defer a.deinit();
18311915 var b = try Managed.init(testing.allocator);
......@@ -1898,6 +1982,8 @@ test "big.int truncate multi to multi unsigned" {
18981982}
18991983
19001984test "big.int truncate multi to multi signed" {
1985 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
1986
19011987 var a = try Managed.initSet(testing.allocator, 3 << @bitSizeOf(Limb));
19021988 defer a.deinit();
19031989
......@@ -1907,6 +1993,8 @@ test "big.int truncate multi to multi signed" {
19071993}
19081994
19091995test "big.int truncate negative multi to single" {
1996 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
1997
19101998 var a = try Managed.initSet(testing.allocator, -@as(SignedDoubleLimb, maxInt(Limb) + 1));
19111999 defer a.deinit();
19122000
......@@ -2013,6 +2101,8 @@ test "big.int shift-right multi" {
20132101}
20142102
20152103test "big.int shift-left single" {
2104 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
2105
20162106 var a = try Managed.initSet(testing.allocator, 0xffff);
20172107 defer a.deinit();
20182108 try a.shiftLeft(&a, 16);
......@@ -2057,6 +2147,8 @@ test "big.int sat shift-left simple unsigned" {
20572147}
20582148
20592149test "big.int sat shift-left simple unsigned no sat" {
2150 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
2151
20602152 var a = try Managed.initSet(testing.allocator, 1);
20612153 defer a.deinit();
20622154 try a.shiftLeftSat(&a, 16, .unsigned, 21);
......@@ -2314,6 +2406,8 @@ test "big.int bitwise xor simple" {
23142406}
23152407
23162408test "big.int bitwise xor multi-limb" {
2409 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
2410
23172411 var x: DoubleLimb = maxInt(Limb) + 1;
23182412 var y: DoubleLimb = maxInt(Limb);
23192413 var a = try Managed.initSet(testing.allocator, x);
......@@ -2578,6 +2672,8 @@ test "big.int mutable to managed" {
25782672}
25792673
25802674test "big.int const to managed" {
2675 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
2676
25812677 var a = try Managed.initSet(testing.allocator, 123423453456);
25822678 defer a.deinit();
25832679
......@@ -2588,6 +2684,8 @@ test "big.int const to managed" {
25882684}
25892685
25902686test "big.int pow" {
2687 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
2688
25912689 {
25922690 var a = try Managed.initSet(testing.allocator, -3);
25932691 defer a.deinit();
......@@ -2643,6 +2741,8 @@ test "big.int pow" {
26432741}
26442742
26452743test "big.int sqrt" {
2744 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
2745
26462746 var r = try Managed.init(testing.allocator);
26472747 defer r.deinit();
26482748 var a = try Managed.init(testing.allocator);
......@@ -2673,6 +2773,8 @@ test "big.int sqrt" {
26732773}
26742774
26752775test "big.int regression test for 1 limb overflow with alias" {
2776 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
2777
26762778 // Note these happen to be two consecutive Fibonacci sequence numbers, the
26772779 // first two whose sum exceeds 2**64.
26782780 var a = try Managed.initSet(testing.allocator, 7540113804746346429);
......@@ -2687,6 +2789,8 @@ test "big.int regression test for 1 limb overflow with alias" {
26872789}
26882790
26892791test "big.int regression test for realloc with alias" {
2792 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
2793
26902794 // Note these happen to be two consecutive Fibonacci sequence numbers, the
26912795 // second of which is the first such number to exceed 2**192.
26922796 var a = try Managed.initSet(testing.allocator, 5611500259351924431073312796924978741056961814867751431689);
......@@ -2701,6 +2805,8 @@ test "big.int regression test for realloc with alias" {
27012805}
27022806
27032807test "big int popcount" {
2808 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
2809
27042810 var a = try Managed.init(testing.allocator);
27052811 defer a.deinit();
27062812
......@@ -2781,6 +2887,8 @@ fn popCountTest(val: *const Managed, bit_count: usize, expected: usize) !void {
27812887}
27822888
27832889test "big int conversion read/write twos complement" {
2890 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
2891
27842892 var a = try Managed.initSet(testing.allocator, (1 << 493) - 1);
27852893 defer a.deinit();
27862894 var b = try Managed.initSet(testing.allocator, (1 << 493) - 1);
......@@ -2879,6 +2987,8 @@ test "big int write twos complement +/- zero" {
28792987}
28802988
28812989test "big int conversion write twos complement with padding" {
2990 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
2991
28822992 var a = try Managed.initSet(testing.allocator, 0x01_ffffffff_ffffffff_ffffffff);
28832993 defer a.deinit();
28842994
......@@ -3108,6 +3218,8 @@ test "big int byte swap" {
31083218}
31093219
31103220test "big.int mul multi-multi alias r with a and b" {
3221 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
3222
31113223 var a = try Managed.initSet(testing.allocator, 2 * maxInt(Limb));
31123224 defer a.deinit();
31133225
......@@ -3124,6 +3236,8 @@ test "big.int mul multi-multi alias r with a and b" {
31243236}
31253237
31263238test "big.int sqr multi alias r with a" {
3239 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
3240
31273241 var a = try Managed.initSet(testing.allocator, 2 * maxInt(Limb));
31283242 defer a.deinit();
31293243
lib/std/math/ilogb.zig+9
......@@ -6,6 +6,7 @@
66// https://git.musl-libc.org/cgit/musl/tree/src/math/ilogb.c
77
88const std = @import("../std.zig");
9const builtin = @import("builtin");
910const math = std.math;
1011const expect = std.testing.expect;
1112const maxInt = std.math.maxInt;
......@@ -108,6 +109,8 @@ test "64" {
108109}
109110
110111test "80" {
112 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
113
111114 try expect(ilogbX(f80, 0.0) == fp_ilogb0);
112115 try expect(ilogbX(f80, 0.5) == -1);
113116 try expect(ilogbX(f80, 0.8923) == -1);
......@@ -122,6 +125,8 @@ test "80" {
122125}
123126
124127test "128" {
128 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
129
125130 try expect(ilogbX(f128, 0.0) == fp_ilogb0);
126131 try expect(ilogbX(f128, 0.5) == -1);
127132 try expect(ilogbX(f128, 0.8923) == -1);
......@@ -157,6 +162,8 @@ test "64 special" {
157162}
158163
159164test "80 special" {
165 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
166
160167 try expect(ilogbX(f80, math.inf(f80)) == maxInt(i32));
161168 try expect(ilogbX(f80, -math.inf(f80)) == maxInt(i32));
162169 try expect(ilogbX(f80, 0.0) == minInt(i32));
......@@ -164,6 +171,8 @@ test "80 special" {
164171}
165172
166173test "128 special" {
174 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
175
167176 try expect(ilogbX(f128, math.inf(f128)) == maxInt(i32));
168177 try expect(ilogbX(f128, -math.inf(f128)) == maxInt(i32));
169178 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) {
6767}
6868
6969test "math.ldexp" {
70 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
7071
7172 // subnormals
7273 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) {
5656}
5757
5858test "math.log_int" {
59 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
60
5961 // Test all unsigned integers with 2, 3, ..., 64 bits.
6062 // We cannot test 0 or 1 bits since base must be > 1.
6163 inline for (2..64 + 1) |bits| {
lib/std/math/scalbn.zig+2
......@@ -7,6 +7,8 @@ const expect = std.testing.expect;
77pub const scalbn = @import("ldexp.zig").ldexp;
88
99test "math.scalbn" {
10 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
11
1012 // Verify we are using base 2.
1113 try expect(scalbn(@as(f16, 1.5), 4) == 24.0);
1214 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
10251025}
10261026
10271027test "indexOfSentinel vector paths" {
1028 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
1029
10281030 const Types = [_]type{ u8, u16, u32, u64 };
10291031 const allocator = std.testing.allocator;
10301032
lib/std/net/test.zig+2
......@@ -5,6 +5,7 @@ const mem = std.mem;
55const testing = std.testing;
66
77test "parse and render IPv6 addresses" {
8 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
89 if (builtin.os.tag == .wasi) return error.SkipZigTest;
910
1011 var buffer: [100]u8 = undefined;
......@@ -70,6 +71,7 @@ test "invalid but parseable IPv6 scope ids" {
7071}
7172
7273test "parse and render IPv4 addresses" {
74 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
7375 if (builtin.os.tag == .wasi) return error.SkipZigTest;
7476
7577 var buffer: [18]u8 = undefined;
lib/std/once.zig+2
......@@ -46,6 +46,8 @@ fn incr() void {
4646}
4747
4848test "Once executes its function just once" {
49 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
50
4951 if (builtin.single_threaded) {
5052 global_once.call();
5153 global_once.call();
lib/std/os/linux/io_uring.zig+4
......@@ -1862,6 +1862,8 @@ test "write/read" {
18621862test "splice/read" {
18631863 if (builtin.os.tag != .linux) return error.SkipZigTest;
18641864
1865 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
1866
18651867 var ring = IO_Uring.init(4, 0) catch |err| switch (err) {
18661868 error.SystemOutdated => return error.SkipZigTest,
18671869 error.PermissionDenied => return error.SkipZigTest,
......@@ -2280,6 +2282,8 @@ test "timeout (after a number of completions)" {
22802282test "timeout_remove" {
22812283 if (builtin.os.tag != .linux) return error.SkipZigTest;
22822284
2285 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
2286
22832287 var ring = IO_Uring.init(2, 0) catch |err| switch (err) {
22842288 error.SystemOutdated => return error.SkipZigTest,
22852289 error.PermissionDenied => return error.SkipZigTest,
lib/std/os/test.zig+11
......@@ -385,6 +385,8 @@ fn testThreadIdFn(thread_id: *Thread.Id) void {
385385test "std.Thread.getCurrentId" {
386386 if (builtin.single_threaded) return error.SkipZigTest;
387387
388 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
389
388390 var thread_current_id: Thread.Id = undefined;
389391 const thread = try Thread.spawn(.{}, testThreadIdFn, .{&thread_current_id});
390392 thread.join();
......@@ -427,6 +429,9 @@ test "cpu count" {
427429
428430test "thread local storage" {
429431 if (builtin.single_threaded) return error.SkipZigTest;
432
433 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
434
430435 const thread1 = try Thread.spawn(.{}, testTls, .{});
431436 const thread2 = try Thread.spawn(.{}, testTls, .{});
432437 try testTls();
......@@ -514,6 +519,8 @@ fn iter_fn(info: *dl_phdr_info, size: usize, counter: *usize) IterFnError!void {
514519test "dl_iterate_phdr" {
515520 if (builtin.object_format != .elf) return error.SkipZigTest;
516521
522 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
523
517524 var counter: usize = 0;
518525 try os.dl_iterate_phdr(&counter, IterFnError, iter_fn);
519526 try expect(counter != 0);
......@@ -773,6 +780,8 @@ test "getrlimit and setrlimit" {
773780 return error.SkipZigTest;
774781 }
775782
783 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
784
776785 inline for (std.meta.fields(os.rlimit_resource)) |field| {
777786 const resource = @as(os.rlimit_resource, @enumFromInt(field.value));
778787 const limit = try os.getrlimit(resource);
......@@ -815,6 +824,8 @@ test "sigaction" {
815824 if (native_os == .wasi or native_os == .windows)
816825 return error.SkipZigTest;
817826
827 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
828
818829 // https://github.com/ziglang/zig/issues/7427
819830 if (native_os == .linux and builtin.target.cpu.arch == .x86)
820831 return error.SkipZigTest;
lib/std/os/windows.zig+2
......@@ -2491,6 +2491,8 @@ pub fn ntToWin32Namespace(path: []const u16) !PathSpace {
24912491}
24922492
24932493test "ntToWin32Namespace" {
2494 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
2495
24942496 const L = std.unicode.utf8ToUtf16LeStringLiteral;
24952497
24962498 try testNtToWin32Namespace(L("UNC"), L("\\??\\UNC"));
lib/std/priority_dequeue.zig+2
......@@ -705,6 +705,8 @@ test "std.PriorityDequeue: fromOwnedSlice trivial case 1" {
705705}
706706
707707test "std.PriorityDequeue: fromOwnedSlice" {
708 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
709
708710 const items = [_]u32{ 15, 7, 21, 14, 13, 22, 12, 6, 7, 25, 5, 24, 11, 16, 15, 24, 2, 1 };
709711 const queue_items = try testing.allocator.dupe(u32, items[0..]);
710712 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" {
385385}
386386
387387test "std.PriorityQueue: fromOwnedSlice" {
388 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
389
388390 const items = [_]u32{ 15, 7, 21, 14, 13, 22, 12, 6, 7, 25, 5, 24, 11, 16, 15, 24, 2, 1 };
389391 const heap_items = try testing.allocator.dupe(u32, items[0..]);
390392 var queue = PQlt.fromOwnedSlice(testing.allocator, heap_items[0..], {});
lib/std/rand/test.zig+10-1
......@@ -1,4 +1,5 @@
11const std = @import("../std.zig");
2const builtin = @import("builtin");
23const math = std.math;
34const DefaultPrng = std.rand.DefaultPrng;
45const Random = std.rand.Random;
......@@ -157,6 +158,8 @@ fn testRandomEnumValue() !void {
157158}
158159
159160test "Random intLessThan" {
161 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
162
160163 @setEvalBranchQuota(10000);
161164 try testRandomIntLessThan();
162165 try comptime testRandomIntLessThan();
......@@ -199,6 +202,8 @@ fn testRandomIntLessThan() !void {
199202}
200203
201204test "Random intAtMost" {
205 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
206
202207 @setEvalBranchQuota(10000);
203208 try testRandomIntAtMost();
204209 try comptime testRandomIntAtMost();
......@@ -239,6 +244,8 @@ fn testRandomIntAtMost() !void {
239244}
240245
241246test "Random Biased" {
247 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
248
242249 var prng = DefaultPrng.init(0);
243250 const random = prng.random();
244251 // Not thoroughly checking the logic here.
......@@ -436,7 +443,7 @@ fn testRangeBias(r: Random, start: i8, end: i8, biased: bool) !void {
436443}
437444
438445test "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
441448 var secret_seed: [DefaultCsprng.secret_seed_length]u8 = undefined;
442449 std.crypto.random.bytes(&secret_seed);
......@@ -449,6 +456,8 @@ test "CSPRNG" {
449456}
450457
451458test "Random weightedIndex" {
459 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
460
452461 // Make sure weightedIndex works for various integers and floats
453462 inline for (.{ u64, i4, f32, f64 }) |T| {
454463 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
409409}
410410
411411test "SegmentedList basic usage" {
412 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
413
412414 try testSegmentedList(0);
413415 try testSegmentedList(1);
414416 try testSegmentedList(2);
lib/std/sort.zig+11
......@@ -1,5 +1,6 @@
11const std = @import("std.zig");
22const assert = std.debug.assert;
3const builtin = @import("builtin");
34const testing = std.testing;
45const mem = std.mem;
56const math = std.math;
......@@ -176,6 +177,8 @@ const IdAndValue = struct {
176177};
177178
178179test "stable sort" {
180 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
181
179182 const expected = [_]IdAndValue{
180183 IdAndValue{ .id = 0, .value = 0 },
181184 IdAndValue{ .id = 1, .value = 0 },
......@@ -223,6 +226,8 @@ test "stable sort" {
223226}
224227
225228test "sort" {
229 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
230
226231 const u8cases = [_][]const []const u8{
227232 &[_][]const u8{
228233 "",
......@@ -301,6 +306,8 @@ test "sort" {
301306}
302307
303308test "sort descending" {
309 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
310
304311 const rev_cases = [_][]const []const i32{
305312 &[_][]const i32{
306313 &[_]i32{},
......@@ -340,6 +347,8 @@ test "sort descending" {
340347}
341348
342349test "sort with context in the middle of a slice" {
350 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
351
343352 const Context = struct {
344353 items: []i32,
345354
......@@ -379,6 +388,8 @@ test "sort with context in the middle of a slice" {
379388}
380389
381390test "sort fuzz testing" {
391 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
392
382393 var prng = std.rand.DefaultPrng.init(0x12345678);
383394 const random = prng.random();
384395 const test_case_count = 10;
lib/std/treap.zig+2
......@@ -350,6 +350,8 @@ const TestTreap = Treap(u64, std.math.order);
350350const TestNode = TestTreap.Node;
351351
352352test "std.Treap: insert, find, replace, remove" {
353 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
354
353355 var treap = TestTreap{};
354356 var nodes: [10]TestNode = undefined;
355357
lib/std/zig/Parse.zig+2
......@@ -4102,5 +4102,7 @@ const TokenIndex = Ast.TokenIndex;
41024102const Token = std.zig.Token;
41034103
41044104test {
4105 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
4106
41054107 _ = @import("parser_test.zig");
41064108}
lib/std/zig/fmt.zig+3
......@@ -1,4 +1,5 @@
11const std = @import("std");
2const builtin = @import("builtin");
23const mem = std.mem;
34
45/// 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) {
9596}
9697
9798test "escape invalid identifiers" {
99 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
100
98101 const expectFmt = std.testing.expectFmt;
99102 try expectFmt("@\"while\"", "{}", .{fmtId("while")});
100103 try expectFmt("hello", "{}", .{fmtId("hello")});
lib/std/zig/tokenizer.zig+10-1
......@@ -1,4 +1,5 @@
11const std = @import("../std.zig");
2const builtin = @import("builtin");
23
34pub const Token = struct {
45 tag: Tag,
......@@ -1449,6 +1450,8 @@ test "chars" {
14491450}
14501451
14511452test "invalid token characters" {
1453 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
1454
14521455 try testTokenize("#", &.{.invalid});
14531456 try testTokenize("`", &.{.invalid});
14541457 try testTokenize("'c", &.{.invalid});
......@@ -1478,7 +1481,7 @@ test "utf8" {
14781481}
14791482
14801483test "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
14831486 try testTokenize("//\x80", &.{
14841487 .invalid,
......@@ -1570,6 +1573,8 @@ test "pipe and then invalid" {
15701573}
15711574
15721575test "line comment and doc comment" {
1576 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
1577
15731578 try testTokenize("//", &.{});
15741579 try testTokenize("// a / b", &.{});
15751580 try testTokenize("// /", &.{});
......@@ -1644,6 +1649,8 @@ test "range literals" {
16441649}
16451650
16461651test "number literals decimal" {
1652 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
1653
16471654 try testTokenize("0", &.{.number_literal});
16481655 try testTokenize("1", &.{.number_literal});
16491656 try testTokenize("2", &.{.number_literal});
......@@ -1892,6 +1899,8 @@ test "invalid token with unfinished escape right before eof" {
18921899}
18931900
18941901test "saturating operators" {
1902 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
1903
18951904 try testTokenize("<<", &.{.angle_bracket_angle_bracket_left});
18961905 try testTokenize("<<|", &.{.angle_bracket_angle_bracket_left_pipe});
18971906 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 {
10021002 test_target.use_llvm == false and mem.eql(u8, options.name, "universal-libc"))
10031003 continue;
10041004
1005 // TODO get std lib tests passing for self-hosted backends.
1006 if (test_target.use_llvm == false and mem.eql(u8, options.name, "std"))
1005 // TODO get std lib tests passing for other self-hosted backends.
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"))
10071009 continue;
10081010
10091011 const want_this_mode = for (options.optimize_modes) |m| {