Add some more tests
This commit is contained in:
parent
11580ced40
commit
28aec1beaa
3 changed files with 45 additions and 1 deletions
12
src/test/ui/asm/asm-literal-escaping.rs
Normal file
12
src/test/ui/asm/asm-literal-escaping.rs
Normal 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");
|
||||||
|
}
|
||||||
|
}
|
|
@ -44,4 +44,14 @@ extern "C" fn baz() {
|
||||||
0 //~ ERROR mismatched types
|
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() {}
|
fn main() {}
|
||||||
|
|
|
@ -52,7 +52,29 @@ LL | 0
|
||||||
= note: expected type `()`
|
= note: expected type `()`
|
||||||
found type `{integer}`
|
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.
|
Some errors have detailed explanations: E0308, E0560.
|
||||||
For more information about an error, try `rustc --explain E0308`.
|
For more information about an error, try `rustc --explain E0308`.
|
||||||
|
|
Loading…
Add table
Reference in a new issue