rust/tests/ui/asm/aarch64/parse-error.rs
Folkert de Vries 85f9dce889
in aarch64 asm parse error tests, only test cases specific to that target
this is more in line with the x86 parse error tests. The cross-platform tests were more complete anyway
2025-05-19 11:11:55 +02:00

20 lines
670 B
Rust

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