add compiletest for debuginfo generation for SVE predicates <vscale x N x i1> where N != 16
This commit is contained in:
parent
f9007bcb87
commit
4c485a4c97
1 changed files with 39 additions and 0 deletions
39
tests/ui/scalable-vectors/debuginfo-does-not-spill.rs
Normal file
39
tests/ui/scalable-vectors/debuginfo-does-not-spill.rs
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
// Compiletest for rust-lang/rust#150419: Do not spill operands to the stack when
|
||||
// creating debuginfo for AArch64 SVE predicates `<vscale x N x i1>` where `N != 16`
|
||||
//@ edition: 2021
|
||||
//@ only-aarch64
|
||||
//@ build-pass
|
||||
//@ compile-flags: -C debuginfo=2 -C target-feature=+sve
|
||||
|
||||
#![crate_type = "lib"]
|
||||
#![allow(internal_features)]
|
||||
#![feature(rustc_attrs, link_llvm_intrinsics)]
|
||||
|
||||
#[rustc_scalable_vector(16)]
|
||||
#[allow(non_camel_case_types)]
|
||||
#[repr(transparent)]
|
||||
pub struct svbool_t(bool);
|
||||
|
||||
#[rustc_scalable_vector(4)]
|
||||
#[allow(non_camel_case_types)]
|
||||
#[repr(transparent)]
|
||||
pub struct svbool4_t(bool);
|
||||
|
||||
impl std::convert::Into<svbool_t> for svbool4_t {
|
||||
#[inline(always)]
|
||||
fn into(self) -> svbool_t {
|
||||
unsafe extern "C" {
|
||||
#[link_name = "llvm.aarch64.sve.convert.to.svbool.nxv4i1"]
|
||||
fn convert_to_svbool(b: svbool4_t) -> svbool_t;
|
||||
}
|
||||
unsafe { convert_to_svbool(self) }
|
||||
}
|
||||
}
|
||||
|
||||
pub fn svwhilelt_b32_u64(op1: u64, op2: u64) -> svbool_t {
|
||||
unsafe extern "C" {
|
||||
#[link_name = "llvm.aarch64.sve.whilelo.nxv4i1.u64"]
|
||||
fn _svwhilelt_b32_u64(op1: u64, op2: u64) -> svbool4_t;
|
||||
}
|
||||
unsafe { _svwhilelt_b32_u64(op1, op2) }.into()
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue