We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6ed0910 commit 300b6d2Copy full SHA for 300b6d2
test/behavior/ptrcast.zig
@@ -203,6 +203,12 @@ test "comptime ptrcast keeps larger alignment" {
203
}
204
205
206
+test "comptime ptrcast" {
207
+ const is_value = ~@intCast(isize, std.math.minInt(isize));
208
+ const is_bytes = @ptrCast([*]const u8, &is_value)[0..@sizeOf(isize)];
209
+ try expect(is_bytes[0] == 0xff);
210
+}
211
+
212
test "implicit optional pointer to optional anyopaque pointer" {
213
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
214
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
0 commit comments