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");...@@ -3,24 +3,11 @@ const clz = @import("count0bits.zig");
3const testing = @import("std").testing;3const testing = @import("std").testing;
44
5fn test__clzsi2(a: u32, expected: i32) !void {5fn test__clzsi2(a: u32, expected: i32) !void {
6 // stage1 and stage2 diverge on function pointer semantics6 const nakedClzsi2 = clz.__clzsi2;
7 switch (builtin.zig_backend) {7 const actualClzsi2 = @ptrCast(*const fn (a: i32) callconv(.C) i32, &nakedClzsi2);
8 .stage1 => {8 const x = @bitCast(i32, a);
9 // Use of `var` here is working around a stage1 bug.9 const result = actualClzsi2(x);
10 var nakedClzsi2 = clz.__clzsi2;10 try testing.expectEqual(expected, result);
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 }
24}11}
2512
26test "clzsi2" {13test "clzsi2" {
lib/compiler_rt/int_to_float_test.zig-3
...@@ -1,5 +1,4 @@...@@ -1,5 +1,4 @@
1const std = @import("std");1const std = @import("std");
2const builtin = @import("builtin");
3const testing = std.testing;2const testing = std.testing;
4const math = std.math;3const math = std.math;
54
...@@ -811,8 +810,6 @@ test "conversion to f32" {...@@ -811,8 +810,6 @@ test "conversion to f32" {
811}810}
812811
813test "conversion to f80" {812test "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
816 if (std.debug.runtime_safety) return error.SkipZigTest;813 if (std.debug.runtime_safety) return error.SkipZigTest;
817814
818 const intToFloat = @import("./int_to_float.zig").intToFloat;815 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 {...@@ -65,15 +65,6 @@ pub fn __mulodi4(a: i64, b: i64, overflow: *c_int) callconv(.C) i64 {
65}65}
6666
67pub fn __muloti4(a: i128, b: i128, overflow: *c_int) callconv(.C) i128 {67pub 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 }
77 if (2 * @bitSizeOf(i128) <= @bitSizeOf(usize)) {68 if (2 * @bitSizeOf(i128) <= @bitSizeOf(usize)) {
78 return muloXi4_genericFast(i128, a, b, overflow);69 return muloXi4_genericFast(i128, a, b, overflow);
79 } else {70 } else {