diff --git a/src/analyze.cpp b/src/analyze.cpp index 82872bcbfc..1282126fbc 100644 --- a/src/analyze.cpp +++ b/src/analyze.cpp @@ -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; diff --git a/test/stage1/behavior/cast.zig b/test/stage1/behavior/cast.zig index 04c7fa606f..8176f5cf83 100644 --- a/test/stage1/behavior/cast.zig +++ b/test/stage1/behavior/cast.zig @@ -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(); } diff --git a/test/stage1/behavior/math.zig b/test/stage1/behavior/math.zig index e285d0ebf8..1ff63e3e23 100644 --- a/test/stage1/behavior/math.zig +++ b/test/stage1/behavior/math.zig @@ -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); diff --git a/test/stage1/behavior/new_stack_call.zig b/test/stage1/behavior/new_stack_call.zig index 2fef4816d3..a2f3773afe 100644 --- a/test/stage1/behavior/new_stack_call.zig +++ b/test/stage1/behavior/new_stack_call.zig @@ -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); diff --git a/test/stage1/behavior/widening.zig b/test/stage1/behavior/widening.zig index 71f8ae482e..1aa7ff5d22 100644 --- a/test/stage1/behavior/widening.zig +++ b/test/stage1/behavior/widening.zig @@ -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;