Add some more tests

This commit is contained in:
Vadim Petrochenkov 2019-11-17 01:11:35 +03:00
parent 11580ced40
commit 28aec1beaa
3 changed files with 45 additions and 1 deletions

View file

@ -0,0 +1,12 @@
// build-pass
// only-x86_64
#![feature(asm)]
fn main() {
unsafe {
// "nop" :: "r"(x) : "eax" : "volatile"
let x = 10;
asm!("\x6Eop" :: "\x72"(x) : "\x65ax" : "\x76olatile");
}
}

View file

@ -44,4 +44,14 @@ extern "C" fn baz() {
0 //~ ERROR mismatched types
}
#[recollect_attr]
extern "Rust" fn rust_abi() {
0 //~ ERROR mismatched types
}
#[recollect_attr]
extern "\x43" fn c_abi_escaped() {
0 //~ ERROR mismatched types
}
fn main() {}

View file

@ -52,7 +52,29 @@ LL | 0
= note: expected type `()`
found type `{integer}`
error: aborting due to 6 previous errors
error[E0308]: mismatched types
--> $DIR/span-preservation.rs:49:5
|
LL | extern "Rust" fn rust_abi() {
| - possibly return type missing here?
LL | 0
| ^ expected (), found integer
|
= note: expected type `()`
found type `{integer}`
error[E0308]: mismatched types
--> $DIR/span-preservation.rs:54:5
|
LL | extern "\x43" fn c_abi_escaped() {
| - possibly return type missing here?
LL | 0
| ^ expected (), found integer
|
= note: expected type `()`
found type `{integer}`
error: aborting due to 8 previous errors
Some errors have detailed explanations: E0308, E0560.
For more information about an error, try `rustc --explain E0308`.