tinygo/transform/testdata/wasm-abi.out.ll
Ayke van Laethem 0afd42c439 main: switch to LLVM 10
This commit also adds a bit of version independence, in particular for
external commands. It also adds the LLVM version to the `tinygo version`
command, which might help while debugging.
2020-04-09 20:23:51 +02:00

45 строки
1,2 КиБ
LLVM

target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
target triple = "wasm32-unknown-unknown-wasm"
declare i64 @"externalCall$i64wrap"(i8*, i32, i64)
define internal i64 @testCall(i8* %ptr, i32 %len, i64 %foo) {
%i64asptr = alloca i64
%i64asptr1 = alloca i64
store i64 %foo, i64* %i64asptr1
call void @externalCall(i64* %i64asptr, i8* %ptr, i32 %len, i64* %i64asptr1)
%retval = load i64, i64* %i64asptr
ret i64 %retval
}
define internal i64 @testCallNonEntry(i8* %ptr, i32 %len) {
entry:
%i64asptr = alloca i64
%i64asptr1 = alloca i64
br label %bb1
bb1: ; preds = %entry
store i64 3, i64* %i64asptr1
call void @externalCall(i64* %i64asptr, i8* %ptr, i32 %len, i64* %i64asptr1)
%retval = load i64, i64* %i64asptr
ret i64 %retval
}
define internal void @"exportedFunction$i64wrap"(i64 %foo) unnamed_addr {
%unused = shl i64 %foo, 1
ret void
}
define internal void @callExportedFunction(i64 %foo) {
call void @"exportedFunction$i64wrap"(i64 %foo)
ret void
}
declare void @externalCall(i64*, i8*, i32, i64*)
define void @exportedFunction(i64* %0) {
entry:
%i64 = load i64, i64* %0
call void @"exportedFunction$i64wrap"(i64 %i64)
ret void
}