diff options
Diffstat (limited to 'tests/ui/asm/x86_64/x86_64_parse_error.rs')
-rw-r--r-- | tests/ui/asm/x86_64/x86_64_parse_error.rs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/ui/asm/x86_64/x86_64_parse_error.rs b/tests/ui/asm/x86_64/x86_64_parse_error.rs new file mode 100644 index 000000000..715a67687 --- /dev/null +++ b/tests/ui/asm/x86_64/x86_64_parse_error.rs @@ -0,0 +1,21 @@ +// only-x86_64 + +#![feature(asm_const)] + +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 + } +} |