X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Ftest%2Fui%2Fabi%2Fabi-sysv64-register-usage.rs;h=e3eff2eb1433e5b30186b1d83631c229454f4884;hb=54f357836ec5786fa7f6f08626ee5b692ccb2757;hp=9eba9e0ca769cd63c7df5bc5b7339f8f80e02718;hpb=4d6c2cce0adbb5deeeffe7eac6a27aedcfe03437;p=rust.git diff --git a/src/test/ui/abi/abi-sysv64-register-usage.rs b/src/test/ui/abi/abi-sysv64-register-usage.rs index 9eba9e0ca76..e3eff2eb143 100644 --- a/src/test/ui/abi/abi-sysv64-register-usage.rs +++ b/src/test/ui/abi/abi-sysv64-register-usage.rs @@ -5,9 +5,7 @@ // ignore-android // ignore-arm // ignore-aarch64 - -#![feature(llvm_asm)] -#![allow(deprecated)] // llvm_asm! +#![feature(asm_sym)] #[cfg(target_arch = "x86_64")] pub extern "sysv64" fn all_the_registers(rdi: i64, rsi: i64, rdx: i64, @@ -54,37 +52,37 @@ pub extern "sysv64" fn large_struct_by_val(mut foo: LargeStruct) -> LargeStruct #[cfg(target_arch = "x86_64")] pub fn main() { + use std::arch::asm; + let result: i64; unsafe { - llvm_asm!("mov rdi, 1; - mov rsi, 2; - mov rdx, 3; - mov rcx, 4; - mov r8, 5; - mov r9, 6; - mov eax, 0x3F800000; - movd xmm0, eax; - mov eax, 0x40000000; - movd xmm1, eax; - mov eax, 0x40800000; - movd xmm2, eax; - mov eax, 0x41000000; - movd xmm3, eax; - mov eax, 0x41800000; - movd xmm4, eax; - mov eax, 0x42000000; - movd xmm5, eax; - mov eax, 0x42800000; - movd xmm6, eax; - mov eax, 0x43000000; - movd xmm7, eax; - call r10 - " - : "={rax}"(result) - : "{r10}"(all_the_registers as usize) - : "rdi", "rsi", "rdx", "rcx", "r8", "r9", "r11", "cc", "memory" - : "intel", "alignstack" - ) + asm!("mov rdi, 1", + "mov rsi, 2", + "mov rdx, 3", + "mov rcx, 4", + "mov r8, 5", + "mov r9, 6", + "mov eax, 0x3F800000", + "movd xmm0, eax", + "mov eax, 0x40000000", + "movd xmm1, eax", + "mov eax, 0x40800000", + "movd xmm2, eax", + "mov eax, 0x41000000", + "movd xmm3, eax", + "mov eax, 0x41800000", + "movd xmm4, eax", + "mov eax, 0x42000000", + "movd xmm5, eax", + "mov eax, 0x42800000", + "movd xmm6, eax", + "mov eax, 0x43000000", + "movd xmm7, eax", + "call {0}", + sym all_the_registers, + out("rax") result, + clobber_abi("sysv64"), + ); } assert_eq!(result, 42);