authorgravatar for joachim.schmidt557@outlook.comJoachim Schmidt <joachim.schmidt557@outlook.com> 2022-03-05 11:31:51+01:00
committergravatar for joachim.schmidt557@outlook.comJoachim Schmidt <joachim.schmidt557@outlook.com> 2022-03-05 11:31:51+01:00
loga06e9eca45f72b28ed9ca00da5c9562e969cc84d
treeeebd5b573c86e1ec206e5a57328c3649a05002e0
parented7e2938ff2385d658f04248f1c757b324009be4
signaturelock-open Commit is signed but in an unrecognized format.

stage2 AArch64: add more slice support

* airSlice * airArrayToSlice * and initial support for airSlicePtr and co

27 files changed, 71 insertions(+), 180 deletions(-)

src/arch/aarch64/CodeGen.zig+71-12
...@@ -818,9 +818,7 @@ fn allocRegOrMem(self: *Self, inst: Air.Inst.Index, reg_ok: bool) !MCValue {...@@ -818,9 +818,7 @@ fn allocRegOrMem(self: *Self, inst: Air.Inst.Index, reg_ok: bool) !MCValue {
818818
819 if (reg_ok) {819 if (reg_ok) {
820 // Make sure the type can fit in a register before we try to allocate one.820 // Make sure the type can fit in a register before we try to allocate one.
821 const ptr_bits = self.target.cpu.arch.ptrBitWidth();821 if (abi_size <= 8) {
822 const ptr_bytes: u64 = @divExact(ptr_bits, 8);
823 if (abi_size <= ptr_bytes) {
824 if (self.register_manager.tryAllocReg(inst)) |reg| {822 if (self.register_manager.tryAllocReg(inst)) |reg| {
825 return MCValue{ .register = registerAlias(reg, abi_size) };823 return MCValue{ .register = registerAlias(reg, abi_size) };
826 }824 }
...@@ -1038,7 +1036,20 @@ fn airMax(self: *Self, inst: Air.Inst.Index) !void {...@@ -1038,7 +1036,20 @@ fn airMax(self: *Self, inst: Air.Inst.Index) !void {
1038fn airSlice(self: *Self, inst: Air.Inst.Index) !void {1036fn airSlice(self: *Self, inst: Air.Inst.Index) !void {
1039 const ty_pl = self.air.instructions.items(.data)[inst].ty_pl;1037 const ty_pl = self.air.instructions.items(.data)[inst].ty_pl;
1040 const bin_op = self.air.extraData(Air.Bin, ty_pl.payload).data;1038 const bin_op = self.air.extraData(Air.Bin, ty_pl.payload).data;
1041 const result: MCValue = if (self.liveness.isUnused(inst)) .dead else return self.fail("TODO implement slice for {}", .{self.target.cpu.arch});1039 const result: MCValue = if (self.liveness.isUnused(inst)) .dead else result: {
1040 const ptr = try self.resolveInst(bin_op.lhs);
1041 const ptr_ty = self.air.typeOf(bin_op.lhs);
1042 const len = try self.resolveInst(bin_op.rhs);
1043 const len_ty = self.air.typeOf(bin_op.rhs);
1044
1045 const ptr_bits = self.target.cpu.arch.ptrBitWidth();
1046 const ptr_bytes = @divExact(ptr_bits, 8);
1047
1048 const stack_offset = try self.allocMem(inst, ptr_bytes * 2, ptr_bytes * 2);
1049 try self.genSetStack(ptr_ty, stack_offset + ptr_bytes, ptr);
1050 try self.genSetStack(len_ty, stack_offset, len);
1051 break :result MCValue{ .stack_offset = stack_offset };
1052 };
1042 return self.finishAir(inst, result, .{ bin_op.lhs, bin_op.rhs, .none });1053 return self.finishAir(inst, result, .{ bin_op.lhs, bin_op.rhs, .none });
1043}1054}
10441055
...@@ -1602,22 +1613,39 @@ fn airWrapErrUnionErr(self: *Self, inst: Air.Inst.Index) !void {...@@ -1602,22 +1613,39 @@ fn airWrapErrUnionErr(self: *Self, inst: Air.Inst.Index) !void {
16021613
1603fn airSlicePtr(self: *Self, inst: Air.Inst.Index) !void {1614fn airSlicePtr(self: *Self, inst: Air.Inst.Index) !void {
1604 const ty_op = self.air.instructions.items(.data)[inst].ty_op;1615 const ty_op = self.air.instructions.items(.data)[inst].ty_op;
1605 const result: MCValue = if (self.liveness.isUnused(inst)) .dead else return self.fail("TODO implement slice_ptr for {}", .{self.target.cpu.arch});1616 const result: MCValue = if (self.liveness.isUnused(inst)) .dead else result: {
1617 const ptr_bits = self.target.cpu.arch.ptrBitWidth();
1618 const ptr_bytes = @divExact(ptr_bits, 8);
1619 const mcv = try self.resolveInst(ty_op.operand);
1620 switch (mcv) {
1621 .dead, .unreach, .none => unreachable,
1622 .register => unreachable, // a slice doesn't fit in one register
1623 .stack_offset => |off| {
1624 break :result MCValue{ .stack_offset = off + ptr_bytes };
1625 },
1626 .memory => |addr| {
1627 break :result MCValue{ .memory = addr };
1628 },
1629 else => return self.fail("TODO implement slice_len for {}", .{mcv}),
1630 }
1631 };
1606 return self.finishAir(inst, result, .{ ty_op.operand, .none, .none });1632 return self.finishAir(inst, result, .{ ty_op.operand, .none, .none });
1607}1633}
16081634
1609fn airSliceLen(self: *Self, inst: Air.Inst.Index) !void {1635fn airSliceLen(self: *Self, inst: Air.Inst.Index) !void {
1610 const ty_op = self.air.instructions.items(.data)[inst].ty_op;1636 const ty_op = self.air.instructions.items(.data)[inst].ty_op;
1611 const result: MCValue = if (self.liveness.isUnused(inst)) .dead else result: {1637 const result: MCValue = if (self.liveness.isUnused(inst)) .dead else result: {
1638 const ptr_bits = self.target.cpu.arch.ptrBitWidth();
1639 const ptr_bytes = @divExact(ptr_bits, 8);
1612 const mcv = try self.resolveInst(ty_op.operand);1640 const mcv = try self.resolveInst(ty_op.operand);
1613 switch (mcv) {1641 switch (mcv) {
1614 .dead, .unreach => unreachable,1642 .dead, .unreach, .none => unreachable,
1615 .register => unreachable, // a slice doesn't fit in one register1643 .register => unreachable, // a slice doesn't fit in one register
1616 .stack_offset => |off| {1644 .stack_offset => |off| {
1617 break :result MCValue{ .stack_offset = off };1645 break :result MCValue{ .stack_offset = off };
1618 },1646 },
1619 .memory => |addr| {1647 .memory => |addr| {
1620 break :result MCValue{ .memory = addr + 8 };1648 break :result MCValue{ .memory = addr + ptr_bytes };
1621 },1649 },
1622 else => return self.fail("TODO implement slice_len for {}", .{mcv}),1650 else => return self.fail("TODO implement slice_len for {}", .{mcv}),
1623 }1651 }
...@@ -1627,13 +1655,33 @@ fn airSliceLen(self: *Self, inst: Air.Inst.Index) !void {...@@ -1627,13 +1655,33 @@ fn airSliceLen(self: *Self, inst: Air.Inst.Index) !void {
16271655
1628fn airPtrSliceLenPtr(self: *Self, inst: Air.Inst.Index) !void {1656fn airPtrSliceLenPtr(self: *Self, inst: Air.Inst.Index) !void {
1629 const ty_op = self.air.instructions.items(.data)[inst].ty_op;1657 const ty_op = self.air.instructions.items(.data)[inst].ty_op;
1630 const result: MCValue = if (self.liveness.isUnused(inst)) .dead else return self.fail("TODO implement ptr_slice_len_ptr for {}", .{self.target.cpu.arch});1658 const result: MCValue = if (self.liveness.isUnused(inst)) .dead else result: {
1659 const ptr_bits = self.target.cpu.arch.ptrBitWidth();
1660 const ptr_bytes = @divExact(ptr_bits, 8);
1661 const mcv = try self.resolveInst(ty_op.operand);
1662 switch (mcv) {
1663 .dead, .unreach, .none => unreachable,
1664 .ptr_stack_offset => |off| {
1665 break :result MCValue{ .ptr_stack_offset = off + ptr_bytes };
1666 },
1667 else => return self.fail("TODO implement ptr_slice_len_ptr for {}", .{mcv}),
1668 }
1669 };
1631 return self.finishAir(inst, result, .{ ty_op.operand, .none, .none });1670 return self.finishAir(inst, result, .{ ty_op.operand, .none, .none });
1632}1671}
16331672
1634fn airPtrSlicePtrPtr(self: *Self, inst: Air.Inst.Index) !void {1673fn airPtrSlicePtrPtr(self: *Self, inst: Air.Inst.Index) !void {
1635 const ty_op = self.air.instructions.items(.data)[inst].ty_op;1674 const ty_op = self.air.instructions.items(.data)[inst].ty_op;
1636 const result: MCValue = if (self.liveness.isUnused(inst)) .dead else return self.fail("TODO implement ptr_slice_ptr_ptr for {}", .{self.target.cpu.arch});1675 const result: MCValue = if (self.liveness.isUnused(inst)) .dead else result: {
1676 const mcv = try self.resolveInst(ty_op.operand);
1677 switch (mcv) {
1678 .dead, .unreach, .none => unreachable,
1679 .ptr_stack_offset => |off| {
1680 break :result MCValue{ .ptr_stack_offset = off };
1681 },
1682 else => return self.fail("TODO implement ptr_slice_len_ptr for {}", .{mcv}),
1683 }
1684 };
1637 return self.finishAir(inst, result, .{ ty_op.operand, .none, .none });1685 return self.finishAir(inst, result, .{ ty_op.operand, .none, .none });
1638}1686}
16391687
...@@ -3475,9 +3523,20 @@ fn airBitCast(self: *Self, inst: Air.Inst.Index) !void {...@@ -3475,9 +3523,20 @@ fn airBitCast(self: *Self, inst: Air.Inst.Index) !void {
34753523
3476fn airArrayToSlice(self: *Self, inst: Air.Inst.Index) !void {3524fn airArrayToSlice(self: *Self, inst: Air.Inst.Index) !void {
3477 const ty_op = self.air.instructions.items(.data)[inst].ty_op;3525 const ty_op = self.air.instructions.items(.data)[inst].ty_op;
3478 const result: MCValue = if (self.liveness.isUnused(inst)) .dead else return self.fail("TODO implement airArrayToSlice for {}", .{3526 const result: MCValue = if (self.liveness.isUnused(inst)) .dead else result: {
3479 self.target.cpu.arch,3527 const ptr_ty = self.air.typeOf(ty_op.operand);
3480 });3528 const ptr = try self.resolveInst(ty_op.operand);
3529 const array_ty = ptr_ty.childType();
3530 const array_len = @intCast(u32, array_ty.arrayLen());
3531
3532 const ptr_bits = self.target.cpu.arch.ptrBitWidth();
3533 const ptr_bytes = @divExact(ptr_bits, 8);
3534
3535 const stack_offset = try self.allocMem(inst, ptr_bytes * 2, ptr_bytes * 2);
3536 try self.genSetStack(ptr_ty, stack_offset + ptr_bytes, ptr);
3537 try self.genSetStack(Type.initTag(.usize), stack_offset, .{ .immediate = array_len });
3538 break :result MCValue{ .stack_offset = stack_offset };
3539 };
3481 return self.finishAir(inst, result, .{ ty_op.operand, .none, .none });3540 return self.finishAir(inst, result, .{ ty_op.operand, .none, .none });
3482}3541}
34833542
test/behavior/align.zig-1
...@@ -269,7 +269,6 @@ fn whyWouldYouEverDoThis(comptime align_bytes: u8) align(align_bytes) u8 {...@@ -269,7 +269,6 @@ fn whyWouldYouEverDoThis(comptime align_bytes: u8) align(align_bytes) u8 {
269269
270test "runtime known array index has best alignment possible" {270test "runtime known array index has best alignment possible" {
271 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO271 if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
272 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
273 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO272 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO
274273
275 // take full advantage of over-alignment274 // take full advantage of over-alignment
test/behavior/array.zig-2
...@@ -142,8 +142,6 @@ test "array with sentinels" {...@@ -142,8 +142,6 @@ test "array with sentinels" {
142}142}
143143
144test "void arrays" {144test "void arrays" {
145 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
146
147 var array: [4]void = undefined;145 var array: [4]void = undefined;
148 array[0] = void{};146 array[0] = void{};
149 array[1] = array[2];147 array[1] = array[2];
test/behavior/bitcast.zig-10
...@@ -75,8 +75,6 @@ fn conv_uN(comptime N: usize, x: std.meta.Int(.unsigned, N)) std.meta.Int(.signe...@@ -75,8 +75,6 @@ fn conv_uN(comptime N: usize, x: std.meta.Int(.unsigned, N)) std.meta.Int(.signe
75}75}
7676
77test "nested bitcast" {77test "nested bitcast" {
78 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
79
80 const S = struct {78 const S = struct {
81 fn moo(x: isize) !void {79 fn moo(x: isize) !void {
82 try expect(@intCast(isize, 42) == x);80 try expect(@intCast(isize, 42) == x);
...@@ -94,8 +92,6 @@ test "nested bitcast" {...@@ -94,8 +92,6 @@ test "nested bitcast" {
94}92}
9593
96test "@bitCast enum to its integer type" {94test "@bitCast enum to its integer type" {
97 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
98
99 const SOCK = enum(c_int) {95 const SOCK = enum(c_int) {
100 A,96 A,
101 B,97 B,
...@@ -113,15 +109,11 @@ test "@bitCast enum to its integer type" {...@@ -113,15 +109,11 @@ test "@bitCast enum to its integer type" {
113109
114// issue #3010: compiler segfault110// issue #3010: compiler segfault
115test "bitcast literal [4]u8 param to u32" {111test "bitcast literal [4]u8 param to u32" {
116 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
117
118 const ip = @bitCast(u32, [_]u8{ 255, 255, 255, 255 });112 const ip = @bitCast(u32, [_]u8{ 255, 255, 255, 255 });
119 try expect(ip == maxInt(u32));113 try expect(ip == maxInt(u32));
120}114}
121115
122test "bitcast generates a temporary value" {116test "bitcast generates a temporary value" {
123 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
124
125 var y = @as(u16, 0x55AA);117 var y = @as(u16, 0x55AA);
126 const x = @bitCast(u16, @bitCast([2]u8, y));118 const x = @bitCast(u16, @bitCast([2]u8, y));
127 try expect(y == x);119 try expect(y == x);
...@@ -240,7 +232,6 @@ test "implicit cast to error union by returning" {...@@ -240,7 +232,6 @@ test "implicit cast to error union by returning" {
240test "bitcast packed struct literal to byte" {232test "bitcast packed struct literal to byte" {
241 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest;233 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest;
242 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;234 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
243 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
244235
245 const Foo = packed struct {236 const Foo = packed struct {
246 value: u8,237 value: u8,
...@@ -252,7 +243,6 @@ test "bitcast packed struct literal to byte" {...@@ -252,7 +243,6 @@ test "bitcast packed struct literal to byte" {
252test "comptime bitcast used in expression has the correct type" {243test "comptime bitcast used in expression has the correct type" {
253 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest;244 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest;
254 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;245 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
255 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
256246
257 const Foo = packed struct {247 const Foo = packed struct {
258 value: u8,248 value: u8,
test/behavior/bugs/3367.zig-1
...@@ -10,7 +10,6 @@ const Mixin = struct {...@@ -10,7 +10,6 @@ const Mixin = struct {
10};10};
1111
12test "container member access usingnamespace decls" {12test "container member access usingnamespace decls" {
13 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
14 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;13 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
15 var foo = Foo{};14 var foo = Foo{};
16 foo.two();15 foo.two();
test/behavior/bugs/3586.zig-2
...@@ -7,8 +7,6 @@ const Container = struct {...@@ -7,8 +7,6 @@ const Container = struct {
7};7};
88
9test "fixed" {9test "fixed" {
10 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
11
12 var ctr = Container{10 var ctr = Container{
13 .params = NoteParams{},11 .params = NoteParams{},
14 };12 };
test/behavior/bugs/704.zig-2
...@@ -6,8 +6,6 @@ const xxx = struct {...@@ -6,8 +6,6 @@ const xxx = struct {
6 }6 }
7};7};
8test "bug 704" {8test "bug 704" {
9 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
10
11 var x: xxx = undefined;9 var x: xxx = undefined;
12 x.bar();10 x.bar();
13}11}
test/behavior/cast.zig-2
...@@ -984,7 +984,6 @@ test "peer type resolve array pointers, one of them const" {...@@ -984,7 +984,6 @@ test "peer type resolve array pointers, one of them const" {
984test "peer type resolve array pointer and unknown pointer" {984test "peer type resolve array pointer and unknown pointer" {
985 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO985 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
986 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO986 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
987 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
988 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO987 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
989 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO988 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO
990989
...@@ -1255,7 +1254,6 @@ test "assignment to optional pointer result loc" {...@@ -1255,7 +1254,6 @@ test "assignment to optional pointer result loc" {
1255}1254}
12561255
1257test "cast between *[N]void and []void" {1256test "cast between *[N]void and []void" {
1258 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
1259 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO1257 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
12601258
1261 var a: [4]void = undefined;1259 var a: [4]void = undefined;
test/behavior/defer.zig-4
...@@ -5,8 +5,6 @@ const expectEqual = std.testing.expectEqual;...@@ -5,8 +5,6 @@ const expectEqual = std.testing.expectEqual;
5const expectError = std.testing.expectError;5const expectError = std.testing.expectError;
66
7test "break and continue inside loop inside defer expression" {7test "break and continue inside loop inside defer expression" {
8 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
9
10 testBreakContInDefer(10);8 testBreakContInDefer(10);
11 comptime testBreakContInDefer(10);9 comptime testBreakContInDefer(10);
12}10}
...@@ -23,8 +21,6 @@ fn testBreakContInDefer(x: usize) void {...@@ -23,8 +21,6 @@ fn testBreakContInDefer(x: usize) void {
23}21}
2422
25test "defer and labeled break" {23test "defer and labeled break" {
26 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
27
28 var i = @as(usize, 0);24 var i = @as(usize, 0);
2925
30 blk: {26 blk: {
test/behavior/enum.zig-40
...@@ -11,8 +11,6 @@ fn shouldEqual(n: Number, expected: u3) !void {...@@ -11,8 +11,6 @@ fn shouldEqual(n: Number, expected: u3) !void {
11}11}
1212
13test "enum to int" {13test "enum to int" {
14 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
15
16 try shouldEqual(Number.Zero, 0);14 try shouldEqual(Number.Zero, 0);
17 try shouldEqual(Number.One, 1);15 try shouldEqual(Number.One, 1);
18 try shouldEqual(Number.Two, 2);16 try shouldEqual(Number.Two, 2);
...@@ -558,8 +556,6 @@ const ValueCount257 = enum {...@@ -558,8 +556,6 @@ const ValueCount257 = enum {
558};556};
559557
560test "enum sizes" {558test "enum sizes" {
561 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
562
563 comptime {559 comptime {
564 try expect(@sizeOf(ValueCount1) == 0);560 try expect(@sizeOf(ValueCount1) == 0);
565 try expect(@sizeOf(ValueCount2) == 1);561 try expect(@sizeOf(ValueCount2) == 1);
...@@ -569,8 +565,6 @@ test "enum sizes" {...@@ -569,8 +565,6 @@ test "enum sizes" {
569}565}
570566
571test "enum literal equality" {567test "enum literal equality" {
572 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
573
574 const x = .hi;568 const x = .hi;
575 const y = .ok;569 const y = .ok;
576 const z = .hi;570 const z = .hi;
...@@ -580,8 +574,6 @@ test "enum literal equality" {...@@ -580,8 +574,6 @@ test "enum literal equality" {
580}574}
581575
582test "enum literal cast to enum" {576test "enum literal cast to enum" {
583 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
584
585 const Color = enum { Auto, Off, On };577 const Color = enum { Auto, Off, On };
586578
587 var color1: Color = .Auto;579 var color1: Color = .Auto;
...@@ -590,8 +582,6 @@ test "enum literal cast to enum" {...@@ -590,8 +582,6 @@ test "enum literal cast to enum" {
590}582}
591583
592test "peer type resolution with enum literal" {584test "peer type resolution with enum literal" {
593 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
594
595 const Items = enum { one, two };585 const Items = enum { one, two };
596586
597 try expect(Items.two == .two);587 try expect(Items.two == .two);
...@@ -668,8 +658,6 @@ test "non-exhaustive enum" {...@@ -668,8 +658,6 @@ test "non-exhaustive enum" {
668}658}
669659
670test "empty non-exhaustive enum" {660test "empty non-exhaustive enum" {
671 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
672
673 const S = struct {661 const S = struct {
674 const E = enum(u8) { _ };662 const E = enum(u8) { _ };
675663
...@@ -732,8 +720,6 @@ const EnumWithTagValues = enum(u4) {...@@ -732,8 +720,6 @@ const EnumWithTagValues = enum(u4) {
732 D = 1 << 3,720 D = 1 << 3,
733};721};
734test "enum with tag values don't require parens" {722test "enum with tag values don't require parens" {
735 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
736
737 try expect(@enumToInt(EnumWithTagValues.C) == 0b0100);723 try expect(@enumToInt(EnumWithTagValues.C) == 0b0100);
738}724}
739725
...@@ -750,8 +736,6 @@ const MultipleChoice2 = enum(u32) {...@@ -750,8 +736,6 @@ const MultipleChoice2 = enum(u32) {
750};736};
751737
752test "cast integer literal to enum" {738test "cast integer literal to enum" {
753 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
754
755 try expect(@intToEnum(MultipleChoice2, 0) == MultipleChoice2.Unspecified1);739 try expect(@intToEnum(MultipleChoice2, 0) == MultipleChoice2.Unspecified1);
756 try expect(@intToEnum(MultipleChoice2, 40) == MultipleChoice2.B);740 try expect(@intToEnum(MultipleChoice2, 40) == MultipleChoice2.B);
757}741}
...@@ -783,8 +767,6 @@ const Small2 = enum(u2) { One, Two };...@@ -783,8 +767,6 @@ const Small2 = enum(u2) { One, Two };
783const Small = enum(u2) { One, Two, Three, Four };767const Small = enum(u2) { One, Two, Three, Four };
784768
785test "set enum tag type" {769test "set enum tag type" {
786 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
787
788 {770 {
789 var x = Small.One;771 var x = Small.One;
790 x = Small.Two;772 x = Small.Two;
...@@ -798,8 +780,6 @@ test "set enum tag type" {...@@ -798,8 +780,6 @@ test "set enum tag type" {
798}780}
799781
800test "casting enum to its tag type" {782test "casting enum to its tag type" {
801 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
802
803 try testCastEnumTag(Small2.Two);783 try testCastEnumTag(Small2.Two);
804 comptime try testCastEnumTag(Small2.Two);784 comptime try testCastEnumTag(Small2.Two);
805}785}
...@@ -809,8 +789,6 @@ fn testCastEnumTag(value: Small2) !void {...@@ -809,8 +789,6 @@ fn testCastEnumTag(value: Small2) !void {
809}789}
810790
811test "enum with 1 field but explicit tag type should still have the tag type" {791test "enum with 1 field but explicit tag type should still have the tag type" {
812 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
813
814 const Enum = enum(u8) {792 const Enum = enum(u8) {
815 B = 2,793 B = 2,
816 };794 };
...@@ -818,8 +796,6 @@ test "enum with 1 field but explicit tag type should still have the tag type" {...@@ -818,8 +796,6 @@ test "enum with 1 field but explicit tag type should still have the tag type" {
818}796}
819797
820test "signed integer as enum tag" {798test "signed integer as enum tag" {
821 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
822
823 const SignedEnum = enum(i2) {799 const SignedEnum = enum(i2) {
824 A0 = -1,800 A0 = -1,
825 A1 = 0,801 A1 = 0,
...@@ -832,8 +808,6 @@ test "signed integer as enum tag" {...@@ -832,8 +808,6 @@ test "signed integer as enum tag" {
832}808}
833809
834test "enum with one member and custom tag type" {810test "enum with one member and custom tag type" {
835 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
836
837 const E = enum(u2) {811 const E = enum(u2) {
838 One,812 One,
839 };813 };
...@@ -845,8 +819,6 @@ test "enum with one member and custom tag type" {...@@ -845,8 +819,6 @@ test "enum with one member and custom tag type" {
845}819}
846820
847test "enum with one member and u1 tag type @enumToInt" {821test "enum with one member and u1 tag type @enumToInt" {
848 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
849
850 const Enum = enum(u1) {822 const Enum = enum(u1) {
851 Test,823 Test,
852 };824 };
...@@ -854,8 +826,6 @@ test "enum with one member and u1 tag type @enumToInt" {...@@ -854,8 +826,6 @@ test "enum with one member and u1 tag type @enumToInt" {
854}826}
855827
856test "enum with comptime_int tag type" {828test "enum with comptime_int tag type" {
857 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
858
859 const Enum = enum(comptime_int) {829 const Enum = enum(comptime_int) {
860 One = 3,830 One = 3,
861 Two = 2,831 Two = 2,
...@@ -865,8 +835,6 @@ test "enum with comptime_int tag type" {...@@ -865,8 +835,6 @@ test "enum with comptime_int tag type" {
865}835}
866836
867test "enum with one member default to u0 tag type" {837test "enum with one member default to u0 tag type" {
868 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
869
870 const E0 = enum { X };838 const E0 = enum { X };
871 comptime try expect(Tag(E0) == u0);839 comptime try expect(Tag(E0) == u0);
872}840}
...@@ -883,15 +851,11 @@ fn doALoopThing(id: EnumWithOneMember) void {...@@ -883,15 +851,11 @@ fn doALoopThing(id: EnumWithOneMember) void {
883}851}
884852
885test "comparison operator on enum with one member is comptime known" {853test "comparison operator on enum with one member is comptime known" {
886 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
887
888 doALoopThing(EnumWithOneMember.Eof);854 doALoopThing(EnumWithOneMember.Eof);
889}855}
890856
891const State = enum { Start };857const State = enum { Start };
892test "switch on enum with one member is comptime known" {858test "switch on enum with one member is comptime known" {
893 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
894
895 var state = State.Start;859 var state = State.Start;
896 switch (state) {860 switch (state) {
897 State.Start => return,861 State.Start => return,
...@@ -900,8 +864,6 @@ test "switch on enum with one member is comptime known" {...@@ -900,8 +864,6 @@ test "switch on enum with one member is comptime known" {
900}864}
901865
902test "method call on an enum" {866test "method call on an enum" {
903 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
904
905 const S = struct {867 const S = struct {
906 const E = enum {868 const E = enum {
907 one,869 one,
...@@ -1141,8 +1103,6 @@ fn getC(data: *const BitFieldOfEnums) C {...@@ -1141,8 +1103,6 @@ fn getC(data: *const BitFieldOfEnums) C {
1141}1103}
11421104
1143test "enum literal in array literal" {1105test "enum literal in array literal" {
1144 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
1145
1146 const Items = enum { one, two };1106 const Items = enum { one, two };
1147 const array = [_]Items{ .one, .two };1107 const array = [_]Items{ .one, .two };
11481108
test/behavior/error.zig-13
...@@ -6,16 +6,12 @@ const expectEqual = std.testing.expectEqual;...@@ -6,16 +6,12 @@ const expectEqual = std.testing.expectEqual;
6const mem = std.mem;6const mem = std.mem;
77
8test "error values" {8test "error values" {
9 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
10
11 const a = @errorToInt(error.err1);9 const a = @errorToInt(error.err1);
12 const b = @errorToInt(error.err2);10 const b = @errorToInt(error.err2);
13 try expect(a != b);11 try expect(a != b);
14}12}
1513
16test "redefinition of error values allowed" {14test "redefinition of error values allowed" {
17 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
18
19 shouldBeNotEqual(error.AnError, error.SecondError);15 shouldBeNotEqual(error.AnError, error.SecondError);
20}16}
21fn shouldBeNotEqual(a: anyerror, b: anyerror) void {17fn shouldBeNotEqual(a: anyerror, b: anyerror) void {
...@@ -36,8 +32,6 @@ fn errBinaryOperatorG(x: bool) anyerror!isize {...@@ -36,8 +32,6 @@ fn errBinaryOperatorG(x: bool) anyerror!isize {
36}32}
3733
38test "empty error union" {34test "empty error union" {
39 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
40
41 const x = error{} || error{};35 const x = error{} || error{};
42 _ = x;36 _ = x;
43}37}
...@@ -91,8 +85,6 @@ fn makeANonErr() anyerror!i32 {...@@ -91,8 +85,6 @@ fn makeANonErr() anyerror!i32 {
91}85}
9286
93test "syntax: optional operator in front of error union operator" {87test "syntax: optional operator in front of error union operator" {
94 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
95
96 comptime {88 comptime {
97 try expect(?(anyerror!i32) == ?(anyerror!i32));89 try expect(?(anyerror!i32) == ?(anyerror!i32));
98 }90 }
...@@ -147,8 +139,6 @@ test "implicit cast to optional to error union to return result loc" {...@@ -147,8 +139,6 @@ test "implicit cast to optional to error union to return result loc" {
147}139}
148140
149test "error: fn returning empty error set can be passed as fn returning any error" {141test "error: fn returning empty error set can be passed as fn returning any error" {
150 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
151
152 entry();142 entry();
153 comptime entry();143 comptime entry();
154}144}
...@@ -165,7 +155,6 @@ fn foo2(f: fn () anyerror!void) void {...@@ -165,7 +155,6 @@ fn foo2(f: fn () anyerror!void) void {
165fn bar2() (error{}!void) {}155fn bar2() (error{}!void) {}
166156
167test "error union type " {157test "error union type " {
168 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
169 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO158 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO
170 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO159 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
171160
...@@ -182,7 +171,6 @@ fn testErrorUnionType() !void {...@@ -182,7 +171,6 @@ fn testErrorUnionType() !void {
182}171}
183172
184test "error set type" {173test "error set type" {
185 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
186 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO174 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO
187 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO175 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
188176
...@@ -209,7 +197,6 @@ fn testErrorSetType() !void {...@@ -209,7 +197,6 @@ fn testErrorSetType() !void {
209}197}
210198
211test "explicit error set cast" {199test "explicit error set cast" {
212 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
213 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO200 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO
214 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO201 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
215 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO202 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
test/behavior/floatop.zig-2
...@@ -24,7 +24,6 @@ test "floating point comparisons" {...@@ -24,7 +24,6 @@ test "floating point comparisons" {
24 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO24 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
25 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO25 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO
26 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO26 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
27 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
2827
29 try testFloatComparisons();28 try testFloatComparisons();
30 comptime try testFloatComparisons();29 comptime try testFloatComparisons();
...@@ -96,7 +95,6 @@ test "negative f128 floatToInt at compile-time" {...@@ -96,7 +95,6 @@ test "negative f128 floatToInt at compile-time" {
96 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO95 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO
97 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO96 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
98 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO97 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
99 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
10098
101 const a: f128 = -2;99 const a: f128 = -2;
102 var b = @floatToInt(i64, a);100 var b = @floatToInt(i64, a);
test/behavior/fn.zig-20
...@@ -5,8 +5,6 @@ const expect = testing.expect;...@@ -5,8 +5,6 @@ const expect = testing.expect;
5const expectEqual = testing.expectEqual;5const expectEqual = testing.expectEqual;
66
7test "params" {7test "params" {
8 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
9
10 try expect(testParamsAdd(22, 11) == 33);8 try expect(testParamsAdd(22, 11) == 33);
11}9}
12fn testParamsAdd(a: i32, b: i32) i32 {10fn testParamsAdd(a: i32, b: i32) i32 {
...@@ -14,8 +12,6 @@ fn testParamsAdd(a: i32, b: i32) i32 {...@@ -14,8 +12,6 @@ fn testParamsAdd(a: i32, b: i32) i32 {
14}12}
1513
16test "local variables" {14test "local variables" {
17 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
18
19 testLocVars(2);15 testLocVars(2);
20}16}
21fn testLocVars(b: i32) void {17fn testLocVars(b: i32) void {
...@@ -24,8 +20,6 @@ fn testLocVars(b: i32) void {...@@ -24,8 +20,6 @@ fn testLocVars(b: i32) void {
24}20}
2521
26test "mutable local variables" {22test "mutable local variables" {
27 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
28
29 var zero: i32 = 0;23 var zero: i32 = 0;
30 try expect(zero == 0);24 try expect(zero == 0);
3125
...@@ -37,8 +31,6 @@ test "mutable local variables" {...@@ -37,8 +31,6 @@ test "mutable local variables" {
37}31}
3832
39test "separate block scopes" {33test "separate block scopes" {
40 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
41
42 {34 {
43 const no_conflict: i32 = 5;35 const no_conflict: i32 = 5;
44 try expect(no_conflict == 5);36 try expect(no_conflict == 5);
...@@ -55,14 +47,10 @@ fn @"weird function name"() i32 {...@@ -55,14 +47,10 @@ fn @"weird function name"() i32 {
55 return 1234;47 return 1234;
56}48}
57test "weird function name" {49test "weird function name" {
58 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
59
60 try expect(@"weird function name"() == 1234);50 try expect(@"weird function name"() == 1234);
61}51}
6252
63test "assign inline fn to const variable" {53test "assign inline fn to const variable" {
64 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
65
66 const a = inlineFn;54 const a = inlineFn;
67 a();55 a();
68}56}
...@@ -80,8 +68,6 @@ fn outer(y: u32) *const fn (u32) u32 {...@@ -80,8 +68,6 @@ fn outer(y: u32) *const fn (u32) u32 {
80}68}
8169
82test "return inner function which references comptime variable of outer function" {70test "return inner function which references comptime variable of outer function" {
83 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
84
85 if (builtin.zig_backend == .stage1) return error.SkipZigTest;71 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
8672
87 var func = outer(10);73 var func = outer(10);
...@@ -149,8 +135,6 @@ test "inline function call that calls optional function pointer, return pointer...@@ -149,8 +135,6 @@ test "inline function call that calls optional function pointer, return pointer
149}135}
150136
151test "implicit cast function unreachable return" {137test "implicit cast function unreachable return" {
152 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
153
154 wantsFnWithVoid(fnWithUnreachable);138 wantsFnWithVoid(fnWithUnreachable);
155}139}
156140
...@@ -348,8 +332,6 @@ fn fn4() u32 {...@@ -348,8 +332,6 @@ fn fn4() u32 {
348}332}
349333
350test "number literal as an argument" {334test "number literal as an argument" {
351 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
352
353 try numberLiteralArg(3);335 try numberLiteralArg(3);
354 comptime try numberLiteralArg(3);336 comptime try numberLiteralArg(3);
355}337}
...@@ -380,8 +362,6 @@ test "function call with anon list literal" {...@@ -380,8 +362,6 @@ test "function call with anon list literal" {
380}362}
381363
382test "ability to give comptime types and non comptime types to same parameter" {364test "ability to give comptime types and non comptime types to same parameter" {
383 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
384
385 const S = struct {365 const S = struct {
386 fn doTheTest() !void {366 fn doTheTest() !void {
387 var x: i32 = 1;367 var x: i32 = 1;
test/behavior/for.zig-6
...@@ -21,8 +21,6 @@ test "continue in for loop" {...@@ -21,8 +21,6 @@ test "continue in for loop" {
21}21}
2222
23test "break from outer for loop" {23test "break from outer for loop" {
24 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
25
26 try testBreakOuter();24 try testBreakOuter();
27 comptime try testBreakOuter();25 comptime try testBreakOuter();
28}26}
...@@ -40,8 +38,6 @@ fn testBreakOuter() !void {...@@ -40,8 +38,6 @@ fn testBreakOuter() !void {
40}38}
4139
42test "continue outer for loop" {40test "continue outer for loop" {
43 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
44
45 try testContinueOuter();41 try testContinueOuter();
46 comptime try testContinueOuter();42 comptime try testContinueOuter();
47}43}
...@@ -59,8 +55,6 @@ fn testContinueOuter() !void {...@@ -59,8 +55,6 @@ fn testContinueOuter() !void {
59}55}
6056
61test "ignore lval with underscore (for loop)" {57test "ignore lval with underscore (for loop)" {
62 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
63
64 for ([_]void{}) |_, i| {58 for ([_]void{}) |_, i| {
65 _ = i;59 _ = i;
66 for ([_]void{}) |_, j| {60 for ([_]void{}) |_, j| {
test/behavior/generics.zig-9
...@@ -5,8 +5,6 @@ const expect = testing.expect;...@@ -5,8 +5,6 @@ const expect = testing.expect;
5const expectEqual = testing.expectEqual;5const expectEqual = testing.expectEqual;
66
7test "one param, explicit comptime" {7test "one param, explicit comptime" {
8 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
9
10 var x: usize = 0;8 var x: usize = 0;
11 x += checkSize(i32);9 x += checkSize(i32);
12 x += checkSize(bool);10 x += checkSize(bool);
...@@ -42,8 +40,6 @@ fn add(comptime a: i32, b: i32) i32 {...@@ -42,8 +40,6 @@ fn add(comptime a: i32, b: i32) i32 {
4240
43const the_max = max(u32, 1234, 5678);41const the_max = max(u32, 1234, 5678);
44test "compile time generic eval" {42test "compile time generic eval" {
45 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
46
47 try expect(the_max == 5678);43 try expect(the_max == 5678);
48}44}
4945
...@@ -142,8 +138,6 @@ pub fn SmallList(comptime T: type, comptime STATIC_SIZE: usize) type {...@@ -142,8 +138,6 @@ pub fn SmallList(comptime T: type, comptime STATIC_SIZE: usize) type {
142}138}
143139
144test "const decls in struct" {140test "const decls in struct" {
145 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
146
147 try expect(GenericDataThing(3).count_plus_one == 4);141 try expect(GenericDataThing(3).count_plus_one == 4);
148}142}
149fn GenericDataThing(comptime count: isize) type {143fn GenericDataThing(comptime count: isize) type {
...@@ -153,8 +147,6 @@ fn GenericDataThing(comptime count: isize) type {...@@ -153,8 +147,6 @@ fn GenericDataThing(comptime count: isize) type {
153}147}
154148
155test "use generic param in generic param" {149test "use generic param in generic param" {
156 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
157
158 try expect(aGenericFn(i32, 3, 4) == 7);150 try expect(aGenericFn(i32, 3, 4) == 7);
159}151}
160fn aGenericFn(comptime T: type, comptime a: T, b: T) T {152fn aGenericFn(comptime T: type, comptime a: T, b: T) T {
...@@ -197,7 +189,6 @@ test "generic fn keeps non-generic parameter types" {...@@ -197,7 +189,6 @@ test "generic fn keeps non-generic parameter types" {
197}189}
198190
199test "array of generic fns" {191test "array of generic fns" {
200 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
201 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;192 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
202193
203 try expect(foos[0](true));194 try expect(foos[0](true));
test/behavior/if.zig-8
...@@ -4,8 +4,6 @@ const expect = std.testing.expect;...@@ -4,8 +4,6 @@ const expect = std.testing.expect;
4const expectEqual = std.testing.expectEqual;4const expectEqual = std.testing.expectEqual;
55
6test "if statements" {6test "if statements" {
7 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
8
9 shouldBeEqual(1, 1);7 shouldBeEqual(1, 1);
10 firstEqlThird(2, 1, 2);8 firstEqlThird(2, 1, 2);
11}9}
...@@ -29,8 +27,6 @@ fn firstEqlThird(a: i32, b: i32, c: i32) void {...@@ -29,8 +27,6 @@ fn firstEqlThird(a: i32, b: i32, c: i32) void {
29}27}
3028
31test "else if expression" {29test "else if expression" {
32 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
33
34 try expect(elseIfExpressionF(1) == 1);30 try expect(elseIfExpressionF(1) == 1);
35}31}
36fn elseIfExpressionF(c: u8) u8 {32fn elseIfExpressionF(c: u8) u8 {
...@@ -64,8 +60,6 @@ test "unwrap mutable global var" {...@@ -64,8 +60,6 @@ test "unwrap mutable global var" {
64}60}
6561
66test "labeled break inside comptime if inside runtime if" {62test "labeled break inside comptime if inside runtime if" {
67 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
68
69 var answer: i32 = 0;63 var answer: i32 = 0;
70 var c = true;64 var c = true;
71 if (c) {65 if (c) {
...@@ -77,8 +71,6 @@ test "labeled break inside comptime if inside runtime if" {...@@ -77,8 +71,6 @@ test "labeled break inside comptime if inside runtime if" {
77}71}
7872
79test "const result loc, runtime if cond, else unreachable" {73test "const result loc, runtime if cond, else unreachable" {
80 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
81
82 const Num = enum { One, Two };74 const Num = enum { One, Two };
8375
84 var t = true;76 var t = true;
test/behavior/inttoptr.zig-1
...@@ -2,7 +2,6 @@ const builtin = @import("builtin");...@@ -2,7 +2,6 @@ const builtin = @import("builtin");
22
3test "casting integer address to function pointer" {3test "casting integer address to function pointer" {
4 if (builtin.zig_backend == .stage1) return error.SkipZigTest;4 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
5 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
65
7 addressToFunction();6 addressToFunction();
8 comptime addressToFunction();7 comptime addressToFunction();
test/behavior/math.zig-2
...@@ -312,7 +312,6 @@ test "comptime_int multi-limb partial shift right" {...@@ -312,7 +312,6 @@ test "comptime_int multi-limb partial shift right" {
312test "xor" {312test "xor" {
313 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO313 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO
314 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO314 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
315 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
316315
317 try test_xor();316 try test_xor();
318 comptime try test_xor();317 comptime try test_xor();
...@@ -732,7 +731,6 @@ test "overflow arithmetic with u0 values" {...@@ -732,7 +731,6 @@ test "overflow arithmetic with u0 values" {
732 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO731 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO
733 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO732 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
734 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO733 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
735 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
736734
737 var result: u0 = undefined;735 var result: u0 = undefined;
738 try expect(!@addWithOverflow(u0, 0, 0, &result));736 try expect(!@addWithOverflow(u0, 0, 0, &result));
test/behavior/null.zig-2
...@@ -125,8 +125,6 @@ fn baz(x: ?Empty) ?Empty {...@@ -125,8 +125,6 @@ fn baz(x: ?Empty) ?Empty {
125}125}
126126
127test "null with default unwrap" {127test "null with default unwrap" {
128 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
129
130 const x: i32 = null orelse 1;128 const x: i32 = null orelse 1;
131 try expect(x == 1);129 try expect(x == 1);
132}130}
test/behavior/slice.zig-2
...@@ -218,8 +218,6 @@ test "compile time slice of pointer to hard coded address" {...@@ -218,8 +218,6 @@ test "compile time slice of pointer to hard coded address" {
218}218}
219219
220test "slice string literal has correct type" {220test "slice string literal has correct type" {
221 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
222
223 comptime {221 comptime {
224 try expect(@TypeOf("aoeu"[0..]) == *const [4:0]u8);222 try expect(@TypeOf("aoeu"[0..]) == *const [4:0]u8);
225 const array = [_]i32{ 1, 2, 3, 4 };223 const array = [_]i32{ 1, 2, 3, 4 };
test/behavior/struct.zig-3
...@@ -213,8 +213,6 @@ fn makeBar2(x: i32, y: i32) Bar {...@@ -213,8 +213,6 @@ fn makeBar2(x: i32, y: i32) Bar {
213}213}
214214
215test "call method with mutable reference to struct with no fields" {215test "call method with mutable reference to struct with no fields" {
216 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
217
218 const S = struct {216 const S = struct {
219 fn doC(s: *const @This()) bool {217 fn doC(s: *const @This()) bool {
220 _ = s;218 _ = s;
...@@ -768,7 +766,6 @@ test "pointer to packed struct member in a stack variable" {...@@ -768,7 +766,6 @@ test "pointer to packed struct member in a stack variable" {
768test "packed struct with u0 field access" {766test "packed struct with u0 field access" {
769 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO767 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
770 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO768 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
771 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
772 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO769 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO
773770
774 const S = packed struct {771 const S = packed struct {
test/behavior/switch.zig-4
...@@ -190,8 +190,6 @@ test "switch with disjoint range" {...@@ -190,8 +190,6 @@ test "switch with disjoint range" {
190}190}
191191
192test "switch variable for range and multiple prongs" {192test "switch variable for range and multiple prongs" {
193 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
194
195 const S = struct {193 const S = struct {
196 fn doTheTest() !void {194 fn doTheTest() !void {
197 var u: u8 = 16;195 var u: u8 = 16;
...@@ -357,8 +355,6 @@ fn returnsFalse() bool {...@@ -357,8 +355,6 @@ fn returnsFalse() bool {
357 }355 }
358}356}
359test "switch on const enum with var" {357test "switch on const enum with var" {
360 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
361
362 try expect(!returnsFalse());358 try expect(!returnsFalse());
363}359}
364360
test/behavior/this.zig-2
...@@ -21,8 +21,6 @@ fn add(x: i32, y: i32) i32 {...@@ -21,8 +21,6 @@ fn add(x: i32, y: i32) i32 {
21}21}
2222
23test "this refer to module call private fn" {23test "this refer to module call private fn" {
24 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
25
26 try expect(module.add(1, 2) == 3);24 try expect(module.add(1, 2) == 3);
27}25}
2826
test/behavior/truncate.zig-16
...@@ -3,62 +3,46 @@ const builtin = @import("builtin");...@@ -3,62 +3,46 @@ const builtin = @import("builtin");
3const expect = std.testing.expect;3const expect = std.testing.expect;
44
5test "truncate u0 to larger integer allowed and has comptime known result" {5test "truncate u0 to larger integer allowed and has comptime known result" {
6 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
7
8 var x: u0 = 0;6 var x: u0 = 0;
9 const y = @truncate(u8, x);7 const y = @truncate(u8, x);
10 comptime try expect(y == 0);8 comptime try expect(y == 0);
11}9}
1210
13test "truncate.u0.literal" {11test "truncate.u0.literal" {
14 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
15
16 var z = @truncate(u0, 0);12 var z = @truncate(u0, 0);
17 try expect(z == 0);13 try expect(z == 0);
18}14}
1915
20test "truncate.u0.const" {16test "truncate.u0.const" {
21 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
22
23 const c0: usize = 0;17 const c0: usize = 0;
24 var z = @truncate(u0, c0);18 var z = @truncate(u0, c0);
25 try expect(z == 0);19 try expect(z == 0);
26}20}
2721
28test "truncate.u0.var" {22test "truncate.u0.var" {
29 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
30
31 var d: u8 = 2;23 var d: u8 = 2;
32 var z = @truncate(u0, d);24 var z = @truncate(u0, d);
33 try expect(z == 0);25 try expect(z == 0);
34}26}
3527
36test "truncate i0 to larger integer allowed and has comptime known result" {28test "truncate i0 to larger integer allowed and has comptime known result" {
37 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
38
39 var x: i0 = 0;29 var x: i0 = 0;
40 const y = @truncate(i8, x);30 const y = @truncate(i8, x);
41 comptime try expect(y == 0);31 comptime try expect(y == 0);
42}32}
4333
44test "truncate.i0.literal" {34test "truncate.i0.literal" {
45 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
46
47 var z = @truncate(i0, 0);35 var z = @truncate(i0, 0);
48 try expect(z == 0);36 try expect(z == 0);
49}37}
5038
51test "truncate.i0.const" {39test "truncate.i0.const" {
52 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
53
54 const c0: isize = 0;40 const c0: isize = 0;
55 var z = @truncate(i0, c0);41 var z = @truncate(i0, c0);
56 try expect(z == 0);42 try expect(z == 0);
57}43}
5844
59test "truncate.i0.var" {45test "truncate.i0.var" {
60 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
61
62 var d: i8 = 2;46 var d: i8 = 2;
63 var z = @truncate(i0, d);47 var z = @truncate(i0, d);
64 try expect(z == 0);48 try expect(z == 0);
test/behavior/try.zig-4
...@@ -24,8 +24,6 @@ fn returnsTen() anyerror!i32 {...@@ -24,8 +24,6 @@ fn returnsTen() anyerror!i32 {
24}24}
2525
26test "try without vars" {26test "try without vars" {
27 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
28
29 const result1 = if (failIfTrue(true)) 1 else |_| @as(i32, 2);27 const result1 = if (failIfTrue(true)) 1 else |_| @as(i32, 2);
30 try expect(result1 == 2);28 try expect(result1 == 2);
3129
...@@ -42,8 +40,6 @@ fn failIfTrue(ok: bool) anyerror!void {...@@ -42,8 +40,6 @@ fn failIfTrue(ok: bool) anyerror!void {
42}40}
4341
44test "try then not executed with assignment" {42test "try then not executed with assignment" {
45 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
46
47 if (failIfTrue(true)) {43 if (failIfTrue(true)) {
48 unreachable;44 unreachable;
49 } else |err| {45 } else |err| {
test/behavior/usingnamespace.zig-8
...@@ -11,8 +11,6 @@ const C = struct {...@@ -11,8 +11,6 @@ const C = struct {
11};11};
1212
13test "basic usingnamespace" {13test "basic usingnamespace" {
14 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
15
16 try std.testing.expect(C.B == bool);14 try std.testing.expect(C.B == bool);
17}15}
1816
...@@ -23,8 +21,6 @@ fn Foo(comptime T: type) type {...@@ -23,8 +21,6 @@ fn Foo(comptime T: type) type {
23}21}
2422
25test "usingnamespace inside a generic struct" {23test "usingnamespace inside a generic struct" {
26 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
27
28 const std2 = Foo(std);24 const std2 = Foo(std);
29 const testing2 = Foo(std.testing);25 const testing2 = Foo(std.testing);
30 try std2.testing.expect(true);26 try std2.testing.expect(true);
...@@ -36,8 +32,6 @@ usingnamespace struct {...@@ -36,8 +32,6 @@ usingnamespace struct {
36};32};
3733
38test "usingnamespace does not redeclare an imported variable" {34test "usingnamespace does not redeclare an imported variable" {
39 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
40
41 comptime try std.testing.expect(@This().foo == 42);35 comptime try std.testing.expect(@This().foo == 42);
42}36}
4337
...@@ -54,8 +48,6 @@ fn privateFunction() bool {...@@ -54,8 +48,6 @@ fn privateFunction() bool {
54}48}
5549
56test {50test {
57 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
58
59 _ = @import("usingnamespace/import_segregation.zig");51 _ = @import("usingnamespace/import_segregation.zig");
60}52}
6153
test/behavior/while.zig-2
...@@ -247,8 +247,6 @@ fn returnTrue() bool {...@@ -247,8 +247,6 @@ fn returnTrue() bool {
247}247}
248248
249test "return with implicit cast from while loop" {249test "return with implicit cast from while loop" {
250 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
251
252 returnWithImplicitCastFromWhileLoopTest() catch unreachable;250 returnWithImplicitCastFromWhileLoopTest() catch unreachable;
253}251}
254fn returnWithImplicitCastFromWhileLoopTest() anyerror!void {252fn returnWithImplicitCastFromWhileLoopTest() anyerror!void {