authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-03-15 17:04:23-04:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2022-03-15 17:04:23-04:00
logea4d2759a51f2805e8345fe85500feefef3f504c
tree575aa81d0fa002c6f9396c62b8f3c4fb5774c1a4
parent6de8b4bc3d105c15cd473c5bf100db4c9328dd54
parent71ca0b176f7a643ef7606d12f4001b445a115092
signature Signed by PGP key 4AEE18F83AFDEB23

Merge pull request #11180 from jmc-88/cbe3

CBE: amending an incorrect test name, plus two small fixes

3 files changed, 6 insertions(+), 4 deletions(-)

src/codegen/c.zig+1-1
...@@ -2541,7 +2541,7 @@ fn airMinMax(f: *Function, inst: Air.Inst.Index, operator: [*:0]const u8) !CValu...@@ -2541,7 +2541,7 @@ fn airMinMax(f: *Function, inst: Air.Inst.Index, operator: [*:0]const u8) !CValu
2541 try f.writeCValue(writer, lhs);2541 try f.writeCValue(writer, lhs);
2542 try writer.print("{s}", .{operator});2542 try writer.print("{s}", .{operator});
2543 try f.writeCValue(writer, rhs);2543 try f.writeCValue(writer, rhs);
2544 try writer.writeAll(") ");2544 try writer.writeAll(") ? ");
2545 try f.writeCValue(writer, lhs);2545 try f.writeCValue(writer, lhs);
2546 try writer.writeAll(" : ");2546 try writer.writeAll(" : ");
2547 try f.writeCValue(writer, rhs);2547 try f.writeCValue(writer, rhs);
src/link/C/zig.h+2
...@@ -1,3 +1,5 @@...@@ -1,3 +1,5 @@
1#undef linux
2
1#if __STDC_VERSION__ >= 201112L3#if __STDC_VERSION__ >= 201112L
2#define zig_noreturn _Noreturn4#define zig_noreturn _Noreturn
3#define zig_threadlocal thread_local5#define zig_threadlocal thread_local
test/behavior/bugs/2114.zig+3-3
...@@ -7,11 +7,11 @@ fn ctz(x: anytype) usize {...@@ -7,11 +7,11 @@ fn ctz(x: anytype) usize {
7}7}
88
9test "fixed" {9test "fixed" {
10 try testClz();10 try testCtz();
11 comptime try testClz();11 comptime try testCtz();
12}12}
1313
14fn testClz() !void {14fn testCtz() !void {
15 try expect(ctz(@as(u128, 0x40000000000000000000000000000000)) == 126);15 try expect(ctz(@as(u128, 0x40000000000000000000000000000000)) == 126);
16 try expect(math.rotl(u128, @as(u128, 0x40000000000000000000000000000000), @as(u8, 1)) == @as(u128, 0x80000000000000000000000000000000));16 try expect(math.rotl(u128, @as(u128, 0x40000000000000000000000000000000), @as(u8, 1)) == @as(u128, 0x80000000000000000000000000000000));
17 try expect(ctz(@as(u128, 0x80000000000000000000000000000000)) == 127);17 try expect(ctz(@as(u128, 0x80000000000000000000000000000000)) == 127);