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) {...@@ -916,7 +916,7 @@ bool want_first_arg_sret(CodeGen *g, FnTypeId *fn_type_id) {
916 if (g->zig_target->arch == ZigLLVM_x86_64) {916 if (g->zig_target->arch == ZigLLVM_x86_64) {
917 X64CABIClass abi_class = type_c_abi_x86_64_class(g, fn_type_id->return_type);917 X64CABIClass abi_class = type_c_abi_x86_64_class(g, fn_type_id->return_type);
918 return abi_class == X64CABIClass_MEMORY;918 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)) {
920 return type_size(g, fn_type_id->return_type) > 16;920 return type_size(g, fn_type_id->return_type) > 16;
921 } else if (g->zig_target->arch == ZigLLVM_mipsel) {921 } else if (g->zig_target->arch == ZigLLVM_mipsel) {
922 return false;922 return false;
test/stage1/behavior/cast.zig+4
...@@ -247,6 +247,10 @@ fn testPeerErrorAndArray2(x: u8) anyerror![]const u8 {...@@ -247,6 +247,10 @@ fn testPeerErrorAndArray2(x: u8) anyerror![]const u8 {
247}247}
248248
249test "@floatToInt" {249test "@floatToInt" {
250 if (@import("builtin").arch == .riscv64) {
251 // TODO: https://github.com/ziglang/zig/issues/3338
252 return error.SkipZigTest;
253 }
250 testFloatToInts();254 testFloatToInts();
251 comptime testFloatToInts();255 comptime testFloatToInts();
252}256}
test/stage1/behavior/math.zig+12
...@@ -6,6 +6,10 @@ const maxInt = std.math.maxInt;...@@ -6,6 +6,10 @@ const maxInt = std.math.maxInt;
6const minInt = std.math.minInt;6const minInt = std.math.minInt;
77
8test "division" {8test "division" {
9 if (@import("builtin").arch == .riscv64) {
10 // TODO: https://github.com/ziglang/zig/issues/3338
11 return error.SkipZigTest;
12 }
9 testDivision();13 testDivision();
10 comptime testDivision();14 comptime testDivision();
11}15}
...@@ -569,6 +573,10 @@ fn remdiv(comptime T: type) void {...@@ -569,6 +573,10 @@ fn remdiv(comptime T: type) void {
569}573}
570574
571test "@sqrt" {575test "@sqrt" {
576 if (@import("builtin").arch == .riscv64) {
577 // TODO: https://github.com/ziglang/zig/issues/3338
578 return error.SkipZigTest;
579 }
572 testSqrt(f64, 12.0);580 testSqrt(f64, 12.0);
573 comptime testSqrt(f64, 12.0);581 comptime testSqrt(f64, 12.0);
574 testSqrt(f32, 13.0);582 testSqrt(f32, 13.0);
...@@ -614,6 +622,10 @@ test "vector integer addition" {...@@ -614,6 +622,10 @@ test "vector integer addition" {
614}622}
615623
616test "NaN comparison" {624test "NaN comparison" {
625 if (@import("builtin").arch == .riscv64) {
626 // TODO: https://github.com/ziglang/zig/issues/3338
627 return error.SkipZigTest;
628 }
617 testNanEqNan(f16);629 testNanEqNan(f16);
618 testNanEqNan(f32);630 testNanEqNan(f32);
619 testNanEqNan(f64);631 testNanEqNan(f64);
test/stage1/behavior/new_stack_call.zig+5
...@@ -8,6 +8,11 @@ test "calling a function with a new stack" {...@@ -8,6 +8,11 @@ test "calling a function with a new stack" {
8 if (@import("builtin").arch == .aarch64) return error.SkipZigTest;8 if (@import("builtin").arch == .aarch64) return error.SkipZigTest;
9 if (@import("builtin").arch == .mipsel) return error.SkipZigTest;9 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
11 const arg = 1234;16 const arg = 1234;
1217
13 const a = @newStackCall(new_stack_bytes[0..512], targetFunction, arg);18 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" {...@@ -19,6 +19,10 @@ test "implicit unsigned integer to signed integer" {
19}19}
2020
21test "float widening" {21test "float widening" {
22 if (@import("builtin").arch == .riscv64) {
23 // TODO:
24 return error.SkipZigTest;
25 }
22 var a: f16 = 12.34;26 var a: f16 = 12.34;
23 var b: f32 = a;27 var b: f32 = a;
24 var c: f64 = b;28 var c: f64 = b;
...@@ -31,6 +35,10 @@ test "float widening" {...@@ -31,6 +35,10 @@ test "float widening" {
31test "float widening f16 to f128" {35test "float widening f16 to f128" {
32 // TODO https://github.com/ziglang/zig/issues/328236 // TODO https://github.com/ziglang/zig/issues/3282
33 if (@import("builtin").arch == .aarch64) return error.SkipZigTest;37 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
35 var x: f16 = 12.34;43 var x: f16 = 12.34;
36 var y: f128 = x;44 var y: f128 = x;