Skip to content

Commit

Permalink
Add a test for #22892
Browse files Browse the repository at this point in the history
  • Loading branch information
varkor committed Mar 12, 2019
1 parent e3297e7 commit 295b6fd
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/test/ui/asm/invalid-inline-asm.rs
@@ -0,0 +1,9 @@
#![feature(asm)]

fn main() {
let byte = 0;
let port = 0x80;

unsafe { asm!("out %al, %dx" :: "a" (byte), "d" (port) :: "volatile"); }
//~^ ERROR couldn't allocate input reg for constraint 'a'
}
8 changes: 8 additions & 0 deletions src/test/ui/asm/invalid-inline-asm.stderr
@@ -0,0 +1,8 @@
error: couldn't allocate input reg for constraint 'a'
--> $DIR/invalid-inline-asm.rs:7:14
|
LL | unsafe { asm!("out %al, %dx" :: "a" (byte), "d" (port) :: "volatile"); }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to previous error

0 comments on commit 295b6fd

Please sign in to comment.