compiler: move wasm ABI workaround to transform package

By considering this as a regular transformation, it can be easily
tested.
This commit is contained in:
Ayke van Laethem
2019-12-07 23:01:20 +01:00
committed by Ron Evans
parent 91299b6466
commit 4d79d473c4
6 changed files with 248 additions and 133 deletions
+28
View File
@@ -0,0 +1,28 @@
target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
target triple = "wasm32-unknown-unknown-wasm"
declare i64 @externalCall(i8*, i32, i64)
define internal i64 @testCall(i8* %ptr, i32 %len, i64 %foo) {
%val = call i64 @externalCall(i8* %ptr, i32 %len, i64 %foo)
ret i64 %val
}
define internal i64 @testCallNonEntry(i8* %ptr, i32 %len) {
entry:
br label %bb1
bb1:
%val = call i64 @externalCall(i8* %ptr, i32 %len, i64 3)
ret i64 %val
}
define void @exportedFunction(i64 %foo) {
%unused = shl i64 %foo, 1
ret void
}
define internal void @callExportedFunction(i64 %foo) {
call void @exportedFunction(i64 %foo)
ret void
}