Stabilize asm_sym
This commit is contained in:
parent
4310bbdfa6
commit
affe23bc3b
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user