-
Notifications
You must be signed in to change notification settings - Fork 13k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of #103897 - Amanieu:llvm-58384, r=davidtwco
asm: Work around LLVM bug on AArch64 Upstream issue: llvm/llvm-project#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.
- Loading branch information
Showing
2 changed files
with
70 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
} |