parent
d0c39895aa
commit
2fe8a0831f
|
@ -20,6 +20,7 @@ comptime {
|
|||
_ = @import("behavior/bugs/1486.zig");
|
||||
_ = @import("behavior/bugs/1851.zig");
|
||||
_ = @import("behavior/bugs/394.zig");
|
||||
_ = @import("behavior/bugs/421.zig");
|
||||
_ = @import("behavior/bugs/655.zig");
|
||||
_ = @import("behavior/bugs/656.zig");
|
||||
_ = @import("behavior/bugs/726.zig");
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
const assert = @import("std").debug.assert;
|
||||
|
||||
test "bitCast to array" {
|
||||
comptime testBitCastArray();
|
||||
testBitCastArray();
|
||||
}
|
||||
|
||||
fn testBitCastArray() void {
|
||||
assert(extractOne64(0x0123456789abcdef0123456789abcdef) == 0x0123456789abcdef);
|
||||
}
|
||||
|
||||
fn extractOne64(a: u128) u64 {
|
||||
const x = @bitCast([2]u64, a);
|
||||
return x[1];
|
||||
}
|
||||
|
Loading…
Reference in New Issue