Files
c3c/test/test_suite/asm/syscall.c3t
pini 76fa404b89 Feat/asm x86 (#1046)
* fix(asm): consider asm blocks as volatile
When asm blocks are not marked as volatile, they may be (wrongly)
discarded by LLVM optimization passes.
* fix(asm): mark syscall as clobbering return register
The `syscall` instruction returns the system call result in the `rax`
register.
* feat(asm): add push instructions.
* feat(asm): add pop instructions
2023-10-14 20:50:45 +02:00

18 lines
327 B
C

// #target: macos-x64
module testing;
fn void start() @export("_start") @naked @nostrip {
asm {
syscall;
}
}
/* #expect: testing.ll
define void @_start() #0 {
entry:
call void asm sideeffect alignstack "syscall \0A", "~{cc},~{rax},~{rcx},~{r11},~{flags},~{dirflag},~{fspr}"()
ret void
}