diff options
| author | Johnathan Van Why <jrvanwhy@google.com> | 2021-02-14 22:05:33 -0800 |
|---|---|---|
| committer | Johnathan Van Why <jrvanwhy@google.com> | 2021-02-14 23:41:10 -0800 |
| commit | fd21eb18e96db98ff4f354f51d91051cf1533433 (patch) | |
| tree | ff17f9e1fbea583c6d668faadff232be425c1d17 /src/test/assembly | |
| parent | 9503ea19edbf01b9435e80e17d60ce1b88390116 (diff) | |
| download | rust-fd21eb18e96db98ff4f354f51d91051cf1533433.tar.gz rust-fd21eb18e96db98ff4f354f51d91051cf1533433.zip | |
32-bit ARM: Emit `lr` instead of `r14` when specified as an `asm!` output register.
On 32-bit ARM platforms, the register `r14` has the alias `lr`. When used as an output register in `asm!`, rustc canonicalizes the name to `r14`. LLVM only knows the register by the name `lr`, and rejects it. This changes rustc's LLVM code generation to output `lr` instead.
Diffstat (limited to 'src/test/assembly')
| -rw-r--r-- | src/test/assembly/asm/arm-types.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/test/assembly/asm/arm-types.rs b/src/test/assembly/asm/arm-types.rs index 64b7c93cbc3..09901a7a39c 100644 --- a/src/test/assembly/asm/arm-types.rs +++ b/src/test/assembly/asm/arm-types.rs @@ -91,6 +91,15 @@ pub unsafe fn sym_static() { asm!("adr r0, {}", sym extern_static); } +// Regression test for #82052. +// CHECK-LABEL: issue_82052 +// CHECK: push {{.*}}lr +// CHECK: @APP +// CHECK: @NO_APP +pub unsafe fn issue_82052() { + asm!("", out("r14") _); +} + macro_rules! check { ($func:ident $ty:ident $class:ident $mov:literal) => { #[no_mangle] |
