Skip to content

Commit

Permalink
Add test for issue 99071
Browse files Browse the repository at this point in the history
  • Loading branch information
Amanieu committed Jul 11, 2022
1 parent e51f1b7 commit dfe68ee
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/test/ui/asm/issue-99071.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// compile-flags: --target thumbv6m-none-eabi
// needs-llvm-components: arm
// needs-asm-support

#![feature(no_core, lang_items, rustc_attrs)]
#![no_core]
#![crate_type = "rlib"]

#[rustc_builtin_macro]
macro_rules! asm {
() => {};
}
#[lang = "sized"]
trait Sized {}

pub fn foo() {
unsafe {
asm!("", in("r8") 0);
//~^ cannot use register `r8`: high registers (r8+) can only be used as clobbers in Thumb-1 code
}
}
8 changes: 8 additions & 0 deletions src/test/ui/asm/issue-99071.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
error: cannot use register `r8`: high registers (r8+) can only be used as clobbers in Thumb-1 code
--> $DIR/issue-99071.rs:18:18
|
LL | asm!("", in("r8") 0);
| ^^^^^^^^^^

error: aborting due to previous error

0 comments on commit dfe68ee

Please sign in to comment.