authorgravatar for jacobly@ziglang.orgJacob Young <jacobly@ziglang.org> 2023-10-26 02:11:54-04:00
committergravatar for jacobly@ziglang.orgJacob Young <jacobly@ziglang.org> 2023-10-26 21:45:58-04:00
log98cd3782087d198425cfa19906f43d53b8106837
treeb4527ce34088a73402bc9f269346abc3ab50c988
parent3faa4ea9594f058da7522808ffc9587b77ac94a6

x86_64: fix behavior of `getValue`

Old behavior renamed to `getValueIfFree`.

16 files changed, 334 insertions(+), 62 deletions(-)

lib/std/Build/Step/Options.zig-2
......@@ -295,8 +295,6 @@ const Arg = struct {
295295test Options {
296296 if (builtin.os.tag == .wasi) return error.SkipZigTest;
297297
298 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
299
300298 var arena = std.heap.ArenaAllocator.init(std.testing.allocator);
301299 defer arena.deinit();
302300
lib/std/array_hash_map.zig-2
......@@ -2294,8 +2294,6 @@ test "popOrNull" {
22942294}
22952295
22962296test "reIndex" {
2297 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
2298
22992297 var map = ArrayHashMap(i32, i32, AutoContext(i32), true).init(std.testing.allocator);
23002298 defer map.deinit();
23012299
lib/std/json/JSONTestSuite_test.zig-6
......@@ -764,8 +764,6 @@ test "y_number_simple_real.json" {
764764 try ok("[123.456789]");
765765}
766766test "y_object.json" {
767 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
768
769767 try ok("{\"asd\":\"sdf\", \"dfg\":\"fgh\"}");
770768}
771769test "y_object_basic.json" {
......@@ -787,13 +785,9 @@ test "y_object_escaped_null_in_key.json" {
787785 try ok("{\"foo\\u0000bar\": 42}");
788786}
789787test "y_object_extreme_numbers.json" {
790 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
791
792788 try ok("{ \"min\": -1.0e+28, \"max\": 1.0e+28 }");
793789}
794790test "y_object_long_strings.json" {
795 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
796
797791 try ok("{\"x\":[{\"id\": \"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"}], \"id\": \"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"}");
798792}
799793test "y_object_simple.json" {
lib/std/json/dynamic_test.zig-13
......@@ -1,5 +1,4 @@
11const std = @import("std");
2const builtin = @import("builtin");
32const mem = std.mem;
43const testing = std.testing;
54const ArenaAllocator = std.heap.ArenaAllocator;
......@@ -19,8 +18,6 @@ const jsonReader = @import("scanner.zig").reader;
1918const JsonReader = @import("scanner.zig").Reader;
2019
2120test "json.parser.dynamic" {
22 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
23
2421 const s =
2522 \\{
2623 \\ "Image": {
......@@ -75,8 +72,6 @@ test "json.parser.dynamic" {
7572
7673const writeStream = @import("./stringify.zig").writeStream;
7774test "write json then parse it" {
78 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
79
8075 var out_buffer: [1000]u8 = undefined;
8176
8277 var fixed_buffer_stream = std.io.fixedBufferStream(&out_buffer);
......@@ -143,8 +138,6 @@ test "Value.array allocator should still be usable after parsing" {
143138}
144139
145140test "integer after float has proper type" {
146 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
147
148141 var arena_allocator = std.heap.ArenaAllocator.init(std.testing.allocator);
149142 defer arena_allocator.deinit();
150143 const parsed = try testParse(arena_allocator.allocator(),
......@@ -157,8 +150,6 @@ test "integer after float has proper type" {
157150}
158151
159152test "escaped characters" {
160 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
161
162153 var arena_allocator = std.heap.ArenaAllocator.init(std.testing.allocator);
163154 defer arena_allocator.deinit();
164155 const input =
......@@ -238,8 +229,6 @@ test "Value.jsonStringify" {
238229}
239230
240231test "parseFromValue(std.json.Value,...)" {
241 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
242
243232 const str =
244233 \\{
245234 \\ "int": 32,
......@@ -328,8 +317,6 @@ test "ParseOptions.max_value_len" {
328317}
329318
330319test "many object keys" {
331 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
332
333320 const doc =
334321 \\{
335322 \\ "k1": "v1",
lib/std/json/hashmap_test.zig-13
......@@ -1,5 +1,4 @@
11const std = @import("std");
2const builtin = @import("builtin");
32const testing = std.testing;
43
54const ArrayHashMap = @import("hashmap.zig").ArrayHashMap;
......@@ -19,8 +18,6 @@ const T = struct {
1918};
2019
2120test "parse json hashmap" {
22 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
23
2421 const doc =
2522 \\{
2623 \\ "abc": {"i": 0, "s": "d"},
......@@ -36,8 +33,6 @@ test "parse json hashmap" {
3633}
3734
3835test "parse json hashmap while streaming" {
39 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
40
4136 const doc =
4237 \\{
4338 \\ "abc": {"i": 0, "s": "d"},
......@@ -63,8 +58,6 @@ test "parse json hashmap while streaming" {
6358}
6459
6560test "parse json hashmap duplicate fields" {
66 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
67
6861 var arena = std.heap.ArenaAllocator.init(std.testing.allocator);
6962 defer arena.deinit();
7063
......@@ -93,8 +86,6 @@ test "parse json hashmap duplicate fields" {
9386}
9487
9588test "stringify json hashmap" {
96 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
97
9889 var value = ArrayHashMap(T){};
9990 defer value.deinit(testing.allocator);
10091 {
......@@ -132,8 +123,6 @@ test "stringify json hashmap" {
132123}
133124
134125test "stringify json hashmap whitespace" {
135 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
136
137126 var value = ArrayHashMap(T){};
138127 defer value.deinit(testing.allocator);
139128 try value.map.put(testing.allocator, "abc", .{ .i = 0, .s = "d" });
......@@ -158,8 +147,6 @@ test "stringify json hashmap whitespace" {
158147}
159148
160149test "json parse from value hashmap" {
161 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
162
163150 const doc =
164151 \\{
165152 \\ "abc": {"i": 0, "s": "d"},
lib/std/json/static_test.zig+1-2
......@@ -1,5 +1,4 @@
11const std = @import("std");
2const builtin = @import("builtin");
32const testing = std.testing;
43const ArenaAllocator = std.heap.ArenaAllocator;
54const Allocator = std.mem.Allocator;
......@@ -786,7 +785,7 @@ test "max_value_len" {
786785}
787786
788787test "parse into vector" {
789 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
788 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
790789
791790 const T = struct {
792791 vec_i32: @Vector(4, i32),
lib/std/json/stringify_test.zig-3
......@@ -1,5 +1,4 @@
11const std = @import("std");
2const builtin = @import("builtin");
32const mem = std.mem;
43const testing = std.testing;
54
......@@ -16,8 +15,6 @@ const writeStreamMaxDepth = @import("stringify.zig").writeStreamMaxDepth;
1615const writeStreamArbitraryDepth = @import("stringify.zig").writeStreamArbitraryDepth;
1716
1817test "json write stream" {
19 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
20
2118 var out_buf: [1024]u8 = undefined;
2219 var slice_stream = std.io.fixedBufferStream(&out_buf);
2320 const out = slice_stream.writer();
lib/std/json/test.zig-2
......@@ -34,8 +34,6 @@ fn testHighLevelDynamicParser(s: []const u8) !void {
3434
3535// Additional tests not part of test JSONTestSuite.
3636test "y_trailing_comma_after_empty" {
37 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
38
3937 try roundTrip(
4038 \\{"1":[],"2":{},"3":"4"}
4139 );
lib/std/math/ilogb.zig+1-2
......@@ -6,7 +6,6 @@
66// https://git.musl-libc.org/cgit/musl/tree/src/math/ilogb.c
77
88const std = @import("../std.zig");
9const builtin = @import("builtin");
109const math = std.math;
1110const expect = std.testing.expect;
1211const maxInt = std.math.maxInt;
......@@ -109,7 +108,7 @@ test "64" {
109108}
110109
111110test "80" {
112 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
111 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
113112
114113 try expect(ilogbX(f80, 0.0) == fp_ilogb0);
115114 try expect(ilogbX(f80, 0.5) == -1);
lib/std/mem.zig+2-4
......@@ -4661,10 +4661,8 @@ pub fn alignInSlice(slice: anytype, comptime new_alignment: usize) ?AlignedSlice
46614661}
46624662
46634663test "read/write(Var)PackedInt" {
4664 switch (builtin.zig_backend) {
4665 .stage2_c, .stage2_x86_64 => return error.SkipZigTest,
4666 else => {},
4667 }
4664 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
4665 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
46684666
46694667 switch (builtin.cpu.arch) {
46704668 // This test generates too much code to execute on WASI.
lib/std/net/test.zig-1
......@@ -107,7 +107,6 @@ test "parse and render UNIX addresses" {
107107}
108108
109109test "resolve DNS" {
110 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
111110 if (builtin.os.tag == .wasi) return error.SkipZigTest;
112111
113112 if (builtin.os.tag == .windows) {
lib/std/os/linux/io_uring.zig-2
......@@ -2268,8 +2268,6 @@ test "timeout (after a number of completions)" {
22682268test "timeout_remove" {
22692269 if (builtin.os.tag != .linux) return error.SkipZigTest;
22702270
2271 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
2272
22732271 var ring = IO_Uring.init(2, 0) catch |err| switch (err) {
22742272 error.SystemOutdated => return error.SkipZigTest,
22752273 error.PermissionDenied => return error.SkipZigTest,
lib/std/rand/Xoshiro256.zig+2-4
......@@ -90,10 +90,8 @@ pub fn fill(self: *Xoshiro256, buf: []u8) void {
9090}
9191
9292test "xoroshiro sequence" {
93 switch (@import("builtin").zig_backend) {
94 .stage2_c, .stage2_x86_64 => return error.SkipZigTest,
95 else => {},
96 }
93 if (@import("builtin").zig_backend == .stage2_c) return error.SkipZigTest;
94 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
9795
9896 var r = Xoshiro256.init(0);
9997
lib/std/zig/Parse.zig-2
......@@ -4102,7 +4102,5 @@ const TokenIndex = Ast.TokenIndex;
41024102const Token = std.zig.Token;
41034103
41044104test {
4105 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
4106
41074105 _ = @import("parser_test.zig");
41084106}
lib/std/zig/parser_test.zig+320
......@@ -26,6 +26,8 @@ test "zig fmt: tuple struct" {
2626}
2727
2828test "zig fmt: preserves clobbers in inline asm with stray comma" {
29 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
30
2931 try testCanonical(
3032 \\fn foo() void {
3133 \\ asm volatile (""
......@@ -44,6 +46,8 @@ test "zig fmt: preserves clobbers in inline asm with stray comma" {
4446}
4547
4648test "zig fmt: remove trailing comma at the end of assembly clobber" {
49 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
50
4751 try testTransform(
4852 \\fn foo() void {
4953 \\ asm volatile (""
......@@ -66,6 +70,8 @@ test "zig fmt: remove trailing comma at the end of assembly clobber" {
6670}
6771
6872test "zig fmt: respect line breaks in struct field value declaration" {
73 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
74
6975 try testCanonical(
7076 \\const Foo = struct {
7177 \\ bar: u32 =
......@@ -220,6 +226,8 @@ test "zig fmt: file ends in comment after var decl" {
220226}
221227
222228test "zig fmt: if statement" {
229 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
230
223231 try testCanonical(
224232 \\test "" {
225233 \\ if (optional()) |some|
......@@ -318,6 +326,8 @@ test "zig fmt: decl between fields" {
318326}
319327
320328test "zig fmt: errdefer with payload" {
329 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
330
321331 try testCanonical(
322332 \\pub fn main() anyerror!void {
323333 \\ errdefer |a| x += 1;
......@@ -331,6 +341,8 @@ test "zig fmt: errdefer with payload" {
331341}
332342
333343test "zig fmt: nosuspend block" {
344 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
345
334346 try testCanonical(
335347 \\pub fn main() anyerror!void {
336348 \\ nosuspend {
......@@ -342,6 +354,8 @@ test "zig fmt: nosuspend block" {
342354}
343355
344356test "zig fmt: nosuspend await" {
357 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
358
345359 try testCanonical(
346360 \\fn foo() void {
347361 \\ x = nosuspend await y;
......@@ -362,6 +376,8 @@ test "zig fmt: container declaration, single line" {
362376}
363377
364378test "zig fmt: container declaration, one item, multi line trailing comma" {
379 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
380
365381 try testCanonical(
366382 \\test "" {
367383 \\ comptime {
......@@ -375,6 +391,8 @@ test "zig fmt: container declaration, one item, multi line trailing comma" {
375391}
376392
377393test "zig fmt: container declaration, no trailing comma on separate line" {
394 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
395
378396 try testTransform(
379397 \\test "" {
380398 \\ comptime {
......@@ -501,6 +519,8 @@ test "zig fmt: remove empty lines at start/end of container decl" {
501519}
502520
503521test "zig fmt: remove empty lines at start/end of block" {
522 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
523
504524 try testTransform(
505525 \\test {
506526 \\
......@@ -521,6 +541,8 @@ test "zig fmt: remove empty lines at start/end of block" {
521541}
522542
523543test "zig fmt: allow empty line before comment at start of block" {
544 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
545
524546 try testCanonical(
525547 \\test {
526548 \\
......@@ -584,6 +606,8 @@ test "zig fmt: comptime struct field" {
584606}
585607
586608test "zig fmt: break from block" {
609 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
610
587611 try testCanonical(
588612 \\const a = blk: {
589613 \\ break :blk 42;
......@@ -616,6 +640,8 @@ test "zig fmt: c pointer type" {
616640}
617641
618642test "zig fmt: builtin call with trailing comma" {
643 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
644
619645 try testCanonical(
620646 \\pub fn main() void {
621647 \\ @breakpoint();
......@@ -631,6 +657,8 @@ test "zig fmt: builtin call with trailing comma" {
631657}
632658
633659test "zig fmt: asm expression with comptime content" {
660 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
661
634662 try testCanonical(
635663 \\comptime {
636664 \\ asm ("foo" ++ "bar");
......@@ -655,6 +683,8 @@ test "zig fmt: asm expression with comptime content" {
655683}
656684
657685test "zig fmt: array types last token" {
686 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
687
658688 try testCanonical(
659689 \\test {
660690 \\ const x = [40]u32;
......@@ -668,6 +698,8 @@ test "zig fmt: array types last token" {
668698}
669699
670700test "zig fmt: sentinel-terminated array type" {
701 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
702
671703 try testCanonical(
672704 \\pub fn cStrToPrefixedFileW(s: [*:0]const u8) ![PATH_MAX_WIDE:0]u16 {
673705 \\ return sliceToPrefixedFileW(mem.toSliceConst(u8, s));
......@@ -677,6 +709,8 @@ test "zig fmt: sentinel-terminated array type" {
677709}
678710
679711test "zig fmt: sentinel-terminated slice type" {
712 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
713
680714 try testCanonical(
681715 \\pub fn toSlice(self: Buffer) [:0]u8 {
682716 \\ return self.list.toSlice()[0..self.len()];
......@@ -748,6 +782,8 @@ test "zig fmt: anon literal in array" {
748782}
749783
750784test "zig fmt: alignment in anonymous literal" {
785 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
786
751787 try testTransform(
752788 \\const a = .{
753789 \\ "U", "L", "F",
......@@ -766,6 +802,8 @@ test "zig fmt: alignment in anonymous literal" {
766802}
767803
768804test "zig fmt: anon struct literal 0 element" {
805 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
806
769807 try testCanonical(
770808 \\test {
771809 \\ const x = .{};
......@@ -775,6 +813,8 @@ test "zig fmt: anon struct literal 0 element" {
775813}
776814
777815test "zig fmt: anon struct literal 1 element" {
816 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
817
778818 try testCanonical(
779819 \\test {
780820 \\ const x = .{ .a = b };
......@@ -784,6 +824,8 @@ test "zig fmt: anon struct literal 1 element" {
784824}
785825
786826test "zig fmt: anon struct literal 1 element comma" {
827 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
828
787829 try testCanonical(
788830 \\test {
789831 \\ const x = .{
......@@ -795,6 +837,8 @@ test "zig fmt: anon struct literal 1 element comma" {
795837}
796838
797839test "zig fmt: anon struct literal 2 element" {
840 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
841
798842 try testCanonical(
799843 \\test {
800844 \\ const x = .{ .a = b, .c = d };
......@@ -804,6 +848,8 @@ test "zig fmt: anon struct literal 2 element" {
804848}
805849
806850test "zig fmt: anon struct literal 2 element comma" {
851 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
852
807853 try testCanonical(
808854 \\test {
809855 \\ const x = .{
......@@ -816,6 +862,8 @@ test "zig fmt: anon struct literal 2 element comma" {
816862}
817863
818864test "zig fmt: anon struct literal 3 element" {
865 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
866
819867 try testCanonical(
820868 \\test {
821869 \\ const x = .{ .a = b, .c = d, .e = f };
......@@ -825,6 +873,8 @@ test "zig fmt: anon struct literal 3 element" {
825873}
826874
827875test "zig fmt: anon struct literal 3 element comma" {
876 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
877
828878 try testCanonical(
829879 \\test {
830880 \\ const x = .{
......@@ -838,6 +888,8 @@ test "zig fmt: anon struct literal 3 element comma" {
838888}
839889
840890test "zig fmt: struct literal 0 element" {
891 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
892
841893 try testCanonical(
842894 \\test {
843895 \\ const x = X{};
......@@ -847,6 +899,8 @@ test "zig fmt: struct literal 0 element" {
847899}
848900
849901test "zig fmt: struct literal 1 element" {
902 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
903
850904 try testCanonical(
851905 \\test {
852906 \\ const x = X{ .a = b };
......@@ -856,6 +910,8 @@ test "zig fmt: struct literal 1 element" {
856910}
857911
858912test "zig fmt: Unicode code point literal larger than u8" {
913 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
914
859915 try testCanonical(
860916 \\test {
861917 \\ const x = X{
......@@ -867,6 +923,8 @@ test "zig fmt: Unicode code point literal larger than u8" {
867923}
868924
869925test "zig fmt: struct literal 2 element" {
926 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
927
870928 try testCanonical(
871929 \\test {
872930 \\ const x = X{ .a = b, .c = d };
......@@ -876,6 +934,8 @@ test "zig fmt: struct literal 2 element" {
876934}
877935
878936test "zig fmt: struct literal 2 element comma" {
937 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
938
879939 try testCanonical(
880940 \\test {
881941 \\ const x = X{
......@@ -888,6 +948,8 @@ test "zig fmt: struct literal 2 element comma" {
888948}
889949
890950test "zig fmt: struct literal 3 element" {
951 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
952
891953 try testCanonical(
892954 \\test {
893955 \\ const x = X{ .a = b, .c = d, .e = f };
......@@ -897,6 +959,8 @@ test "zig fmt: struct literal 3 element" {
897959}
898960
899961test "zig fmt: struct literal 3 element comma" {
962 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
963
900964 try testCanonical(
901965 \\test {
902966 \\ const x = X{
......@@ -910,6 +974,8 @@ test "zig fmt: struct literal 3 element comma" {
910974}
911975
912976test "zig fmt: anon list literal 1 element" {
977 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
978
913979 try testCanonical(
914980 \\test {
915981 \\ const x = .{a};
......@@ -930,6 +996,8 @@ test "zig fmt: anon list literal 1 element comma" {
930996}
931997
932998test "zig fmt: anon list literal 2 element" {
999 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
1000
9331001 try testCanonical(
9341002 \\test {
9351003 \\ const x = .{ a, b };
......@@ -951,6 +1019,8 @@ test "zig fmt: anon list literal 2 element comma" {
9511019}
9521020
9531021test "zig fmt: anon list literal 3 element" {
1022 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
1023
9541024 try testCanonical(
9551025 \\test {
9561026 \\ const x = .{ a, b, c };
......@@ -975,6 +1045,8 @@ test "zig fmt: anon list literal 3 element comma" {
9751045}
9761046
9771047test "zig fmt: array literal 0 element" {
1048 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
1049
9781050 try testCanonical(
9791051 \\test {
9801052 \\ const x = [_]u32{};
......@@ -984,6 +1056,8 @@ test "zig fmt: array literal 0 element" {
9841056}
9851057
9861058test "zig fmt: array literal 1 element" {
1059 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
1060
9871061 try testCanonical(
9881062 \\test {
9891063 \\ const x = [_]u32{a};
......@@ -1004,6 +1078,8 @@ test "zig fmt: array literal 1 element comma" {
10041078}
10051079
10061080test "zig fmt: array literal 2 element" {
1081 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
1082
10071083 try testCanonical(
10081084 \\test {
10091085 \\ const x = [_]u32{ a, b };
......@@ -1025,6 +1101,8 @@ test "zig fmt: array literal 2 element comma" {
10251101}
10261102
10271103test "zig fmt: array literal 3 element" {
1104 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
1105
10281106 try testCanonical(
10291107 \\test {
10301108 \\ const x = [_]u32{ a, b, c };
......@@ -1047,6 +1125,8 @@ test "zig fmt: array literal 3 element comma" {
10471125}
10481126
10491127test "zig fmt: sentinel array literal 1 element" {
1128 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
1129
10501130 try testCanonical(
10511131 \\test {
10521132 \\ const x = [_:9000]u32{a};
......@@ -1076,6 +1156,8 @@ test "zig fmt: slices with spaces in bounds" {
10761156}
10771157
10781158test "zig fmt: block in slice expression" {
1159 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
1160
10791161 try testCanonical(
10801162 \\const a = b[{
10811163 \\ _ = x;
......@@ -1094,6 +1176,8 @@ test "zig fmt: block in slice expression" {
10941176}
10951177
10961178test "zig fmt: async function" {
1179 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
1180
10971181 try testCanonical(
10981182 \\pub const Server = struct {
10991183 \\ handleRequestFn: fn (*Server, *const std.net.Address, File) callconv(.Async) void,
......@@ -1106,6 +1190,8 @@ test "zig fmt: async function" {
11061190}
11071191
11081192test "zig fmt: whitespace fixes" {
1193 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
1194
11091195 try testTransform("test \"\" {\r\n\tconst hi = x;\r\n}\n// zig fmt: off\ntest \"\"{\r\n\tconst a = b;}\r\n",
11101196 \\test "" {
11111197 \\ const hi = x;
......@@ -1118,6 +1204,8 @@ test "zig fmt: whitespace fixes" {
11181204}
11191205
11201206test "zig fmt: while else err prong with no block" {
1207 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
1208
11211209 try testCanonical(
11221210 \\test "" {
11231211 \\ const result = while (returnError()) |value| {
......@@ -1147,6 +1235,8 @@ test "zig fmt: tagged union with enum values" {
11471235}
11481236
11491237test "zig fmt: tagged union enum tag last token" {
1238 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
1239
11501240 try testCanonical(
11511241 \\test {
11521242 \\ const U = union(enum(u32)) {};
......@@ -1482,6 +1572,8 @@ test "zig fmt: doc and line comment following 'zig fmt: on'" {
14821572}
14831573
14841574test "zig fmt: 'zig fmt: (off|on)' works in the middle of code" {
1575 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
1576
14851577 try testTransform(
14861578 \\test "" {
14871579 \\ const x = 42;
......@@ -1508,6 +1600,8 @@ test "zig fmt: 'zig fmt: (off|on)' works in the middle of code" {
15081600}
15091601
15101602test "zig fmt: 'zig fmt: on' indentation is unchanged" {
1603 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
1604
15111605 try testCanonical(
15121606 \\fn initOptionsAndLayouts(output: *Output, context: *Context) !void {
15131607 \\ // zig fmt: off
......@@ -1550,6 +1644,8 @@ test "zig fmt: spaces around slice operator" {
15501644}
15511645
15521646test "zig fmt: async call in if condition" {
1647 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
1648
15531649 try testCanonical(
15541650 \\comptime {
15551651 \\ if (async b()) {
......@@ -1561,6 +1657,8 @@ test "zig fmt: async call in if condition" {
15611657}
15621658
15631659test "zig fmt: 2nd arg multiline string" {
1660 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
1661
15641662 try testCanonical(
15651663 \\comptime {
15661664 \\ cases.addAsm("hello world linux x86_64",
......@@ -1589,6 +1687,8 @@ test "zig fmt: 2nd arg multiline string" {
15891687}
15901688
15911689test "zig fmt: 2nd arg multiline string many args" {
1690 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
1691
15921692 try testCanonical(
15931693 \\comptime {
15941694 \\ cases.addAsm("hello world linux x86_64",
......@@ -1600,6 +1700,8 @@ test "zig fmt: 2nd arg multiline string many args" {
16001700}
16011701
16021702test "zig fmt: final arg multiline string" {
1703 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
1704
16031705 try testCanonical(
16041706 \\comptime {
16051707 \\ cases.addAsm("hello world linux x86_64", "Hello, world!\n",
......@@ -1611,6 +1713,8 @@ test "zig fmt: final arg multiline string" {
16111713}
16121714
16131715test "zig fmt: if condition wraps" {
1716 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
1717
16141718 try testTransform(
16151719 \\comptime {
16161720 \\ if (cond and
......@@ -1692,6 +1796,8 @@ test "zig fmt: if condition wraps" {
16921796}
16931797
16941798test "zig fmt: if condition has line break but must not wrap" {
1799 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
1800
16951801 try testCanonical(
16961802 \\comptime {
16971803 \\ if (self.user_input_options.put(
......@@ -1716,6 +1822,8 @@ test "zig fmt: if condition has line break but must not wrap" {
17161822}
17171823
17181824test "zig fmt: if condition has line break but must not wrap (no fn call comma)" {
1825 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
1826
17191827 try testCanonical(
17201828 \\comptime {
17211829 \\ if (self.user_input_options.put(name, UserInputOption{
......@@ -1737,6 +1845,8 @@ test "zig fmt: if condition has line break but must not wrap (no fn call comma)"
17371845}
17381846
17391847test "zig fmt: function call with multiline argument" {
1848 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
1849
17401850 try testCanonical(
17411851 \\comptime {
17421852 \\ self.user_input_options.put(name, UserInputOption{
......@@ -1749,6 +1859,8 @@ test "zig fmt: function call with multiline argument" {
17491859}
17501860
17511861test "zig fmt: if-else with comment before else" {
1862 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
1863
17521864 try testCanonical(
17531865 \\comptime {
17541866 \\ // cexp(finite|nan +- i inf|nan) = nan + i nan
......@@ -1767,6 +1879,8 @@ test "zig fmt: if-else with comment before else" {
17671879}
17681880
17691881test "zig fmt: if nested" {
1882 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
1883
17701884 try testCanonical(
17711885 \\pub fn foo() void {
17721886 \\ return if ((aInt & bInt) >= 0)
......@@ -1790,6 +1904,8 @@ test "zig fmt: if nested" {
17901904}
17911905
17921906test "zig fmt: respect line breaks in if-else" {
1907 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
1908
17931909 try testCanonical(
17941910 \\comptime {
17951911 \\ return if (cond) a else b;
......@@ -1809,6 +1925,8 @@ test "zig fmt: respect line breaks in if-else" {
18091925}
18101926
18111927test "zig fmt: respect line breaks after infix operators" {
1928 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
1929
18121930 try testCanonical(
18131931 \\comptime {
18141932 \\ self.crc =
......@@ -1872,6 +1990,8 @@ test "zig fmt: switch comment after prong" {
18721990}
18731991
18741992test "zig fmt: struct literal no trailing comma" {
1993 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
1994
18751995 try testTransform(
18761996 \\const a = foo{ .x = 1, .y = 2 };
18771997 \\const a = foo{ .x = 1,
......@@ -1890,6 +2010,8 @@ test "zig fmt: struct literal no trailing comma" {
18902010}
18912011
18922012test "zig fmt: struct literal containing a multiline expression" {
2013 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
2014
18932015 try testTransform(
18942016 \\const a = A{ .x = if (f1()) 10 else 20 };
18952017 \\const a = A{ .x = if (f1()) 10 else 20, };
......@@ -1951,6 +2073,8 @@ test "zig fmt: struct literal containing a multiline expression" {
19512073}
19522074
19532075test "zig fmt: array literal with hint" {
2076 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
2077
19542078 try testTransform(
19552079 \\const a = []u8{
19562080 \\ 1, 2, //
......@@ -2028,6 +2152,8 @@ test "zig fmt: array literal with hint" {
20282152}
20292153
20302154test "zig fmt: array literal vertical column alignment" {
2155 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
2156
20312157 try testTransform(
20322158 \\const a = []u8{
20332159 \\ 1000, 200,
......@@ -2075,6 +2201,8 @@ test "zig fmt: array literal vertical column alignment" {
20752201}
20762202
20772203test "zig fmt: multiline string with backslash at end of line" {
2204 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
2205
20782206 try testCanonical(
20792207 \\comptime {
20802208 \\ err(
......@@ -2086,6 +2214,8 @@ test "zig fmt: multiline string with backslash at end of line" {
20862214}
20872215
20882216test "zig fmt: multiline string parameter in fn call with trailing comma" {
2217 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
2218
20892219 try testCanonical(
20902220 \\fn foo() void {
20912221 \\ try stdout.print(
......@@ -2104,6 +2234,8 @@ test "zig fmt: multiline string parameter in fn call with trailing comma" {
21042234}
21052235
21062236test "zig fmt: trailing comma on fn call" {
2237 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
2238
21072239 try testCanonical(
21082240 \\comptime {
21092241 \\ var module = try Module.create(
......@@ -2117,6 +2249,8 @@ test "zig fmt: trailing comma on fn call" {
21172249}
21182250
21192251test "zig fmt: multi line arguments without last comma" {
2252 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
2253
21202254 try testTransform(
21212255 \\pub fn foo(
21222256 \\ a: usize,
......@@ -2178,6 +2312,8 @@ test "zig fmt: extra newlines at the end" {
21782312}
21792313
21802314test "zig fmt: simple asm" {
2315 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
2316
21812317 try testTransform(
21822318 \\comptime {
21832319 \\ asm volatile (
......@@ -2215,6 +2351,8 @@ test "zig fmt: simple asm" {
22152351}
22162352
22172353test "zig fmt: nested struct literal with one item" {
2354 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
2355
22182356 try testCanonical(
22192357 \\const a = foo{
22202358 \\ .item = bar{ .a = b },
......@@ -2258,6 +2396,8 @@ test "zig fmt: slice align" {
22582396}
22592397
22602398test "zig fmt: add trailing comma to array literal" {
2399 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
2400
22612401 try testTransform(
22622402 \\comptime {
22632403 \\ return []u16{'m', 's', 'y', 's', '-' // hi
......@@ -2299,6 +2439,8 @@ test "zig fmt: line comment after doc comment" {
22992439}
23002440
23012441test "zig fmt: bit field alignment" {
2442 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
2443
23022444 try testCanonical(
23032445 \\test {
23042446 \\ assert(@TypeOf(&blah.b) == *align(1:3:6) const u3);
......@@ -2330,6 +2472,8 @@ test "zig fmt: float literal with exponent" {
23302472}
23312473
23322474test "zig fmt: if-else end of comptime" {
2475 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
2476
23332477 try testCanonical(
23342478 \\comptime {
23352479 \\ if (a) {
......@@ -2343,6 +2487,8 @@ test "zig fmt: if-else end of comptime" {
23432487}
23442488
23452489test "zig fmt: nested blocks" {
2490 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
2491
23462492 try testCanonical(
23472493 \\comptime {
23482494 \\ {
......@@ -2358,6 +2504,8 @@ test "zig fmt: nested blocks" {
23582504}
23592505
23602506test "zig fmt: block with same line comment after end brace" {
2507 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
2508
23612509 try testCanonical(
23622510 \\comptime {
23632511 \\ {
......@@ -2369,6 +2517,8 @@ test "zig fmt: block with same line comment after end brace" {
23692517}
23702518
23712519test "zig fmt: statements with comment between" {
2520 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
2521
23722522 try testCanonical(
23732523 \\comptime {
23742524 \\ a = b;
......@@ -2380,6 +2530,8 @@ test "zig fmt: statements with comment between" {
23802530}
23812531
23822532test "zig fmt: statements with empty line between" {
2533 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
2534
23832535 try testCanonical(
23842536 \\comptime {
23852537 \\ a = b;
......@@ -2399,6 +2551,8 @@ test "zig fmt: ptr deref operator and unwrap optional operator" {
23992551}
24002552
24012553test "zig fmt: comment after if before another if" {
2554 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
2555
24022556 try testCanonical(
24032557 \\test "aoeu" {
24042558 \\ // comment
......@@ -2421,6 +2575,8 @@ test "zig fmt: comment after if before another if" {
24212575}
24222576
24232577test "zig fmt: line comment between if block and else keyword" {
2578 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
2579
24242580 try testCanonical(
24252581 \\test "aoeu" {
24262582 \\ // cexp(finite|nan +- i inf|nan) = nan + i nan
......@@ -2442,6 +2598,8 @@ test "zig fmt: line comment between if block and else keyword" {
24422598}
24432599
24442600test "zig fmt: same line comments in expression" {
2601 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
2602
24452603 try testCanonical(
24462604 \\test "aoeu" {
24472605 \\ const x = ( // a
......@@ -2482,6 +2640,8 @@ test "zig fmt: add comma on last switch prong" {
24822640}
24832641
24842642test "zig fmt: same-line comment after a statement" {
2643 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
2644
24852645 try testCanonical(
24862646 \\test "" {
24872647 \\ a = b;
......@@ -2527,6 +2687,8 @@ test "zig fmt: same-line comment after switch prong" {
25272687}
25282688
25292689test "zig fmt: same-line comment after non-block if expression" {
2690 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
2691
25302692 try testCanonical(
25312693 \\comptime {
25322694 \\ if (sr > n_uword_bits - 1) // d > r
......@@ -2537,6 +2699,8 @@ test "zig fmt: same-line comment after non-block if expression" {
25372699}
25382700
25392701test "zig fmt: same-line comment on comptime expression" {
2702 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
2703
25402704 try testCanonical(
25412705 \\test "" {
25422706 \\ comptime assert(@typeInfo(T) == .Int); // must pass an integer to absInt
......@@ -2546,6 +2710,8 @@ test "zig fmt: same-line comment on comptime expression" {
25462710}
25472711
25482712test "zig fmt: switch with empty body" {
2713 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
2714
25492715 try testCanonical(
25502716 \\test "" {
25512717 \\ foo() catch |err| switch (err) {};
......@@ -2555,6 +2721,8 @@ test "zig fmt: switch with empty body" {
25552721}
25562722
25572723test "zig fmt: line comments in struct initializer" {
2724 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
2725
25582726 try testCanonical(
25592727 \\fn foo() void {
25602728 \\ return Self{
......@@ -2577,6 +2745,8 @@ test "zig fmt: line comments in struct initializer" {
25772745}
25782746
25792747test "zig fmt: first line comment in struct initializer" {
2748 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
2749
25802750 try testCanonical(
25812751 \\pub fn acquire(self: *Self) HeldLock {
25822752 \\ return HeldLock{
......@@ -2645,6 +2815,8 @@ test "zig fmt: union(enum(u32)) with assigned enum values" {
26452815}
26462816
26472817test "zig fmt: resume from suspend block" {
2818 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
2819
26482820 try testCanonical(
26492821 \\fn foo() void {
26502822 \\ suspend {
......@@ -2730,6 +2902,8 @@ test "zig fmt: comments before global variables" {
27302902}
27312903
27322904test "zig fmt: comments in statements" {
2905 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
2906
27332907 try testCanonical(
27342908 \\test "std" {
27352909 \\ // statement comment
......@@ -2757,6 +2931,8 @@ test "zig fmt: comments before test decl" {
27572931}
27582932
27592933test "zig fmt: preserve spacing" {
2934 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
2935
27602936 try testCanonical(
27612937 \\const std = @import("std");
27622938 \\
......@@ -2825,6 +3001,8 @@ test "zig fmt: alignment" {
28253001}
28263002
28273003test "zig fmt: C main" {
3004 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
3005
28283006 try testCanonical(
28293007 \\fn main(argc: c_int, argv: **u8) c_int {
28303008 \\ const a = b;
......@@ -2834,6 +3012,8 @@ test "zig fmt: C main" {
28343012}
28353013
28363014test "zig fmt: return" {
3015 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
3016
28373017 try testCanonical(
28383018 \\fn foo(argc: c_int, argv: **u8) c_int {
28393019 \\ return 0;
......@@ -2896,6 +3076,8 @@ test "zig fmt: slice attributes" {
28963076}
28973077
28983078test "zig fmt: test declaration" {
3079 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
3080
28993081 try testCanonical(
29003082 \\test "test name" {
29013083 \\ const a = 1;
......@@ -2906,6 +3088,8 @@ test "zig fmt: test declaration" {
29063088}
29073089
29083090test "zig fmt: infix operators" {
3091 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
3092
29093093 try testCanonical(
29103094 \\test {
29113095 \\ var i = undefined;
......@@ -2958,6 +3142,8 @@ test "zig fmt: infix operators" {
29583142}
29593143
29603144test "zig fmt: precedence" {
3145 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
3146
29613147 try testCanonical(
29623148 \\test "precedence" {
29633149 \\ a!b();
......@@ -2990,6 +3176,8 @@ test "zig fmt: precedence" {
29903176}
29913177
29923178test "zig fmt: prefix operators" {
3179 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
3180
29933181 try testCanonical(
29943182 \\test "prefix operators" {
29953183 \\ try return --%~!&0;
......@@ -2999,6 +3187,8 @@ test "zig fmt: prefix operators" {
29993187}
30003188
30013189test "zig fmt: call expression" {
3190 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
3191
30023192 try testCanonical(
30033193 \\test "test calls" {
30043194 \\ a();
......@@ -3018,6 +3208,8 @@ test "zig fmt: anytype type" {
30183208}
30193209
30203210test "zig fmt: functions" {
3211 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
3212
30213213 try testCanonical(
30223214 \\extern fn puts(s: *const u8) c_int;
30233215 \\extern "c" fn puts(s: *const u8) c_int;
......@@ -3042,6 +3234,8 @@ test "zig fmt: functions" {
30423234}
30433235
30443236test "zig fmt: multiline string" {
3237 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
3238
30453239 try testCanonical(
30463240 \\test "" {
30473241 \\ const s1 =
......@@ -3060,6 +3254,8 @@ test "zig fmt: multiline string" {
30603254}
30613255
30623256test "zig fmt: values" {
3257 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
3258
30633259 try testCanonical(
30643260 \\test "values" {
30653261 \\ 1;
......@@ -3079,6 +3275,8 @@ test "zig fmt: values" {
30793275}
30803276
30813277test "zig fmt: indexing" {
3278 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
3279
30823280 try testCanonical(
30833281 \\test "test index" {
30843282 \\ a[0];
......@@ -3099,6 +3297,8 @@ test "zig fmt: indexing" {
30993297}
31003298
31013299test "zig fmt: struct declaration" {
3300 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
3301
31023302 try testCanonical(
31033303 \\const S = struct {
31043304 \\ const Self = @This();
......@@ -3205,6 +3405,8 @@ test "zig fmt: union declaration" {
32053405}
32063406
32073407test "zig fmt: arrays" {
3408 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
3409
32083410 try testCanonical(
32093411 \\test "test array" {
32103412 \\ const a: [2]u8 = [2]u8{
......@@ -3223,6 +3425,8 @@ test "zig fmt: arrays" {
32233425}
32243426
32253427test "zig fmt: container initializers" {
3428 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
3429
32263430 try testCanonical(
32273431 \\const a0 = []u8{};
32283432 \\const a1 = []u8{1};
......@@ -3243,6 +3447,8 @@ test "zig fmt: container initializers" {
32433447}
32443448
32453449test "zig fmt: catch" {
3450 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
3451
32463452 try testCanonical(
32473453 \\test "catch" {
32483454 \\ const a: anyerror!u8 = 0;
......@@ -3258,6 +3464,8 @@ test "zig fmt: catch" {
32583464}
32593465
32603466test "zig fmt: blocks" {
3467 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
3468
32613469 try testCanonical(
32623470 \\test "blocks" {
32633471 \\ {
......@@ -3280,6 +3488,8 @@ test "zig fmt: blocks" {
32803488}
32813489
32823490test "zig fmt: switch" {
3491 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
3492
32833493 try testCanonical(
32843494 \\test "switch" {
32853495 \\ switch (0) {
......@@ -3335,6 +3545,8 @@ test "zig fmt: switch" {
33353545}
33363546
33373547test "zig fmt: switch multiline string" {
3548 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
3549
33383550 try testCanonical(
33393551 \\test "switch multiline string" {
33403552 \\ const x: u32 = 0;
......@@ -3366,6 +3578,8 @@ test "zig fmt: switch multiline string" {
33663578}
33673579
33683580test "zig fmt: while" {
3581 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
3582
33693583 try testCanonical(
33703584 \\test "while" {
33713585 \\ while (10 < 1) unreachable;
......@@ -3441,6 +3655,8 @@ test "zig fmt: while" {
34413655}
34423656
34433657test "zig fmt: for" {
3658 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
3659
34443660 try testCanonical(
34453661 \\test "for" {
34463662 \\ for (a) |v| {
......@@ -3542,6 +3758,8 @@ test "zig fmt: for" {
35423758}
35433759
35443760test "zig fmt: for if" {
3761 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
3762
35453763 try testCanonical(
35463764 \\test {
35473765 \\ for (a) |x| if (x) f(x);
......@@ -3567,6 +3785,8 @@ test "zig fmt: for if" {
35673785}
35683786
35693787test "zig fmt: if for" {
3788 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
3789
35703790 try testCanonical(
35713791 \\test {
35723792 \\ if (a) for (x) |x| f(x);
......@@ -3592,6 +3812,8 @@ test "zig fmt: if for" {
35923812}
35933813
35943814test "zig fmt: while if" {
3815 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
3816
35953817 try testCanonical(
35963818 \\test {
35973819 \\ while (a) if (x) f(x);
......@@ -3617,6 +3839,8 @@ test "zig fmt: while if" {
36173839}
36183840
36193841test "zig fmt: if while" {
3842 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
3843
36203844 try testCanonical(
36213845 \\test {
36223846 \\ if (a) while (x) : (cont) f(x);
......@@ -3642,6 +3866,8 @@ test "zig fmt: if while" {
36423866}
36433867
36443868test "zig fmt: while for" {
3869 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
3870
36453871 try testCanonical(
36463872 \\test {
36473873 \\ while (a) for (x) |x| f(x);
......@@ -3667,6 +3893,8 @@ test "zig fmt: while for" {
36673893}
36683894
36693895test "zig fmt: for while" {
3896 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
3897
36703898 try testCanonical(
36713899 \\test {
36723900 \\ for (a) |a| while (x) |x| f(x);
......@@ -3692,6 +3920,8 @@ test "zig fmt: for while" {
36923920}
36933921
36943922test "zig fmt: if" {
3923 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
3924
36953925 try testCanonical(
36963926 \\test "if" {
36973927 \\ if (10 < 0) {
......@@ -3741,6 +3971,8 @@ test "zig fmt: if" {
37413971}
37423972
37433973test "zig fmt: fix single statement if/for/while line breaks" {
3974 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
3975
37443976 try testTransform(
37453977 \\test {
37463978 \\ if (cond) a
......@@ -3793,6 +4025,8 @@ test "zig fmt: fix single statement if/for/while line breaks" {
37934025}
37944026
37954027test "zig fmt: anon struct/array literal in if" {
4028 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
4029
37964030 try testCanonical(
37974031 \\test {
37984032 \\ const a = if (cond) .{
......@@ -3817,6 +4051,8 @@ test "zig fmt: anon struct/array literal in if" {
38174051}
38184052
38194053test "zig fmt: defer" {
4054 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
4055
38204056 try testCanonical(
38214057 \\test "defer" {
38224058 \\ var i: usize = 0;
......@@ -3837,6 +4073,8 @@ test "zig fmt: defer" {
38374073}
38384074
38394075test "zig fmt: comptime" {
4076 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
4077
38404078 try testCanonical(
38414079 \\fn a() u8 {
38424080 \\ return 5;
......@@ -3876,6 +4114,8 @@ test "zig fmt: comptime" {
38764114}
38774115
38784116test "zig fmt: fn type" {
4117 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
4118
38794119 try testCanonical(
38804120 \\fn a(i: u8) u8 {
38814121 \\ return i + 1;
......@@ -3889,6 +4129,8 @@ test "zig fmt: fn type" {
38894129}
38904130
38914131test "zig fmt: inline asm" {
4132 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
4133
38924134 try testCanonical(
38934135 \\pub fn syscall1(number: usize, arg1: usize) usize {
38944136 \\ return asm volatile ("syscall"
......@@ -3903,6 +4145,8 @@ test "zig fmt: inline asm" {
39034145}
39044146
39054147test "zig fmt: async functions" {
4148 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
4149
39064150 try testCanonical(
39074151 \\fn simpleAsyncFn() void {
39084152 \\ const a = async a.b();
......@@ -3931,6 +4175,8 @@ test "zig fmt: nosuspend" {
39314175}
39324176
39334177test "zig fmt: Block after if" {
4178 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
4179
39344180 try testCanonical(
39354181 \\test {
39364182 \\ if (true) {
......@@ -3962,6 +4208,8 @@ test "zig fmt: string identifier" {
39624208}
39634209
39644210test "zig fmt: error return" {
4211 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
4212
39654213 try testCanonical(
39664214 \\fn err() anyerror {
39674215 \\ call();
......@@ -3972,6 +4220,8 @@ test "zig fmt: error return" {
39724220}
39734221
39744222test "zig fmt: comptime block in container" {
4223 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
4224
39754225 try testCanonical(
39764226 \\pub fn container() type {
39774227 \\ return struct {
......@@ -3987,6 +4237,8 @@ test "zig fmt: comptime block in container" {
39874237}
39884238
39894239test "zig fmt: inline asm parameter alignment" {
4240 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
4241
39904242 try testCanonical(
39914243 \\pub fn main() void {
39924244 \\ asm volatile (
......@@ -4025,6 +4277,8 @@ test "zig fmt: inline asm parameter alignment" {
40254277}
40264278
40274279test "zig fmt: multiline string in array" {
4280 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
4281
40284282 try testCanonical(
40294283 \\const Foo = [][]const u8{
40304284 \\ \\aaa
......@@ -4050,6 +4304,8 @@ test "zig fmt: multiline string in array" {
40504304}
40514305
40524306test "zig fmt: if type expr" {
4307 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
4308
40534309 try testCanonical(
40544310 \\const mycond = true;
40554311 \\pub fn foo() if (mycond) i32 else void {
......@@ -4078,6 +4334,8 @@ test "zig fmt: comment after empty comment" {
40784334}
40794335
40804336test "zig fmt: line comment in array" {
4337 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
4338
40814339 try testTransform(
40824340 \\test "a" {
40834341 \\ var arr = [_]u32{
......@@ -4136,6 +4394,8 @@ test "zig fmt: comment after params" {
41364394}
41374395
41384396test "zig fmt: comment in array initializer/access" {
4397 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
4398
41394399 try testCanonical(
41404400 \\test "a" {
41414401 \\ var a = x{ //aa
......@@ -4172,6 +4432,8 @@ test "zig fmt: comment in array initializer/access" {
41724432}
41734433
41744434test "zig fmt: comments at several places in struct init" {
4435 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
4436
41754437 try testTransform(
41764438 \\var bar = Bar{
41774439 \\ .x = 10, // test
......@@ -4395,6 +4657,8 @@ test "zig fmt: integer literals with underscore separators" {
43954657}
43964658
43974659test "zig fmt: hex literals with underscore separators" {
4660 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
4661
43984662 try testTransform(
43994663 \\pub fn orMask(a: [ 1_000 ]u64, b: [ 1_000] u64) [1_000]u64 {
44004664 \\ var c: [1_000]u64 = [1]u64{ 0xFFFF_FFFF_FFFF_FFFF}**1_000;
......@@ -4418,6 +4682,8 @@ test "zig fmt: hex literals with underscore separators" {
44184682}
44194683
44204684test "zig fmt: decimal float literals with underscore separators" {
4685 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
4686
44214687 try testTransform(
44224688 \\pub fn main() void {
44234689 \\ const a:f64=(10.0e-0+(10.0e+0))+10_00.00_00e-2+20_00.00_10e+4;
......@@ -4435,6 +4701,8 @@ test "zig fmt: decimal float literals with underscore separators" {
44354701}
44364702
44374703test "zig fmt: hexadeciaml float literals with underscore separators" {
4704 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
4705
44384706 try testTransform(
44394707 \\pub fn main() void {
44404708 \\ const a: f64 = (0x10.0p-0+(0x10.0p+0))+0x10_00.00_00p-8+0x00_00.00_10p+16;
......@@ -4459,6 +4727,8 @@ test "zig fmt: C var args" {
44594727}
44604728
44614729test "zig fmt: Only indent multiline string literals in function calls" {
4730 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
4731
44624732 try testCanonical(
44634733 \\test "zig fmt:" {
44644734 \\ try testTransform(
......@@ -4476,6 +4746,8 @@ test "zig fmt: Only indent multiline string literals in function calls" {
44764746}
44774747
44784748test "zig fmt: Don't add extra newline after if" {
4749 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
4750
44794751 try testCanonical(
44804752 \\pub fn atomicSymLink(allocator: Allocator, existing_path: []const u8, new_path: []const u8) !void {
44814753 \\ if (cwd().symLink(existing_path, new_path, .{})) {
......@@ -4487,6 +4759,8 @@ test "zig fmt: Don't add extra newline after if" {
44874759}
44884760
44894761test "zig fmt: comments in ternary ifs" {
4762 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
4763
44904764 try testCanonical(
44914765 \\const x = if (true) {
44924766 \\ 1;
......@@ -4506,6 +4780,8 @@ test "zig fmt: comments in ternary ifs" {
45064780}
45074781
45084782test "zig fmt: while statement in blockless if" {
4783 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
4784
45094785 try testCanonical(
45104786 \\pub fn main() void {
45114787 \\ const zoom_node = if (focused_node == layout_first)
......@@ -4555,6 +4831,8 @@ test "zig fmt: test comments in field access chain" {
45554831}
45564832
45574833test "zig fmt: allow line break before field access" {
4834 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
4835
45584836 try testCanonical(
45594837 \\test {
45604838 \\ const w = foo.bar().zippy(zag).iguessthisisok();
......@@ -4603,6 +4881,8 @@ test "zig fmt: allow line break before field access" {
46034881}
46044882
46054883test "zig fmt: Indent comma correctly after multiline string literals in arg list (trailing comma)" {
4884 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
4885
46064886 try testCanonical(
46074887 \\fn foo() void {
46084888 \\ z.display_message_dialog(
......@@ -4628,6 +4908,8 @@ test "zig fmt: Indent comma correctly after multiline string literals in arg lis
46284908}
46294909
46304910test "zig fmt: Control flow statement as body of blockless if" {
4911 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
4912
46314913 try testCanonical(
46324914 \\pub fn main() void {
46334915 \\ const zoom_node = if (focused_node == layout_first)
......@@ -4663,6 +4945,8 @@ test "zig fmt: Control flow statement as body of blockless if" {
46634945}
46644946
46654947test "zig fmt: regression test for #5722" {
4948 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
4949
46664950 try testCanonical(
46674951 \\pub fn sendViewTags(self: Self) void {
46684952 \\ var it = ViewStack(View).iterator(self.output.views.first, std.math.maxInt(u32));
......@@ -4685,6 +4969,8 @@ test "zig fmt: regression test for #8974" {
46854969}
46864970
46874971test "zig fmt: allow trailing line comments to do manual array formatting" {
4972 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
4973
46884974 try testCanonical(
46894975 \\fn foo() void {
46904976 \\ self.code.appendSliceAssumeCapacity(&[_]u8{
......@@ -4723,6 +5009,8 @@ test "zig fmt: allow trailing line comments to do manual array formatting" {
47235009}
47245010
47255011test "zig fmt: multiline string literals should play nice with array initializers" {
5012 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
5013
47265014 try testCanonical(
47275015 \\fn main() void {
47285016 \\ var a = .{.{.{.{.{.{.{.{
......@@ -4789,6 +5077,8 @@ test "zig fmt: multiline string literals should play nice with array initializer
47895077}
47905078
47915079test "zig fmt: use of comments and multiline string literals may force the parameters over multiple lines" {
5080 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
5081
47925082 try testCanonical(
47935083 \\pub fn makeMemUndefined(qzz: []u8) i1 {
47945084 \\ cases.add( // fixed bug foo
......@@ -4829,6 +5119,8 @@ test "zig fmt: use of comments and multiline string literals may force the param
48295119}
48305120
48315121test "zig fmt: single argument trailing commas in @builtins()" {
5122 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
5123
48325124 try testCanonical(
48335125 \\pub fn foo(qzz: []u8) i1 {
48345126 \\ @panic(
......@@ -4862,6 +5154,8 @@ test "zig fmt: trailing comma should force multiline 1 column" {
48625154}
48635155
48645156test "zig fmt: function params should align nicely" {
5157 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
5158
48655159 try testCanonical(
48665160 \\pub fn foo() void {
48675161 \\ cases.addRuntimeSafety("slicing operator with sentinel",
......@@ -4918,6 +5212,8 @@ test "zig fmt: remove trailing whitespace after doc comment" {
49185212}
49195213
49205214test "zig fmt: for loop with ptr payload and index" {
5215 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
5216
49215217 try testCanonical(
49225218 \\test {
49235219 \\ for (self.entries.items, 0..) |*item, i| {}
......@@ -4930,6 +5226,8 @@ test "zig fmt: for loop with ptr payload and index" {
49305226}
49315227
49325228test "zig fmt: proper indent line comment after multi-line single expr while loop" {
5229 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
5230
49335231 try testCanonical(
49345232 \\test {
49355233 \\ while (a) : (b)
......@@ -4943,6 +5241,8 @@ test "zig fmt: proper indent line comment after multi-line single expr while loo
49435241}
49445242
49455243test "zig fmt: function with labeled block as return type" {
5244 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
5245
49465246 try testCanonical(
49475247 \\fn foo() t: {
49485248 \\ break :t bar;
......@@ -4965,6 +5265,8 @@ test "zig fmt: extern function with missing param name" {
49655265}
49665266
49675267test "zig fmt: line comment after multiline single expr if statement with multiline string" {
5268 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
5269
49685270 try testCanonical(
49695271 \\test {
49705272 \\ if (foo)
......@@ -4997,6 +5299,8 @@ test "zig fmt: line comment after multiline single expr if statement with multil
49975299}
49985300
49995301test "zig fmt: respect extra newline between fn and pub usingnamespace" {
5302 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
5303
50005304 try testCanonical(
50015305 \\fn foo() void {
50025306 \\ bar();
......@@ -5121,6 +5425,8 @@ test "zig fmt: insert trailing comma if comments in array init" {
51215425}
51225426
51235427test "zig fmt: make single-line if no trailing comma" {
5428 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
5429
51245430 try testTransform(
51255431 \\test "function call no trailing comma" {
51265432 \\ foo(
......@@ -5300,6 +5606,8 @@ test "zig fmt: missing const/var before local variable" {
53005606}
53015607
53025608test "zig fmt: while continue expr" {
5609 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
5610
53035611 try testCanonical(
53045612 \\test {
53055613 \\ while (i > 0)
......@@ -5319,6 +5627,8 @@ test "zig fmt: while continue expr" {
53195627}
53205628
53215629test "zig fmt: canonicalize symbols (simple)" {
5630 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
5631
53225632 try testTransform(
53235633 \\const val_normal: Normal = .{};
53245634 \\const @"val_unesc_me": @"UnescMe" = .{};
......@@ -5468,6 +5778,8 @@ test "zig fmt: canonicalize symbols (simple)" {
54685778
54695779// Contextually unescape when shadowing primitive types and values.
54705780test "zig fmt: canonicalize symbols (primitive types)" {
5781 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
5782
54715783 try testTransform(
54725784 \\const @"anyopaque" = struct {
54735785 \\ @"u8": @"type" = true,
......@@ -5577,6 +5889,8 @@ test "zig fmt: canonicalize symbols (primitive types)" {
55775889
55785890// Never unescape names spelled like keywords.
55795891test "zig fmt: canonicalize symbols (keywords)" {
5892 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
5893
55805894 try testCanonical(
55815895 \\const @"enum" = struct {
55825896 \\ @"error": @"struct" = true,
......@@ -5604,6 +5918,8 @@ test "zig fmt: canonicalize symbols (keywords)" {
56045918}
56055919
56065920test "zig fmt: no space before newline before multiline string" {
5921 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
5922
56075923 try testCanonical(
56085924 \\const S = struct {
56095925 \\ text: []const u8,
......@@ -5634,6 +5950,8 @@ test "zig fmt: no space before newline before multiline string" {
56345950
56355951// Normalize \xNN and \u{NN} escapes and unicode inside @"" escapes.
56365952test "zig fmt: canonicalize symbols (character escapes)" {
5953 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
5954
56375955 try testTransform(
56385956 \\const @"\x46\x6f\x6f\x64" = struct {
56395957 \\ @"\x62\x61\x72\x6E": @"\x43\x72\x61\x62" = false,
......@@ -5676,6 +5994,8 @@ test "zig fmt: canonicalize symbols (character escapes)" {
56765994}
56775995
56785996test "zig fmt: canonicalize symbols (asm)" {
5997 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
5998
56795999 try testTransform(
56806000 \\test "asm" {
56816001 \\ const @"null" = usize;
src/arch/x86_64/CodeGen.zig+8-4
......@@ -2293,7 +2293,11 @@ fn genLazy(self: *Self, lazy_sym: link.File.LazySymbol) InnerError!void {
22932293 }
22942294}
22952295
2296fn getValue(self: *Self, value: MCValue, inst: ?Air.Inst.Index) void {
2296fn getValue(self: *Self, value: MCValue, inst: ?Air.Inst.Index) !void {
2297 for (value.getRegs()) |reg| try self.register_manager.getReg(reg, inst);
2298}
2299
2300fn getValueIfFree(self: *Self, value: MCValue, inst: ?Air.Inst.Index) void {
22972301 for (value.getRegs()) |reg| if (self.register_manager.isRegFree(reg))
22982302 self.register_manager.getRegAssumeFree(reg, inst);
22992303}
......@@ -2341,7 +2345,7 @@ fn finishAirResult(self: *Self, inst: Air.Inst.Index, result: MCValue) void {
23412345 // In some cases, an operand may be reused as the result.
23422346 // If that operand died and was a register, it was freed by
23432347 // processDeath, so we have to "re-allocate" the register.
2344 self.getValue(result, inst);
2348 self.getValueIfFree(result, inst);
23452349 }
23462350 self.finishAirBookkeeping();
23472351}
......@@ -11017,7 +11021,7 @@ fn airBlock(self: *Self, inst: Air.Inst.Index) !void {
1101711021 if (std.debug.runtime_safety) assert(self.inst_tracking.getIndex(inst).? == inst_tracking_i);
1101811022 const tracking = &self.inst_tracking.values()[inst_tracking_i];
1101911023 if (self.liveness.isUnused(inst)) try tracking.die(self, inst);
11020 self.getValue(tracking.short, inst);
11024 self.getValueIfFree(tracking.short, inst);
1102111025 self.finishAirBookkeeping();
1102211026}
1102311027
......@@ -11131,7 +11135,7 @@ fn airBr(self: *Self, inst: Air.Inst.Index) !void {
1113111135 }
1113211136
1113311137 const dst_mcv = if (first_br) try self.allocRegOrMem(br.block_inst, true) else dst: {
11134 self.getValue(block_tracking.short, br.block_inst);
11138 try self.getValue(block_tracking.short, br.block_inst);
1113511139 break :dst block_tracking.short;
1113611140 };
1113711141 try self.genCopy(block_ty, dst_mcv, src_mcv);