Add a test for multiple cases of E0669
Signed-off-by: Levente Kurusa <lkurusa@acm.org>
This commit is contained in:
parent
32ee20f455
commit
46b9461c4b
2 changed files with 27 additions and 6 deletions
|
|
@ -21,6 +21,7 @@ fn main() {
|
|||
issue_37437();
|
||||
issue_40187();
|
||||
issue_54067();
|
||||
multiple_errors();
|
||||
}
|
||||
|
||||
fn issue_37433() {
|
||||
|
|
@ -55,3 +56,11 @@ fn issue_54067() {
|
|||
asm!("mov sp, $0"::"r"(addr)); //~ ERROR E0669
|
||||
}
|
||||
}
|
||||
|
||||
fn multiple_errors() {
|
||||
let addr: (u32, u32) = (1, 2);
|
||||
unsafe {
|
||||
asm!("mov sp, $0"::"r"(addr), //~ ERROR E0669
|
||||
"r"("hello e0669")); //~ ERROR E0669
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,33 +1,45 @@
|
|||
error[E0669]: invalid value for constraint in inline assembly
|
||||
--> $DIR/inline-asm-bad-operand.rs:28:24
|
||||
--> $DIR/inline-asm-bad-operand.rs:29:24
|
||||
|
|
||||
LL | asm!("" :: "r"("")); //~ ERROR E0669
|
||||
| ^^
|
||||
|
||||
error[E0669]: invalid value for constraint in inline assembly
|
||||
--> $DIR/inline-asm-bad-operand.rs:33:32
|
||||
--> $DIR/inline-asm-bad-operand.rs:34:32
|
||||
|
|
||||
LL | asm!("ret" : : "{rdi}"(target)); //~ ERROR E0669
|
||||
| ^^^^^^
|
||||
|
||||
error[E0669]: invalid value for constraint in inline assembly
|
||||
--> $DIR/inline-asm-bad-operand.rs:40:29
|
||||
--> $DIR/inline-asm-bad-operand.rs:41:29
|
||||
|
|
||||
LL | unsafe { asm!("" :: "i"(hello)) }; //~ ERROR E0669
|
||||
| ^^^^^
|
||||
|
||||
error[E0669]: invalid value for constraint in inline assembly
|
||||
--> $DIR/inline-asm-bad-operand.rs:48:38
|
||||
--> $DIR/inline-asm-bad-operand.rs:49:38
|
||||
|
|
||||
LL | asm!("movups $1, %xmm0"::"m"(arr)); //~ ERROR E0669
|
||||
| ^^^
|
||||
|
||||
error[E0669]: invalid value for constraint in inline assembly
|
||||
--> $DIR/inline-asm-bad-operand.rs:55:32
|
||||
--> $DIR/inline-asm-bad-operand.rs:56:32
|
||||
|
|
||||
LL | asm!("mov sp, $0"::"r"(addr)); //~ ERROR E0669
|
||||
| ^^^^
|
||||
|
||||
error: aborting due to 5 previous errors
|
||||
error[E0669]: invalid value for constraint in inline assembly
|
||||
--> $DIR/inline-asm-bad-operand.rs:63:32
|
||||
|
|
||||
LL | asm!("mov sp, $0"::"r"(addr), //~ ERROR E0669
|
||||
| ^^^^
|
||||
|
||||
error[E0669]: invalid value for constraint in inline assembly
|
||||
--> $DIR/inline-asm-bad-operand.rs:64:32
|
||||
|
|
||||
LL | "r"("hello e0669")); //~ ERROR E0669
|
||||
| ^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to 7 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0669`.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue