Skip to content

Commit 46b9461

Browse files
committed
Add a test for multiple cases of E0669
Signed-off-by: Levente Kurusa <[email protected]>
1 parent 32ee20f commit 46b9461

File tree

2 files changed

+27
-6
lines changed

2 files changed

+27
-6
lines changed

src/test/ui/inline-asm-bad-operand.rs

+9
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ fn main() {
2121
issue_37437();
2222
issue_40187();
2323
issue_54067();
24+
multiple_errors();
2425
}
2526

2627
fn issue_37433() {
@@ -55,3 +56,11 @@ fn issue_54067() {
5556
asm!("mov sp, $0"::"r"(addr)); //~ ERROR E0669
5657
}
5758
}
59+
60+
fn multiple_errors() {
61+
let addr: (u32, u32) = (1, 2);
62+
unsafe {
63+
asm!("mov sp, $0"::"r"(addr), //~ ERROR E0669
64+
"r"("hello e0669")); //~ ERROR E0669
65+
}
66+
}
+18-6
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,45 @@
11
error[E0669]: invalid value for constraint in inline assembly
2-
--> $DIR/inline-asm-bad-operand.rs:28:24
2+
--> $DIR/inline-asm-bad-operand.rs:29:24
33
|
44
LL | asm!("" :: "r"("")); //~ ERROR E0669
55
| ^^
66

77
error[E0669]: invalid value for constraint in inline assembly
8-
--> $DIR/inline-asm-bad-operand.rs:33:32
8+
--> $DIR/inline-asm-bad-operand.rs:34:32
99
|
1010
LL | asm!("ret" : : "{rdi}"(target)); //~ ERROR E0669
1111
| ^^^^^^
1212

1313
error[E0669]: invalid value for constraint in inline assembly
14-
--> $DIR/inline-asm-bad-operand.rs:40:29
14+
--> $DIR/inline-asm-bad-operand.rs:41:29
1515
|
1616
LL | unsafe { asm!("" :: "i"(hello)) }; //~ ERROR E0669
1717
| ^^^^^
1818

1919
error[E0669]: invalid value for constraint in inline assembly
20-
--> $DIR/inline-asm-bad-operand.rs:48:38
20+
--> $DIR/inline-asm-bad-operand.rs:49:38
2121
|
2222
LL | asm!("movups $1, %xmm0"::"m"(arr)); //~ ERROR E0669
2323
| ^^^
2424

2525
error[E0669]: invalid value for constraint in inline assembly
26-
--> $DIR/inline-asm-bad-operand.rs:55:32
26+
--> $DIR/inline-asm-bad-operand.rs:56:32
2727
|
2828
LL | asm!("mov sp, $0"::"r"(addr)); //~ ERROR E0669
2929
| ^^^^
3030

31-
error: aborting due to 5 previous errors
31+
error[E0669]: invalid value for constraint in inline assembly
32+
--> $DIR/inline-asm-bad-operand.rs:63:32
33+
|
34+
LL | asm!("mov sp, $0"::"r"(addr), //~ ERROR E0669
35+
| ^^^^
36+
37+
error[E0669]: invalid value for constraint in inline assembly
38+
--> $DIR/inline-asm-bad-operand.rs:64:32
39+
|
40+
LL | "r"("hello e0669")); //~ ERROR E0669
41+
| ^^^^^^^^^^^^^
42+
43+
error: aborting due to 7 previous errors
3244

3345
For more information about this error, try `rustc --explain E0669`.

0 commit comments

Comments
 (0)