x86_64: fix c abi test failures

This commit is contained in:
Jacob Young
2023-10-27 22:51:58 -04:00
parent aecdf6ad50
commit a440cf6d44
8 changed files with 489 additions and 404 deletions

View File

@@ -2,7 +2,6 @@ pub const parseFloat = @import("parse_float/parse_float.zig").parseFloat;
pub const ParseFloatError = @import("parse_float/parse_float.zig").ParseFloatError;
const std = @import("std");
const builtin = @import("builtin");
const math = std.math;
const testing = std.testing;
const expect = testing.expect;
@@ -14,8 +13,6 @@ const epsilon = 1e-7;
// See https://github.com/tiehuis/parse-number-fxx-test-data for a wider-selection of test-data.
test "fmt.parseFloat" {
if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
inline for ([_]type{ f16, f32, f64, f128 }) |T| {
try testing.expectError(error.InvalidCharacter, parseFloat(T, ""));
try testing.expectError(error.InvalidCharacter, parseFloat(T, " 1"));
@@ -72,8 +69,6 @@ test "fmt.parseFloat" {
}
test "fmt.parseFloat nan and inf" {
if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
inline for ([_]type{ f16, f32, f64, f128 }) |T| {
const Z = std.meta.Int(.unsigned, @typeInfo(T).Float.bits);
@@ -88,7 +83,7 @@ test "fmt.parseFloat #11169" {
}
test "fmt.parseFloat hex.special" {
if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
try testing.expect(math.isNan(try parseFloat(f32, "nAn")));
try testing.expect(math.isPositiveInf(try parseFloat(f32, "iNf")));
@@ -96,8 +91,6 @@ test "fmt.parseFloat hex.special" {
try testing.expect(math.isNegativeInf(try parseFloat(f32, "-iNf")));
}
test "fmt.parseFloat hex.zero" {
if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
try testing.expectEqual(@as(f32, 0.0), try parseFloat(f32, "0x0"));
try testing.expectEqual(@as(f32, 0.0), try parseFloat(f32, "-0x0"));
try testing.expectEqual(@as(f32, 0.0), try parseFloat(f32, "0x0p42"));
@@ -106,8 +99,6 @@ test "fmt.parseFloat hex.zero" {
}
test "fmt.parseFloat hex.f16" {
if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
try testing.expectEqual(try parseFloat(f16, "0x1p0"), 1.0);
try testing.expectEqual(try parseFloat(f16, "-0x1p-1"), -0.5);
try testing.expectEqual(try parseFloat(f16, "0x10p+10"), 16384.0);
@@ -124,8 +115,6 @@ test "fmt.parseFloat hex.f16" {
}
test "fmt.parseFloat hex.f32" {
if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
try testing.expectError(error.InvalidCharacter, parseFloat(f32, "0x"));
try testing.expectEqual(try parseFloat(f32, "0x1p0"), 1.0);
try testing.expectEqual(try parseFloat(f32, "-0x1p-1"), -0.5);