Skip to content

Commit 295b6fd

Browse files
committed
Add a test for rust-lang#22892
1 parent e3297e7 commit 295b6fd

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

src/test/ui/asm/invalid-inline-asm.rs

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#![feature(asm)]
2+
3+
fn main() {
4+
let byte = 0;
5+
let port = 0x80;
6+
7+
unsafe { asm!("out %al, %dx" :: "a" (byte), "d" (port) :: "volatile"); }
8+
//~^ ERROR couldn't allocate input reg for constraint 'a'
9+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
error: couldn't allocate input reg for constraint 'a'
2+
--> $DIR/invalid-inline-asm.rs:7:14
3+
|
4+
LL | unsafe { asm!("out %al, %dx" :: "a" (byte), "d" (port) :: "volatile"); }
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6+
7+
error: aborting due to previous error
8+

0 commit comments

Comments
 (0)