RISC-V: get to the linking phase of behavior tests

See #3338 and #3339
This commit is contained in:
Andrew Kelley
2019-09-29 12:21:22 -04:00
parent 543e729398
commit bd46c1c328
5 changed files with 30 additions and 1 deletions

View File

@@ -916,7 +916,7 @@ bool want_first_arg_sret(CodeGen *g, FnTypeId *fn_type_id) {
if (g->zig_target->arch == ZigLLVM_x86_64) {
X64CABIClass abi_class = type_c_abi_x86_64_class(g, fn_type_id->return_type);
return abi_class == X64CABIClass_MEMORY;
} else if (target_is_arm(g->zig_target)) {
} else if (target_is_arm(g->zig_target) || target_is_riscv(g->zig_target)) {
return type_size(g, fn_type_id->return_type) > 16;
} else if (g->zig_target->arch == ZigLLVM_mipsel) {
return false;

View File

@@ -247,6 +247,10 @@ fn testPeerErrorAndArray2(x: u8) anyerror![]const u8 {
}
test "@floatToInt" {
if (@import("builtin").arch == .riscv64) {
// TODO: https://github.com/ziglang/zig/issues/3338
return error.SkipZigTest;
}
testFloatToInts();
comptime testFloatToInts();
}

View File

@@ -6,6 +6,10 @@ const maxInt = std.math.maxInt;
const minInt = std.math.minInt;
test "division" {
if (@import("builtin").arch == .riscv64) {
// TODO: https://github.com/ziglang/zig/issues/3338
return error.SkipZigTest;
}
testDivision();
comptime testDivision();
}
@@ -569,6 +573,10 @@ fn remdiv(comptime T: type) void {
}
test "@sqrt" {
if (@import("builtin").arch == .riscv64) {
// TODO: https://github.com/ziglang/zig/issues/3338
return error.SkipZigTest;
}
testSqrt(f64, 12.0);
comptime testSqrt(f64, 12.0);
testSqrt(f32, 13.0);
@@ -614,6 +622,10 @@ test "vector integer addition" {
}
test "NaN comparison" {
if (@import("builtin").arch == .riscv64) {
// TODO: https://github.com/ziglang/zig/issues/3338
return error.SkipZigTest;
}
testNanEqNan(f16);
testNanEqNan(f32);
testNanEqNan(f64);

View File

@@ -8,6 +8,11 @@ test "calling a function with a new stack" {
if (@import("builtin").arch == .aarch64) return error.SkipZigTest;
if (@import("builtin").arch == .mipsel) return error.SkipZigTest;
if (@import("builtin").arch == .riscv64) {
// TODO: https://github.com/ziglang/zig/issues/3338
return error.SkipZigTest;
}
const arg = 1234;
const a = @newStackCall(new_stack_bytes[0..512], targetFunction, arg);

View File

@@ -19,6 +19,10 @@ test "implicit unsigned integer to signed integer" {
}
test "float widening" {
if (@import("builtin").arch == .riscv64) {
// TODO:
return error.SkipZigTest;
}
var a: f16 = 12.34;
var b: f32 = a;
var c: f64 = b;
@@ -31,6 +35,10 @@ test "float widening" {
test "float widening f16 to f128" {
// TODO https://github.com/ziglang/zig/issues/3282
if (@import("builtin").arch == .aarch64) return error.SkipZigTest;
if (@import("builtin").arch == .riscv64) {
// TODO: https://github.com/ziglang/zig/issues/3338
return error.SkipZigTest;
}
var x: f16 = 12.34;
var y: f128 = x;