mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 13:54:21 +00:00
Merge pull request #11180 from jmc-88/cbe3
CBE: amending an incorrect test name, plus two small fixes
This commit is contained in:
commit
ea4d2759a5
3 changed files with 6 additions and 4 deletions
|
|
@ -2541,7 +2541,7 @@ fn airMinMax(f: *Function, inst: Air.Inst.Index, operator: [*:0]const u8) !CValu
|
||||||
try f.writeCValue(writer, lhs);
|
try f.writeCValue(writer, lhs);
|
||||||
try writer.print("{s}", .{operator});
|
try writer.print("{s}", .{operator});
|
||||||
try f.writeCValue(writer, rhs);
|
try f.writeCValue(writer, rhs);
|
||||||
try writer.writeAll(") ");
|
try writer.writeAll(") ? ");
|
||||||
try f.writeCValue(writer, lhs);
|
try f.writeCValue(writer, lhs);
|
||||||
try writer.writeAll(" : ");
|
try writer.writeAll(" : ");
|
||||||
try f.writeCValue(writer, rhs);
|
try f.writeCValue(writer, rhs);
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
#undef linux
|
||||||
|
|
||||||
#if __STDC_VERSION__ >= 201112L
|
#if __STDC_VERSION__ >= 201112L
|
||||||
#define zig_noreturn _Noreturn
|
#define zig_noreturn _Noreturn
|
||||||
#define zig_threadlocal thread_local
|
#define zig_threadlocal thread_local
|
||||||
|
|
|
||||||
|
|
@ -7,11 +7,11 @@ fn ctz(x: anytype) usize {
|
||||||
}
|
}
|
||||||
|
|
||||||
test "fixed" {
|
test "fixed" {
|
||||||
try testClz();
|
try testCtz();
|
||||||
comptime try testClz();
|
comptime try testCtz();
|
||||||
}
|
}
|
||||||
|
|
||||||
fn testClz() !void {
|
fn testCtz() !void {
|
||||||
try expect(ctz(@as(u128, 0x40000000000000000000000000000000)) == 126);
|
try expect(ctz(@as(u128, 0x40000000000000000000000000000000)) == 126);
|
||||||
try expect(math.rotl(u128, @as(u128, 0x40000000000000000000000000000000), @as(u8, 1)) == @as(u128, 0x80000000000000000000000000000000));
|
try expect(math.rotl(u128, @as(u128, 0x40000000000000000000000000000000), @as(u8, 1)) == @as(u128, 0x80000000000000000000000000000000));
|
||||||
try expect(ctz(@as(u128, 0x80000000000000000000000000000000)) == 127);
|
try expect(ctz(@as(u128, 0x80000000000000000000000000000000)) == 127);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue