authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-09-29 12:21:22-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-09-29 12:21:22-04:00
logbd46c1c328d8e7a0c3393193fd2f963c1077b030
treeab51b11862dc04ddb627d4e412873b903f63c2b5
parent543e729398c2ae2a6fbae8ab54ce0737d35004a0
signaturelock-open Commit is signed but in an unrecognized format.

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

See #3338 and #3339

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

src/analyze.cpp+1-1
......@@ -916,7 +916,7 @@ bool want_first_arg_sret(CodeGen *g, FnTypeId *fn_type_id) {
916916 if (g->zig_target->arch == ZigLLVM_x86_64) {
917917 X64CABIClass abi_class = type_c_abi_x86_64_class(g, fn_type_id->return_type);
918918 return abi_class == X64CABIClass_MEMORY;
919 } else if (target_is_arm(g->zig_target)) {
919 } else if (target_is_arm(g->zig_target) || target_is_riscv(g->zig_target)) {
920920 return type_size(g, fn_type_id->return_type) > 16;
921921 } else if (g->zig_target->arch == ZigLLVM_mipsel) {
922922 return false;
test/stage1/behavior/cast.zig+4
......@@ -247,6 +247,10 @@ fn testPeerErrorAndArray2(x: u8) anyerror![]const u8 {
247247}
248248
249249test "@floatToInt" {
250 if (@import("builtin").arch == .riscv64) {
251 // TODO: https://github.com/ziglang/zig/issues/3338
252 return error.SkipZigTest;
253 }
250254 testFloatToInts();
251255 comptime testFloatToInts();
252256}
test/stage1/behavior/math.zig+12
......@@ -6,6 +6,10 @@ const maxInt = std.math.maxInt;
66const minInt = std.math.minInt;
77
88test "division" {
9 if (@import("builtin").arch == .riscv64) {
10 // TODO: https://github.com/ziglang/zig/issues/3338
11 return error.SkipZigTest;
12 }
913 testDivision();
1014 comptime testDivision();
1115}
......@@ -569,6 +573,10 @@ fn remdiv(comptime T: type) void {
569573}
570574
571575test "@sqrt" {
576 if (@import("builtin").arch == .riscv64) {
577 // TODO: https://github.com/ziglang/zig/issues/3338
578 return error.SkipZigTest;
579 }
572580 testSqrt(f64, 12.0);
573581 comptime testSqrt(f64, 12.0);
574582 testSqrt(f32, 13.0);
......@@ -614,6 +622,10 @@ test "vector integer addition" {
614622}
615623
616624test "NaN comparison" {
625 if (@import("builtin").arch == .riscv64) {
626 // TODO: https://github.com/ziglang/zig/issues/3338
627 return error.SkipZigTest;
628 }
617629 testNanEqNan(f16);
618630 testNanEqNan(f32);
619631 testNanEqNan(f64);
test/stage1/behavior/new_stack_call.zig+5
......@@ -8,6 +8,11 @@ test "calling a function with a new stack" {
88 if (@import("builtin").arch == .aarch64) return error.SkipZigTest;
99 if (@import("builtin").arch == .mipsel) return error.SkipZigTest;
1010
11 if (@import("builtin").arch == .riscv64) {
12 // TODO: https://github.com/ziglang/zig/issues/3338
13 return error.SkipZigTest;
14 }
15
1116 const arg = 1234;
1217
1318 const a = @newStackCall(new_stack_bytes[0..512], targetFunction, arg);
test/stage1/behavior/widening.zig+8
......@@ -19,6 +19,10 @@ test "implicit unsigned integer to signed integer" {
1919}
2020
2121test "float widening" {
22 if (@import("builtin").arch == .riscv64) {
23 // TODO:
24 return error.SkipZigTest;
25 }
2226 var a: f16 = 12.34;
2327 var b: f32 = a;
2428 var c: f64 = b;
......@@ -31,6 +35,10 @@ test "float widening" {
3135test "float widening f16 to f128" {
3236 // TODO https://github.com/ziglang/zig/issues/3282
3337 if (@import("builtin").arch == .aarch64) return error.SkipZigTest;
38 if (@import("builtin").arch == .riscv64) {
39 // TODO: https://github.com/ziglang/zig/issues/3338
40 return error.SkipZigTest;
41 }
3442
3543 var x: f16 = 12.34;
3644 var y: f128 = x;