1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00
v/vlib/compiler/tests/asm_test.v
Alexander Medvednikov 2964bf9e23 inline assembly
2019-11-17 00:59:49 +03:00

15 lines
183 B
V

fn test_inline_asm() {
a := 10
b := 0
unsafe {
asm ("movl %1, %%eax;"
"movl %%eax, %0;"
:"=r"(b)
:"r"(a)
:"%eax"
)
}
assert a == 10
assert b == 10
}