asm: Work around LLVM bug on AArch64
Upstream issue: https://github.com/llvm/llvm-project/issues/58384 LLVM gets confused if we assign a 32-bit value to a 64-bit register, so pass the 32-bit register name to LLVM in that case.
This commit is contained in:
parent
c0a7612728
commit
03e4c76dcf
2 changed files with 70 additions and 3 deletions
16
src/test/ui/asm/aarch64/llvm-58384.rs
Normal file
16
src/test/ui/asm/aarch64/llvm-58384.rs
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
// only-aarch64
|
||||
// run-pass
|
||||
// needs-asm-support
|
||||
|
||||
// Test that we properly work around this LLVM issue:
|
||||
// https://github.com/llvm/llvm-project/issues/58384
|
||||
|
||||
use std::arch::asm;
|
||||
|
||||
fn main() {
|
||||
let a: i32;
|
||||
unsafe {
|
||||
asm!("", inout("x0") 435 => a);
|
||||
}
|
||||
assert_eq!(a, 435);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue