mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
23 lines
436 B
Plaintext
23 lines
436 B
Plaintext
// #target: macos-x64
|
|
module foo;
|
|
import libc;
|
|
fn void main()
|
|
{
|
|
void* foekf = &libc::printf;
|
|
int* xok = &libc::EXIT_SUCCESS;
|
|
}
|
|
|
|
/* #expect: foo.ll
|
|
|
|
@libc.EXIT_SUCCESS = extern_weak constant i32, align 4
|
|
|
|
define void @foo.main() #0 {
|
|
entry:
|
|
%foekf = alloca ptr, align 8
|
|
%xok = alloca ptr, align 8
|
|
store ptr @printf, ptr %foekf, align 8
|
|
store ptr @libc.EXIT_SUCCESS, ptr %xok, align 8
|
|
ret void
|
|
}
|
|
|
|
declare i32 @printf(ptr, ...) |