| author | |
| committer | |
| log | 98046b4c3c09d3d115b38a943fce328a2dc20dc4 |
| tree | e42ec5c302a5bd32cbfcb08645a788afede54d48 |
| parent | 6f55a689644fa85a6f650e6d33bcb882b1f507cd |
2 files changed, 45 insertions(+), 60 deletions(-)
src/codegen/spirv.zig+45-41| ... | ... | @@ -1662,13 +1662,11 @@ pub const DeclGen = struct { |
| 1662 | 1662 | return try self.convertToDirect(result_ty, result_id); |
| 1663 | 1663 | } |
| 1664 | 1664 | |
| 1665 | fn load(self: *DeclGen, ptr_ty: Type, ptr_id: IdRef) !IdRef { | |
| 1666 | const mod = self.module; | |
| 1667 | const value_ty = ptr_ty.childType(mod); | |
| 1665 | fn load(self: *DeclGen, value_ty: Type, ptr_id: IdRef, is_volatile: bool) !IdRef { | |
| 1668 | 1666 | const indirect_value_ty_ref = try self.resolveType(value_ty, .indirect); |
| 1669 | 1667 | const result_id = self.spv.allocId(); |
| 1670 | 1668 | const access = spec.MemoryAccess.Extended{ |
| 1671 | .Volatile = ptr_ty.isVolatilePtr(mod), | |
| 1669 | .Volatile = is_volatile, | |
| 1672 | 1670 | }; |
| 1673 | 1671 | try self.func.body.emit(self.spv.gpa, .OpLoad, .{ |
| 1674 | 1672 | .id_result_type = self.typeId(indirect_value_ty_ref), |
| ... | ... | @@ -1679,12 +1677,10 @@ pub const DeclGen = struct { |
| 1679 | 1677 | return try self.convertToDirect(value_ty, result_id); |
| 1680 | 1678 | } |
| 1681 | 1679 | |
| 1682 | fn store(self: *DeclGen, ptr_ty: Type, ptr_id: IdRef, value_id: IdRef) !void { | |
| 1683 | const mod = self.module; | |
| 1684 | const value_ty = ptr_ty.childType(mod); | |
| 1680 | fn store(self: *DeclGen, value_ty: Type, ptr_id: IdRef, value_id: IdRef, is_volatile: bool) !void { | |
| 1685 | 1681 | const indirect_value_id = try self.convertToIndirect(value_ty, value_id); |
| 1686 | 1682 | const access = spec.MemoryAccess.Extended{ |
| 1687 | .Volatile = ptr_ty.isVolatilePtr(mod), | |
| 1683 | .Volatile = is_volatile, | |
| 1688 | 1684 | }; |
| 1689 | 1685 | try self.func.body.emit(self.spv.gpa, .OpStore, .{ |
| 1690 | 1686 | .pointer = ptr_id, |
| ... | ... | @@ -1754,6 +1750,7 @@ pub const DeclGen = struct { |
| 1754 | 1750 | .ptr_elem_ptr => try self.airPtrElemPtr(inst), |
| 1755 | 1751 | .ptr_elem_val => try self.airPtrElemVal(inst), |
| 1756 | 1752 | |
| 1753 | .set_union_tag => return try self.airSetUnionTag(inst), | |
| 1757 | 1754 | .get_union_tag => try self.airGetUnionTag(inst), |
| 1758 | 1755 | .struct_field_val => try self.airStructFieldVal(inst), |
| 1759 | 1756 | |
| ... | ... | @@ -2512,7 +2509,7 @@ pub const DeclGen = struct { |
| 2512 | 2509 | |
| 2513 | 2510 | const slice_ptr = try self.extractField(ptr_ty, slice_id, 0); |
| 2514 | 2511 | const elem_ptr = try self.ptrAccessChain(ptr_ty_ref, slice_ptr, index_id, &.{}); |
| 2515 | return try self.load(slice_ty, elem_ptr); | |
| 2512 | return try self.load(slice_ty.childType(mod), elem_ptr, slice_ty.isVolatilePtr(mod)); | |
| 2516 | 2513 | } |
| 2517 | 2514 | |
| 2518 | 2515 | fn ptrElemPtr(self: *DeclGen, ptr_ty: Type, ptr_id: IdRef, index_id: IdRef) !IdRef { |
| ... | ... | @@ -2548,25 +2545,41 @@ pub const DeclGen = struct { |
| 2548 | 2545 | } |
| 2549 | 2546 | |
| 2550 | 2547 | fn airPtrElemVal(self: *DeclGen, inst: Air.Inst.Index) !?IdRef { |
| 2548 | if (self.liveness.isUnused(inst)) return null; | |
| 2549 | ||
| 2551 | 2550 | const mod = self.module; |
| 2552 | 2551 | const bin_op = self.air.instructions.items(.data)[inst].bin_op; |
| 2553 | 2552 | const ptr_ty = self.typeOf(bin_op.lhs); |
| 2553 | const elem_ty = self.typeOfIndex(inst); | |
| 2554 | 2554 | const ptr_id = try self.resolve(bin_op.lhs); |
| 2555 | 2555 | const index_id = try self.resolve(bin_op.rhs); |
| 2556 | ||
| 2557 | 2556 | const elem_ptr_id = try self.ptrElemPtr(ptr_ty, ptr_id, index_id); |
| 2557 | return try self.load(elem_ty, elem_ptr_id, ptr_ty.isVolatilePtr(mod)); | |
| 2558 | } | |
| 2559 | ||
| 2560 | fn airSetUnionTag(self: *DeclGen, inst: Air.Inst.Index) !void { | |
| 2561 | const mod = self.module; | |
| 2562 | const bin_op = self.air.instructions.items(.data)[inst].bin_op; | |
| 2563 | const un_ptr_ty = self.typeOf(bin_op.lhs); | |
| 2564 | const un_ty = un_ptr_ty.childType(mod); | |
| 2565 | const layout = self.unionLayout(un_ty, null); | |
| 2566 | ||
| 2567 | if (layout.tag_size == 0) return; | |
| 2568 | ||
| 2569 | const tag_ty = un_ty.unionTagTypeSafety(mod).?; | |
| 2570 | const tag_ty_ref = try self.resolveType(tag_ty, .indirect); | |
| 2571 | const tag_ptr_ty_ref = try self.spv.ptrType(tag_ty_ref, spvStorageClass(un_ptr_ty.ptrAddressSpace(mod))); | |
| 2558 | 2572 | |
| 2559 | // If we have a pointer-to-array, construct an element pointer to use with load() | |
| 2560 | // If we pass ptr_ty directly, it will attempt to load the entire array rather than | |
| 2561 | // just an element. | |
| 2562 | var elem_ptr_info = ptr_ty.ptrInfo(mod); | |
| 2563 | elem_ptr_info.flags.size = .One; | |
| 2564 | const elem_ptr_ty = try mod.intern_pool.get(mod.gpa, .{ .ptr_type = elem_ptr_info }); | |
| 2573 | const union_ptr_id = try self.resolve(bin_op.lhs); | |
| 2574 | const new_tag_id = try self.resolve(bin_op.rhs); | |
| 2565 | 2575 | |
| 2566 | return try self.load(elem_ptr_ty.toType(), elem_ptr_id); | |
| 2576 | const ptr_id = try self.accessChain(tag_ptr_ty_ref, union_ptr_id, &.{layout.tag_index}); | |
| 2577 | try self.store(tag_ty, ptr_id, new_tag_id, un_ptr_ty.isVolatilePtr(mod)); | |
| 2567 | 2578 | } |
| 2568 | 2579 | |
| 2569 | 2580 | fn airGetUnionTag(self: *DeclGen, inst: Air.Inst.Index) !?IdRef { |
| 2581 | if (self.liveness.isUnused(inst)) return null; | |
| 2582 | ||
| 2570 | 2583 | const ty_op = self.air.instructions.items(.data)[inst].ty_op; |
| 2571 | 2584 | const un_ty = self.typeOf(ty_op.operand); |
| 2572 | 2585 | |
| ... | ... | @@ -2588,25 +2601,25 @@ pub const DeclGen = struct { |
| 2588 | 2601 | const ty_pl = self.air.instructions.items(.data)[inst].ty_pl; |
| 2589 | 2602 | const struct_field = self.air.extraData(Air.StructField, ty_pl.payload).data; |
| 2590 | 2603 | |
| 2591 | const container_ty = self.typeOf(struct_field.struct_operand); | |
| 2604 | const object_ty = self.typeOf(struct_field.struct_operand); | |
| 2592 | 2605 | const object_id = try self.resolve(struct_field.struct_operand); |
| 2593 | 2606 | const field_index = struct_field.field_index; |
| 2594 | const field_ty = container_ty.structFieldType(field_index, mod); | |
| 2607 | const field_ty = object_ty.structFieldType(field_index, mod); | |
| 2595 | 2608 | |
| 2596 | 2609 | if (!field_ty.hasRuntimeBitsIgnoreComptime(mod)) return null; |
| 2597 | 2610 | |
| 2598 | switch (container_ty.zigTypeTag(mod)) { | |
| 2599 | .Struct => switch (container_ty.containerLayout(mod)) { | |
| 2611 | switch (object_ty.zigTypeTag(mod)) { | |
| 2612 | .Struct => switch (object_ty.containerLayout(mod)) { | |
| 2600 | 2613 | .Packed => unreachable, // TODO |
| 2601 | 2614 | else => return try self.extractField(field_ty, object_id, field_index), |
| 2602 | 2615 | }, |
| 2603 | .Union => switch (container_ty.containerLayout(mod)) { | |
| 2616 | .Union => switch (object_ty.containerLayout(mod)) { | |
| 2604 | 2617 | .Packed => unreachable, // TODO |
| 2605 | 2618 | else => { |
| 2606 | 2619 | // Store, pointer-cast, load |
| 2607 | const un_general_ty_ref = try self.resolveType(container_ty, .indirect); | |
| 2620 | const un_general_ty_ref = try self.resolveType(object_ty, .indirect); | |
| 2608 | 2621 | const un_general_ptr_ty_ref = try self.spv.ptrType(un_general_ty_ref, .Function); |
| 2609 | const un_active_ty_ref = try self.resolveUnionType(container_ty, field_index); | |
| 2622 | const un_active_ty_ref = try self.resolveUnionType(object_ty, field_index); | |
| 2610 | 2623 | const un_active_ptr_ty_ref = try self.spv.ptrType(un_active_ty_ref, .Function); |
| 2611 | 2624 | const field_ty_ref = try self.resolveType(field_ty, .indirect); |
| 2612 | 2625 | const field_ptr_ty_ref = try self.spv.ptrType(field_ty_ref, .Function); |
| ... | ... | @@ -2617,31 +2630,20 @@ pub const DeclGen = struct { |
| 2617 | 2630 | .id_result = tmp_id, |
| 2618 | 2631 | .storage_class = .Function, |
| 2619 | 2632 | }); |
| 2620 | try self.func.body.emit(self.spv.gpa, .OpStore, .{ | |
| 2621 | .pointer = tmp_id, | |
| 2622 | .object = object_id, | |
| 2623 | }); | |
| 2633 | try self.store(object_ty, tmp_id, object_id, false); | |
| 2624 | 2634 | const casted_tmp_id = self.spv.allocId(); |
| 2625 | 2635 | try self.func.body.emit(self.spv.gpa, .OpBitcast, .{ |
| 2626 | 2636 | .id_result_type = self.typeId(un_active_ptr_ty_ref), |
| 2627 | 2637 | .id_result = casted_tmp_id, |
| 2628 | 2638 | .operand = tmp_id, |
| 2629 | 2639 | }); |
| 2630 | const layout = self.unionLayout(container_ty, field_index); | |
| 2640 | const layout = self.unionLayout(object_ty, field_index); | |
| 2631 | 2641 | const field_ptr_id = try self.accessChain(field_ptr_ty_ref, casted_tmp_id, &.{layout.active_field_index}); |
| 2632 | const result_id = self.spv.allocId(); | |
| 2633 | try self.func.body.emit(self.spv.gpa, .OpLoad, .{ | |
| 2634 | .id_result_type = self.typeId(field_ty_ref), | |
| 2635 | .id_result = result_id, | |
| 2636 | .pointer = field_ptr_id, | |
| 2637 | }); | |
| 2638 | return try self.convertToDirect(field_ty, result_id); | |
| 2642 | return try self.load(field_ty, field_ptr_id, false); | |
| 2639 | 2643 | }, |
| 2640 | 2644 | }, |
| 2641 | 2645 | else => unreachable, |
| 2642 | 2646 | } |
| 2643 | ||
| 2644 | // return try self.extractField(field_ty, object_id, field_index); | |
| 2645 | 2647 | } |
| 2646 | 2648 | |
| 2647 | 2649 | fn structFieldPtr( |
| ... | ... | @@ -2866,19 +2868,21 @@ pub const DeclGen = struct { |
| 2866 | 2868 | const mod = self.module; |
| 2867 | 2869 | const ty_op = self.air.instructions.items(.data)[inst].ty_op; |
| 2868 | 2870 | const ptr_ty = self.typeOf(ty_op.operand); |
| 2871 | const elem_ty = self.typeOfIndex(inst); | |
| 2869 | 2872 | const operand = try self.resolve(ty_op.operand); |
| 2870 | 2873 | if (!ptr_ty.isVolatilePtr(mod) and self.liveness.isUnused(inst)) return null; |
| 2871 | 2874 | |
| 2872 | return try self.load(ptr_ty, operand); | |
| 2875 | return try self.load(elem_ty, operand, ptr_ty.isVolatilePtr(mod)); | |
| 2873 | 2876 | } |
| 2874 | 2877 | |
| 2875 | 2878 | fn airStore(self: *DeclGen, inst: Air.Inst.Index) !void { |
| 2876 | 2879 | const bin_op = self.air.instructions.items(.data)[inst].bin_op; |
| 2877 | 2880 | const ptr_ty = self.typeOf(bin_op.lhs); |
| 2881 | const elem_ty = ptr_ty.childType(self.module); | |
| 2878 | 2882 | const ptr = try self.resolve(bin_op.lhs); |
| 2879 | 2883 | const value = try self.resolve(bin_op.rhs); |
| 2880 | 2884 | |
| 2881 | try self.store(ptr_ty, ptr, value); | |
| 2885 | try self.store(elem_ty, ptr, value, ptr_ty.isVolatilePtr(self.module)); | |
| 2882 | 2886 | } |
| 2883 | 2887 | |
| 2884 | 2888 | fn airLoop(self: *DeclGen, inst: Air.Inst.Index) !void { |
| ... | ... | @@ -2922,7 +2926,7 @@ pub const DeclGen = struct { |
| 2922 | 2926 | } |
| 2923 | 2927 | |
| 2924 | 2928 | const ptr = try self.resolve(un_op); |
| 2925 | const value = try self.load(ptr_ty, ptr); | |
| 2929 | const value = try self.load(ret_ty, ptr, ptr_ty.isVolatilePtr(mod)); | |
| 2926 | 2930 | try self.func.body.emit(self.spv.gpa, .OpReturnValue, .{ |
| 2927 | 2931 | .value = value, |
| 2928 | 2932 | }); |
test/behavior/union.zig-19| ... | ... | @@ -29,7 +29,6 @@ test "init union with runtime value - floats" { |
| 29 | 29 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 30 | 30 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 31 | 31 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 32 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; | |
| 33 | 32 | |
| 34 | 33 | var foo: FooWithFloats = undefined; |
| 35 | 34 | |
| ... | ... | @@ -59,7 +58,6 @@ test "init union with runtime value" { |
| 59 | 58 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 60 | 59 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 61 | 60 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 62 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; | |
| 63 | 61 | |
| 64 | 62 | var foo: Foo = undefined; |
| 65 | 63 | |
| ... | ... | @@ -170,7 +168,6 @@ test "constant tagged union with payload" { |
| 170 | 168 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 171 | 169 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 172 | 170 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 173 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; | |
| 174 | 171 | |
| 175 | 172 | var empty = TaggedUnionWithPayload{ .Empty = {} }; |
| 176 | 173 | var full = TaggedUnionWithPayload{ .Full = 13 }; |
| ... | ... | @@ -508,7 +505,6 @@ test "union initializer generates padding only if needed" { |
| 508 | 505 | test "runtime tag name with single field" { |
| 509 | 506 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 510 | 507 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 511 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; | |
| 512 | 508 | |
| 513 | 509 | const U = union(enum) { |
| 514 | 510 | A: i32, |
| ... | ... | @@ -585,7 +581,6 @@ test "tagged union as return value" { |
| 585 | 581 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 586 | 582 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 587 | 583 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 588 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; | |
| 589 | 584 | |
| 590 | 585 | switch (returnAnInt(13)) { |
| 591 | 586 | TaggedFoo.One => |value| try expect(value == 13), |
| ... | ... | @@ -630,7 +625,6 @@ test "union(enum(u32)) with specified and unspecified tag values" { |
| 630 | 625 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 631 | 626 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 632 | 627 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 633 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; | |
| 634 | 628 | |
| 635 | 629 | try comptime expect(Tag(Tag(MultipleChoice2)) == u32); |
| 636 | 630 | try testEnumWithSpecifiedAndUnspecifiedTagValues(MultipleChoice2{ .C = 123 }); |
| ... | ... | @@ -668,7 +662,6 @@ test "switch on union with only 1 field" { |
| 668 | 662 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 669 | 663 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 670 | 664 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 671 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; | |
| 672 | 665 | |
| 673 | 666 | var r: PartialInst = undefined; |
| 674 | 667 | r = PartialInst.Compiled; |
| ... | ... | @@ -697,7 +690,6 @@ const PartialInstWithPayload = union(enum) { |
| 697 | 690 | |
| 698 | 691 | test "union with only 1 field casted to its enum type which has enum value specified" { |
| 699 | 692 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 700 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; | |
| 701 | 693 | |
| 702 | 694 | const Literal = union(enum) { |
| 703 | 695 | Number: f64, |
| ... | ... | @@ -782,7 +774,6 @@ test "return union init with void payload" { |
| 782 | 774 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 783 | 775 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 784 | 776 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 785 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; | |
| 786 | 777 | |
| 787 | 778 | const S = struct { |
| 788 | 779 | fn entry() !void { |
| ... | ... | @@ -836,7 +827,6 @@ test "@unionInit can modify a union type" { |
| 836 | 827 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 837 | 828 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 838 | 829 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 839 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; | |
| 840 | 830 | |
| 841 | 831 | const UnionInitEnum = union(enum) { |
| 842 | 832 | Boolean: bool, |
| ... | ... | @@ -860,7 +850,6 @@ test "@unionInit can modify a pointer value" { |
| 860 | 850 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 861 | 851 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 862 | 852 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 863 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; | |
| 864 | 853 | |
| 865 | 854 | const UnionInitEnum = union(enum) { |
| 866 | 855 | Boolean: bool, |
| ... | ... | @@ -917,7 +906,6 @@ test "anonymous union literal syntax" { |
| 917 | 906 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 918 | 907 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 919 | 908 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 920 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; | |
| 921 | 909 | |
| 922 | 910 | const S = struct { |
| 923 | 911 | const Number = union { |
| ... | ... | @@ -1041,7 +1029,6 @@ test "switching on non exhaustive union" { |
| 1041 | 1029 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1042 | 1030 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 1043 | 1031 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1044 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; | |
| 1045 | 1032 | |
| 1046 | 1033 | const S = struct { |
| 1047 | 1034 | const E = enum(u8) { |
| ... | ... | @@ -1225,7 +1212,6 @@ test "union tag is set when initiated as a temporary value at runtime" { |
| 1225 | 1212 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1226 | 1213 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 1227 | 1214 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1228 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; | |
| 1229 | 1215 | |
| 1230 | 1216 | const U = union(enum) { |
| 1231 | 1217 | a, |
| ... | ... | @@ -1263,7 +1249,6 @@ test "return an extern union from C calling convention" { |
| 1263 | 1249 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1264 | 1250 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 1265 | 1251 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1266 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; | |
| 1267 | 1252 | |
| 1268 | 1253 | const namespace = struct { |
| 1269 | 1254 | const S = extern struct { |
| ... | ... | @@ -1294,7 +1279,6 @@ test "noreturn field in union" { |
| 1294 | 1279 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 1295 | 1280 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1296 | 1281 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 1297 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; | |
| 1298 | 1282 | |
| 1299 | 1283 | const U = union(enum) { |
| 1300 | 1284 | a: u32, |
| ... | ... | @@ -1475,7 +1459,6 @@ test "no dependency loop when function pointer in union returns the union" { |
| 1475 | 1459 | test "union reassignment can use previous value" { |
| 1476 | 1460 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 1477 | 1461 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| 1478 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; | |
| 1479 | 1462 | |
| 1480 | 1463 | const U = union { |
| 1481 | 1464 | a: u32, |
| ... | ... | @@ -1527,7 +1510,6 @@ test "reinterpreting enum value inside packed union" { |
| 1527 | 1510 | |
| 1528 | 1511 | test "access the tag of a global tagged union" { |
| 1529 | 1512 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 1530 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; | |
| 1531 | 1513 | |
| 1532 | 1514 | const U = union(enum) { |
| 1533 | 1515 | a, |
| ... | ... | @@ -1539,7 +1521,6 @@ test "access the tag of a global tagged union" { |
| 1539 | 1521 | |
| 1540 | 1522 | test "coerce enum literal to union in result loc" { |
| 1541 | 1523 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 1542 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; | |
| 1543 | 1524 | |
| 1544 | 1525 | const U = union(enum) { |
| 1545 | 1526 | a, |