| ... | @@ -1,3 +1,4 @@ | ... | @@ -1,3 +1,4 @@ |
| | 1 | const builtin = @import("builtin"); |
| 1 | const std = @import("std.zig"); | 2 | const std = @import("std.zig"); |
| 2 | const debug = std.debug; | 3 | const debug = std.debug; |
| 3 | const mem = std.mem; | 4 | const mem = std.mem; |
| ... | @@ -810,14 +811,6 @@ test eql { | ... | @@ -810,14 +811,6 @@ test eql { |
| 810 | try testing.expect(eql(EU.tst(false), EU.tst(false))); | 811 | try testing.expect(eql(EU.tst(false), EU.tst(false))); |
| 811 | try testing.expect(!eql(EU.tst(false), EU.tst(true))); | 812 | try testing.expect(!eql(EU.tst(false), EU.tst(true))); |
| 812 | | 813 | |
| 813 | const V = @Vector(4, u32); | | |
| 814 | const v1: V = @splat(1); | | |
| 815 | const v2: V = @splat(1); | | |
| 816 | const v3: V = @splat(2); | | |
| 817 | | | |
| 818 | try testing.expect(eql(v1, v2)); | | |
| 819 | try testing.expect(!eql(v1, v3)); | | |
| 820 | | | |
| 821 | const CU = union(enum) { | 814 | const CU = union(enum) { |
| 822 | a: void, | 815 | a: void, |
| 823 | b: void, | 816 | b: void, |
| ... | @@ -826,6 +819,16 @@ test eql { | ... | @@ -826,6 +819,16 @@ test eql { |
| 826 | | 819 | |
| 827 | try testing.expect(eql(CU{ .a = {} }, .a)); | 820 | try testing.expect(eql(CU{ .a = {} }, .a)); |
| 828 | try testing.expect(!eql(CU{ .a = {} }, .b)); | 821 | try testing.expect(!eql(CU{ .a = {} }, .b)); |
| | 822 | |
| | 823 | if (builtin.cpu.arch == .hexagon) return error.SkipZigTest; |
| | 824 | |
| | 825 | const V = @Vector(4, u32); |
| | 826 | const v1: V = @splat(1); |
| | 827 | const v2: V = @splat(1); |
| | 828 | const v3: V = @splat(2); |
| | 829 | |
| | 830 | try testing.expect(eql(v1, v2)); |
| | 831 | try testing.expect(!eql(v1, v3)); |
| 829 | } | 832 | } |
| 830 | | 833 | |
| 831 | /// Deprecated: use `std.enums.fromInt` instead and handle null. | 834 | /// Deprecated: use `std.enums.fromInt` instead and handle null. |