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

use std::arch::asm;

fn main() {
    let mut foo = 0;
    let mut bar = 0;
    unsafe {
        asm!("", a = in("x0") foo);
        //~^ ERROR explicit register arguments cannot have names
        asm!("{a}", in("x0") foo, a = const bar);
        //~^ ERROR attempt to use a non-constant value in a constant
        asm!("{a}", in("x0") foo, a = const bar);
        //~^ ERROR attempt to use a non-constant value in a constant
        asm!("{1}", in("x0") 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
    }
}