summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/WebAssembly/call.ll
diff options
context:
space:
mode:
authorDan Gohman <dan433584@gmail.com>2015-09-09 01:52:45 +0000
committerDan Gohman <dan433584@gmail.com>2015-09-09 01:52:45 +0000
commite590b33bf88561c1a5b9ae76823562b16934d2cd (patch)
tree9eb0f01f18b0a38fec109f551d9d8055055d53cb /llvm/test/CodeGen/WebAssembly/call.ll
parent0d22f2d57eaa7f8807b88dab1efe45707a9a1827 (diff)
downloadbcm5719-llvm-e590b33bf88561c1a5b9ae76823562b16934d2cd.tar.gz
bcm5719-llvm-e590b33bf88561c1a5b9ae76823562b16934d2cd.zip
[WebAssembly] Fix lowering of calls with more than one argument.
llvm-svn: 247118
Diffstat (limited to 'llvm/test/CodeGen/WebAssembly/call.ll')
-rw-r--r--llvm/test/CodeGen/WebAssembly/call.ll13
1 files changed, 13 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/WebAssembly/call.ll b/llvm/test/CodeGen/WebAssembly/call.ll
index d0ad7fd3edf..d628ec09630 100644
--- a/llvm/test/CodeGen/WebAssembly/call.ll
+++ b/llvm/test/CodeGen/WebAssembly/call.ll
@@ -7,6 +7,7 @@ target triple = "wasm32-unknown-unknown"
declare i32 @i32_nullary()
declare i32 @i32_unary(i32)
+declare i32 @i32_binary(i32, i32)
declare i64 @i64_nullary()
declare float @float_nullary()
declare double @double_nullary()
@@ -62,6 +63,18 @@ define i32 @call_i32_unary(i32 %a) {
ret i32 %r
}
+; CHECK-LABEL: (func $call_i32_binary
+; CHECK-NEXT: (param i32) (param i32) (result i32)
+; CHECK-NEXT: (setlocal @0 (argument 1))
+; CHECK-NEXT: (setlocal @1 (argument 0))
+; CHECK-NEXT: (setlocal @2 (global $i32_binary))
+; CHECK-NEXT: (setlocal @3 (call @2 @1 @0))
+; CHECK-NEXT: (return @3)
+define i32 @call_i32_binary(i32 %a, i32 %b) {
+ %r = call i32 @i32_binary(i32 %a, i32 %b)
+ ret i32 %r
+}
+
; FIXME test the following:
; - Functions without return.
; - More argument combinations.
OpenPOWER on IntegriCloud