another inline asm test + disable on msvc

pull/2791/head
Alexander Medvednikov 2019-11-17 01:07:21 +03:00
parent 2964bf9e23
commit 6c51d0bb78
1 changed files with 20 additions and 6 deletions

View File

@ -1,14 +1,28 @@
fn test_inline_asm() {
$if !windows {
$if !tinyc {
a := 10
b := 0
unsafe {
asm ("movl %1, %%eax;"
"movl %%eax, %0;"
:"=r"(b)
:"r"(a)
:"%eax"
)
asm (
"movl %1, %%eax;"
"movl %%eax, %0;"
:"=r"(b)
:"r"(a)
:"%eax"
)
}
assert a == 10
assert b == 10
//
e := 0
unsafe {
asm(
"movl $5, %0"
:"=a"(e)
)
}
assert e == 5
}
}
}