mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
30 lines
321 B
V
30 lines
321 B
V
fn test_inline_asm() {
|
|
/*
|
|
// QTODO
|
|
a := 10
|
|
b := 0
|
|
unsafe {
|
|
asm {
|
|
"movl %1, %%eax;"
|
|
"movl %%eax, %0;"
|
|
:"=r"(b)
|
|
:"r"(a)
|
|
:"%eax"
|
|
}
|
|
}
|
|
assert a == 10
|
|
assert b == 10
|
|
//
|
|
e := 0
|
|
unsafe {
|
|
asm {
|
|
//".intel_syntax noprefix;"
|
|
//"mov %0, 5"
|
|
"movl $5, %0"
|
|
:"=a"(e)
|
|
}
|
|
}
|
|
assert e == 5
|
|
*/
|
|
}
|