-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RISC-V behavior tests disabled #3338
Comments
Hi. I'm one of the LLVM RISC-V target developers. I tried to diagnose this issue but I can't seem to figure out how to crosscompile the zig test suite. The BTW, I suggest also testing zig releases with debug builds of LLVM. The zig 0.5 release seems to trip a few LLVM asserts, I had to comment-out one of them to get the zig test suite to compile (for the x86 host). |
Welcome, @luismarques.
This functionality has test coverage. What did you try, and what output did you get?
I did test this, with the merge of the llvm9 branch. If Zig is tripping any LLVM asserts, that is a regression since e81156b.
Have a look at https://github.com/ziglang/zig/blob/master/CONTRIBUTING.md. Ideally we would be able to do this to RISC-V test coverage: --- a/test/tests.zig
+++ b/test/tests.zig
@@ -70,6 +70,36 @@ const test_targets = [_]TestTarget{
.link_libc = true,
},
+ TestTarget{
+ .target = Target{
+ .Cross = CrossTarget{
+ .os = .linux,
+ .arch = builtin.Arch.riscv64,
+ .abi = .none,
+ },
+ },
+ },
+ TestTarget{
+ .target = Target{
+ .Cross = CrossTarget{
+ .os = .linux,
+ .arch = builtin.Arch.riscv64,
+ .abi = .musl,
+ },
+ },
+ .link_libc = true,
+ },
+ TestTarget{
+ .target = Target{
+ .Cross = CrossTarget{
+ .os = .linux,
+ .arch = builtin.Arch.riscv64,
+ .abi = .gnu,
+ },
+ },
+ .link_libc = true,
+ },
+
TestTarget{
.target = Target{
.Cross = CrossTarget{ If you apply this patch and then:
This will reveal RISC-V problems, when you re-enable the tests that are disabled. You can find these by grepping for riscv (from the build directory):
I'm looking forward to working with you. I'm excited for an open hardware standard such as RISC-V. |
I tried many combinations, I no longer recall all of them. Here's my reasoning. This works for the host (kind of, it ends up tripping an assertion):
...and
Therefore I would expect something like this to work:
You can download http://releases.llvm.org/9.0.0/llvm-9.0.0.src.tar.xz and http://releases.llvm.org/9.0.0/cfe-9.0.0.src.tar.xz and reproduce this issue. I used the following llvm/cfe cmake configurations:
I will continue to take a look at this, as time permits. Thanks.
Likewise! |
I fixed the LLVM assertion failure in a8d6954. I'm running the full test suite locally with a debug build of LLVM to find if there were any other regressions. (edit: found one: #3358)
diff --git a/test/stage1/behavior/cast.zig b/test/stage1/behavior/cast.zig
index 8176f5cf..04c7fa60 100644
--- a/test/stage1/behavior/cast.zig
+++ b/test/stage1/behavior/cast.zig
@@ -247,10 +247,6 @@ 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 1ff63e3e..e285d0eb 100644
--- a/test/stage1/behavior/math.zig
+++ b/test/stage1/behavior/math.zig
@@ -6,10 +6,6 @@ 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();
}
@@ -573,10 +569,6 @@ 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);
@@ -622,10 +614,6 @@ 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 a2f3773a..2fef4816 100644
--- a/test/stage1/behavior/new_stack_call.zig
+++ b/test/stage1/behavior/new_stack_call.zig
@@ -8,11 +8,6 @@ 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 1aa7ff5d..71f8ae48 100644
--- a/test/stage1/behavior/widening.zig
+++ b/test/stage1/behavior/widening.zig
@@ -19,10 +19,6 @@ 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;
@@ -35,10 +31,6 @@ 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;
The first problem you will run into will be:
|
I have the zig test suite passing after writing some fixes for these issues. Now I just need to transform the fixes into proper patches, with tests and so on. I'll see if those should be back-ported to LLVM 9. |
That was fast! Let me know when this stuff makes it into trunk and I'll try a full test suite with building musl & glibc and everything, and try to find if there is anything else. |
The patches have been posted for review. When they both land I'll let you know. |
I believe this should now work in HEAD. Sorry for not indicating that immediately after the last fix landed. |
Excellent! I'll leave this issue open until we update llvm dependency to 10.0.0, and enable the tests. |
These are all upstream issues with LLVM.
@newStackCall
causes:Issues with
f16
:The text was updated successfully, but these errors were encountered: