| ... | @@ -72,6 +72,11 @@ fn testMemsetSlice() !void { | ... | @@ -72,6 +72,11 @@ fn testMemsetSlice() !void { |
| 72 | } | 72 | } |
| 73 | | 73 | |
| 74 | test "memset with bool element" { | 74 | test "memset with bool element" { |
| | 75 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| | 76 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| | 77 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; |
| | 78 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; |
| | 79 | |
| 75 | var buf: [5]bool = undefined; | 80 | var buf: [5]bool = undefined; |
| 76 | @memset(&buf, true); | 81 | @memset(&buf, true); |
| 77 | try expect(buf[2]); | 82 | try expect(buf[2]); |
| ... | @@ -79,6 +84,11 @@ test "memset with bool element" { | ... | @@ -79,6 +84,11 @@ test "memset with bool element" { |
| 79 | } | 84 | } |
| 80 | | 85 | |
| 81 | test "memset with 1-byte struct element" { | 86 | test "memset with 1-byte struct element" { |
| | 87 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| | 88 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| | 89 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; |
| | 90 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; |
| | 91 | |
| 82 | const S = struct { x: bool }; | 92 | const S = struct { x: bool }; |
| 83 | var buf: [5]S = undefined; | 93 | var buf: [5]S = undefined; |
| 84 | @memset(&buf, .{ .x = true }); | 94 | @memset(&buf, .{ .x = true }); |
| ... | @@ -87,6 +97,11 @@ test "memset with 1-byte struct element" { | ... | @@ -87,6 +97,11 @@ test "memset with 1-byte struct element" { |
| 87 | } | 97 | } |
| 88 | | 98 | |
| 89 | test "memset with 1-byte array element" { | 99 | test "memset with 1-byte array element" { |
| | 100 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| | 101 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| | 102 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; |
| | 103 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; |
| | 104 | |
| 90 | const A = [1]bool; | 105 | const A = [1]bool; |
| 91 | var buf: [5]A = undefined; | 106 | var buf: [5]A = undefined; |
| 92 | @memset(&buf, .{true}); | 107 | @memset(&buf, .{true}); |
| ... | @@ -95,6 +110,11 @@ test "memset with 1-byte array element" { | ... | @@ -95,6 +110,11 @@ test "memset with 1-byte array element" { |
| 95 | } | 110 | } |
| 96 | | 111 | |
| 97 | test "memset with large array element, runtime known" { | 112 | test "memset with large array element, runtime known" { |
| | 113 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| | 114 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| | 115 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; |
| | 116 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; |
| | 117 | |
| 98 | const A = [128]u64; | 118 | const A = [128]u64; |
| 99 | var buf: [5]A = undefined; | 119 | var buf: [5]A = undefined; |
| 100 | var runtime_known_element = [_]u64{0} ** 128; | 120 | var runtime_known_element = [_]u64{0} ** 128; |
| ... | @@ -107,6 +127,11 @@ test "memset with large array element, runtime known" { | ... | @@ -107,6 +127,11 @@ test "memset with large array element, runtime known" { |
| 107 | } | 127 | } |
| 108 | | 128 | |
| 109 | test "memset with large array element, comptime known" { | 129 | test "memset with large array element, comptime known" { |
| | 130 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| | 131 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| | 132 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; |
| | 133 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; |
| | 134 | |
| 110 | const A = [128]u64; | 135 | const A = [128]u64; |
| 111 | var buf: [5]A = undefined; | 136 | var buf: [5]A = undefined; |
| 112 | const comptime_known_element = [_]u64{0} ** 128; | 137 | const comptime_known_element = [_]u64{0} ** 128; |