authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-12-16 06:11:16-05:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2022-12-16 06:11:16-05:00
logcf85462a78aa767ce7cfd1ebdb06d7405e1b0e5e
tree6ec39337b013279da7ff200f3d2060abf1ac16a9
parent1ebb7612445c1b0b0d76c73d17f18254e0d9efab
parent171e6c7aa7783efbd680f9d8ab9a28a115abff5d
signaturebadge-question-mark Signed by PGP key 4AEE18F83AFDEB23

Merge pull request #13966 from r00ster91/stage1things

compiler_rt: re-enable tests and remove old workarounds

3 files changed, 5 insertions(+), 30 deletions(-)

lib/compiler_rt/clzsi2_test.zig+5-18
......@@ -3,24 +3,11 @@ const clz = @import("count0bits.zig");
33const testing = @import("std").testing;
44
55fn test__clzsi2(a: u32, expected: i32) !void {
6 // stage1 and stage2 diverge on function pointer semantics
7 switch (builtin.zig_backend) {
8 .stage1 => {
9 // Use of `var` here is working around a stage1 bug.
10 var nakedClzsi2 = clz.__clzsi2;
11 var actualClzsi2 = @ptrCast(fn (a: i32) callconv(.C) i32, nakedClzsi2);
12 var x = @bitCast(i32, a);
13 var result = actualClzsi2(x);
14 try testing.expectEqual(expected, result);
15 },
16 else => {
17 const nakedClzsi2 = clz.__clzsi2;
18 const actualClzsi2 = @ptrCast(*const fn (a: i32) callconv(.C) i32, &nakedClzsi2);
19 const x = @bitCast(i32, a);
20 const result = actualClzsi2(x);
21 try testing.expectEqual(expected, result);
22 },
23 }
6 const nakedClzsi2 = clz.__clzsi2;
7 const actualClzsi2 = @ptrCast(*const fn (a: i32) callconv(.C) i32, &nakedClzsi2);
8 const x = @bitCast(i32, a);
9 const result = actualClzsi2(x);
10 try testing.expectEqual(expected, result);
2411}
2512
2613test "clzsi2" {
lib/compiler_rt/int_to_float_test.zig-3
......@@ -1,5 +1,4 @@
11const std = @import("std");
2const builtin = @import("builtin");
32const testing = std.testing;
43const math = std.math;
54
......@@ -811,8 +810,6 @@ test "conversion to f32" {
811810}
812811
813812test "conversion to f80" {
814 if (builtin.zig_backend == .stage1 and builtin.cpu.arch != .x86_64)
815 return error.SkipZigTest; // https://github.com/ziglang/zig/issues/11408
816813 if (std.debug.runtime_safety) return error.SkipZigTest;
817814
818815 const intToFloat = @import("./int_to_float.zig").intToFloat;
lib/compiler_rt/mulo.zig-9
......@@ -65,15 +65,6 @@ pub fn __mulodi4(a: i64, b: i64, overflow: *c_int) callconv(.C) i64 {
6565}
6666
6767pub fn __muloti4(a: i128, b: i128, overflow: *c_int) callconv(.C) i128 {
68 switch (builtin.zig_backend) {
69 .stage1, .stage2_llvm => {
70 // Workaround for https://github.com/llvm/llvm-project/issues/56403
71 // When we call the genericSmall implementation instead, LLVM optimizer
72 // optimizes __muloti4 to a call to itself.
73 return muloXi4_genericFast(i128, a, b, overflow);
74 },
75 else => {},
76 }
7768 if (2 * @bitSizeOf(i128) <= @bitSizeOf(usize)) {
7869 return muloXi4_genericFast(i128, a, b, overflow);
7970 } else {