mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-09-11 23:19:30 +00:00
21 lines
431 B
LLVM
21 lines
431 B
LLVM
target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
|
|
target triple = "wasm32-unknown-unknown-wasm"
|
|
|
|
@allocFunction = constant ptr @runtime.alloc
|
|
|
|
declare ptr @runtime.alloc(i32, ptr)
|
|
|
|
declare void @use(ptr)
|
|
|
|
define void @passAllocator() {
|
|
entry:
|
|
call void @use(ptr @runtime.alloc)
|
|
ret void
|
|
}
|
|
|
|
define ptr @allocate() {
|
|
entry:
|
|
%allocation = call ptr @runtime.alloc(i32 4, ptr inttoptr (i32 5 to ptr))
|
|
ret ptr %allocation
|
|
}
|