Merge pull request #11180 from jmc-88/cbe3

CBE: amending an incorrect test name, plus two small fixes
This commit is contained in:
Andrew Kelley 2022-03-15 17:04:23 -04:00 committed by GitHub
commit ea4d2759a5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 4 deletions

View file

@ -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);

View file

@ -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

View file

@ -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);