summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/WebAssembly/function-bitcasts.ll
diff options
context:
space:
mode:
authorSam Clegg <sbc@chromium.org>2019-08-21 19:52:33 +0000
committerSam Clegg <sbc@chromium.org>2019-08-21 19:52:33 +0000
commitdde8a25a4bd0b8e194ebb9277d656f6069c26449 (patch)
tree9f2030d631807245d5a55f04deab63b7946a41c0 /llvm/test/CodeGen/WebAssembly/function-bitcasts.ll
parent3f59bfd5be39687cd3a853aaffe8ef2d84ab2ff8 (diff)
downloadbcm5719-llvm-dde8a25a4bd0b8e194ebb9277d656f6069c26449.tar.gz
bcm5719-llvm-dde8a25a4bd0b8e194ebb9277d656f6069c26449.zip
[WebAssembly] Handle aliases in WebAssemblyFixFunctionBitcasts
Fixes: https://github.com/emscripten-core/emscripten/issues/8770 Differential Revision: https://reviews.llvm.org/D66508 llvm-svn: 369566
Diffstat (limited to 'llvm/test/CodeGen/WebAssembly/function-bitcasts.ll')
-rw-r--r--llvm/test/CodeGen/WebAssembly/function-bitcasts.ll19
1 files changed, 18 insertions, 1 deletions
diff --git a/llvm/test/CodeGen/WebAssembly/function-bitcasts.ll b/llvm/test/CodeGen/WebAssembly/function-bitcasts.ll
index eff69ebfec2..91bb1b6dbc3 100644
--- a/llvm/test/CodeGen/WebAssembly/function-bitcasts.ll
+++ b/llvm/test/CodeGen/WebAssembly/function-bitcasts.ll
@@ -5,7 +5,11 @@
target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
target triple = "wasm32-unknown-unknown"
-declare void @has_i32_arg(i32)
+define void @has_i32_arg(i32) {
+entry:
+ ret void
+}
+
declare void @has_struct_arg({i32})
declare i32 @has_i32_ret()
declare void @vararg(...)
@@ -54,6 +58,19 @@ entry:
ret void
}
+; Calling aliases should also generate a wrapper
+
+@alias_i32_arg = weak hidden alias void (i32), void (i32)* @has_i32_arg
+
+; CHECK-LABEL: test_alias:
+; CHECK: call .Lhas_i32_arg_bitcast.2
+define void @test_alias() {
+entry:
+ call void bitcast (void (i32)* @alias_i32_arg to void ()*)()
+ ret void
+}
+
+
; CHECK-LABEL: test_structs:
; CHECK: call .Lhas_i32_arg_bitcast.1, $pop{{[0-9]+}}, $pop{{[0-9]+$}}
; CHECK: call .Lhas_i32_arg_bitcast, $0, $pop2
OpenPOWER on IntegriCloud