Skip to content

Commit 28aec1b

Browse files
committed
Add some more tests
1 parent 11580ce commit 28aec1b

File tree

3 files changed

+45
-1
lines changed

3 files changed

+45
-1
lines changed
+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// build-pass
2+
// only-x86_64
3+
4+
#![feature(asm)]
5+
6+
fn main() {
7+
unsafe {
8+
// "nop" :: "r"(x) : "eax" : "volatile"
9+
let x = 10;
10+
asm!("\x6Eop" :: "\x72"(x) : "\x65ax" : "\x76olatile");
11+
}
12+
}

src/test/ui/proc-macro/span-preservation.rs

+10
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,14 @@ extern "C" fn baz() {
4444
0 //~ ERROR mismatched types
4545
}
4646

47+
#[recollect_attr]
48+
extern "Rust" fn rust_abi() {
49+
0 //~ ERROR mismatched types
50+
}
51+
52+
#[recollect_attr]
53+
extern "\x43" fn c_abi_escaped() {
54+
0 //~ ERROR mismatched types
55+
}
56+
4757
fn main() {}

src/test/ui/proc-macro/span-preservation.stderr

+23-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,29 @@ LL | 0
5252
= note: expected type `()`
5353
found type `{integer}`
5454

55-
error: aborting due to 6 previous errors
55+
error[E0308]: mismatched types
56+
--> $DIR/span-preservation.rs:49:5
57+
|
58+
LL | extern "Rust" fn rust_abi() {
59+
| - possibly return type missing here?
60+
LL | 0
61+
| ^ expected (), found integer
62+
|
63+
= note: expected type `()`
64+
found type `{integer}`
65+
66+
error[E0308]: mismatched types
67+
--> $DIR/span-preservation.rs:54:5
68+
|
69+
LL | extern "\x43" fn c_abi_escaped() {
70+
| - possibly return type missing here?
71+
LL | 0
72+
| ^ expected (), found integer
73+
|
74+
= note: expected type `()`
75+
found type `{integer}`
76+
77+
error: aborting due to 8 previous errors
5678

5779
Some errors have detailed explanations: E0308, E0560.
5880
For more information about an error, try `rustc --explain E0308`.

0 commit comments

Comments
 (0)