-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Expand file tree
/
Copy pathx86_64_parse_error.rs
More file actions
25 lines (23 loc) · 833 Bytes
/
x86_64_parse_error.rs
File metadata and controls
25 lines (23 loc) · 833 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
//@ add-minicore
//@ compile-flags: --target x86_64-unknown-linux-gnu
//@ needs-llvm-components: x86
#![crate_type = "lib"]
#![feature(no_core)]
#![no_core]
extern crate minicore;
use minicore::*;
fn main() {
let mut foo = 0;
let mut bar = 0;
unsafe {
asm!("", a = in("eax") foo);
//~^ ERROR explicit register arguments cannot have names
asm!("{a}", in("eax") foo, a = const bar);
//~^ ERROR attempt to use a non-constant value in a constant
asm!("{a}", in("eax") foo, a = const bar);
//~^ ERROR attempt to use a non-constant value in a constant
asm!("{1}", in("eax") foo, const bar);
//~^ ERROR positional arguments cannot follow named arguments or explicit register arguments
//~| ERROR attempt to use a non-constant value in a constant
}
}