Closed
Description
I could only produce this error when running cargo test
(I actually used cross test
), and only on riscv64gc-unknown-linux-gnu
. This was discovered in stdsimd
: rust-lang/portable-simd#34 (failing github actions job).
Code
#![feature(link_llvm_intrinsics, repr_simd, simd_ffi)]
#[allow(non_camel_case_types)]
#[repr(simd)]
struct v2f32(f32, f32);
#[allow(improper_ctypes)]
extern "C" {
#[link_name = "llvm.round.v2f32"]
fn round_v2f32(x: v2f32) -> v2f32;
}
#[cfg(test)]
mod test {
#[test]
fn round_v2f32() {
let _ = unsafe { crate::round_v2f32(crate::v2f32(0.5, 0.5)) };
}
}
Meta
rustc --version --verbose
:
rustc 1.49.0-nightly (38d911dfc 2020-10-09)
binary: rustc
commit-hash: 38d911dfc55a7a1eea1c80139113ed2ff0151087
commit-date: 2020-10-09
host: x86_64-apple-darwin
release: 1.49.0-nightly
LLVM version: 11.0
Error output
Compiling llvminttest v0.1.0 (/project)
Intrinsic has incorrect return type!
i64 (i64)* @llvm.round.v2f32
in function _ZN11llvminttest4test11round_v2f3217h00423c4f93b51af2E
LLVM ERROR: Broken function found, compilation aborted!
error: could not compile `llvminttest`.
To learn more, run the command again with --verbose.