| author | |
| committer | |
| log | 9dfd24a3345c83c9cd32d45bef3076bb94bc0eaa |
| tree | 4f2bd5a4cf75462927d6ce6fc6ed6a090a8e7ac7 |
| parent | 81767a658d07219a402384f98a7553abcbbd2e70 |
| signature |
closes #21143 files changed, 22 insertions(+), 2 deletions(-)
test/stage1/behavior.zig+1| ... | ... | @@ -24,6 +24,7 @@ comptime { |
| 24 | 24 | _ = @import("behavior/bugs/1851.zig"); |
| 25 | 25 | _ = @import("behavior/bugs/1914.zig"); |
| 26 | 26 | _ = @import("behavior/bugs/2006.zig"); |
| 27 | _ = @import("behavior/bugs/2114.zig"); | |
| 27 | 28 | _ = @import("behavior/bugs/2346.zig"); |
| 28 | 29 | _ = @import("behavior/bugs/394.zig"); |
| 29 | 30 | _ = @import("behavior/bugs/421.zig"); |
test/stage1/behavior/bugs/2114.zig created+19| ... | ... | @@ -0,0 +1,19 @@ |
| 1 | const std = @import("std"); | |
| 2 | const expect = std.testing.expect; | |
| 3 | const math = std.math; | |
| 4 | ||
| 5 | fn ctz(x: var) usize { | |
| 6 | return @ctz(x); | |
| 7 | } | |
| 8 | ||
| 9 | test "fixed" { | |
| 10 | testClz(); | |
| 11 | comptime testClz(); | |
| 12 | } | |
| 13 | ||
| 14 | fn testClz() void { | |
| 15 | expect(ctz(u128(0x40000000000000000000000000000000)) == 126); | |
| 16 | expect(math.rotl(u128, u128(0x40000000000000000000000000000000), u8(1)) == u128(0x80000000000000000000000000000000)); | |
| 17 | expect(ctz(u128(0x80000000000000000000000000000000)) == 127); | |
| 18 | expect(ctz(math.rotl(u128, u128(0x40000000000000000000000000000000), u8(1))) == 127); | |
| 19 | } |
test/stage1/behavior/bugs/2346.zig+2-2| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | test "" { | |
| 1 | test "fixed" { | |
| 2 | 2 | const a: *void = undefined; |
| 3 | 3 | const b: *[1]void = a; |
| 4 | 4 | const c: *[0]u8 = undefined; |
| 5 | 5 | const d: []u8 = c; |
| 6 | } | |
| \ No newline at end of file | ||
| 6 | } |