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,8 +1,11 @@
fn test_inline_asm() { fn test_inline_asm() {
$if !windows {
$if !tinyc {
a := 10 a := 10
b := 0 b := 0
unsafe { unsafe {
asm ("movl %1, %%eax;" asm (
"movl %1, %%eax;"
"movl %%eax, %0;" "movl %%eax, %0;"
:"=r"(b) :"=r"(b)
:"r"(a) :"r"(a)
@ -11,4 +14,15 @@ fn test_inline_asm() {
} }
assert a == 10 assert a == 10
assert b == 10 assert b == 10
//
e := 0
unsafe {
asm(
"movl $5, %0"
:"=a"(e)
)
}
assert e == 5
}
}
} }