Add a test for #22892
This commit is contained in:
parent
e3297e7ce3
commit
295b6fd0f7
9
src/test/ui/asm/invalid-inline-asm.rs
Normal file
9
src/test/ui/asm/invalid-inline-asm.rs
Normal file
@ -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
src/test/ui/asm/invalid-inline-asm.stderr
Normal file
8
src/test/ui/asm/invalid-inline-asm.stderr
Normal file
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user