about summary refs log tree commit diff
path: root/tests/ui/asm/x86_64/x86_64_parse_error.rs
blob: 3df0febf6b0705ed2427997c3e21b17c16dfba0b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
//@ only-x86_64

use std::arch::asm;

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
    }
}