Stabilize asm_sym

This commit is contained in:
Amanieu d'Antras 2022-10-17 22:38:37 +01:00 committed by Antoni Boucher
parent 4310bbdfa6
commit affe23bc3b

View File

@ -3,11 +3,12 @@
// Run-time:
// status: 0
#![feature(asm_const, asm_sym)]
#![feature(asm_const)]
use std::arch::{asm, global_asm};
global_asm!("
global_asm!(
"
.global add_asm
add_asm:
mov rax, rdi
@ -132,7 +133,9 @@ fn main() {
assert_eq!(x, 43);
// check sym fn
extern "C" fn foo() -> u64 { 42 }
extern "C" fn foo() -> u64 {
42
}
let x: u64;
unsafe {
asm!("call {}", sym foo, lateout("rax") x);