summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/WebAssembly
diff options
context:
space:
mode:
authorThomas Lively <tlively@google.com>2019-10-18 20:27:30 +0000
committerThomas Lively <tlively@google.com>2019-10-18 20:27:30 +0000
commit393d0f799f8828e9d8002766a9e9db21797451df (patch)
tree3d8ab2119713681752d60d57ab898349973380f2 /llvm/test/CodeGen/WebAssembly
parentc6921379f55ee566fb62ba5aa47b217cf7c5d960 (diff)
downloadbcm5719-llvm-393d0f799f8828e9d8002766a9e9db21797451df.tar.gz
bcm5719-llvm-393d0f799f8828e9d8002766a9e9db21797451df.zip
[WebAssembly] Allow multivalue signatures in object files
Summary: Also changes the wasm YAML format to reflect the possibility of having multiple return types and to put the returns after the params for consistency with the binary encoding. Reviewers: aheejin, sbc100 Subscribers: dschuff, jgravelle-google, hiraditya, sunfish, arphaman, rupprecht, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D69156 llvm-svn: 375283
Diffstat (limited to 'llvm/test/CodeGen/WebAssembly')
-rw-r--r--llvm/test/CodeGen/WebAssembly/multivalue.ll17
-rw-r--r--llvm/test/CodeGen/WebAssembly/tailcall.ll3
2 files changed, 19 insertions, 1 deletions
diff --git a/llvm/test/CodeGen/WebAssembly/multivalue.ll b/llvm/test/CodeGen/WebAssembly/multivalue.ll
index 877851f6a36..ee32852ef57 100644
--- a/llvm/test/CodeGen/WebAssembly/multivalue.ll
+++ b/llvm/test/CodeGen/WebAssembly/multivalue.ll
@@ -1,4 +1,5 @@
; RUN: llc < %s -asm-verbose=false -verify-machineinstrs -disable-wasm-fallthrough-return-opt -wasm-disable-explicit-locals -wasm-keep-registers -mattr=+multivalue | FileCheck %s
+; RUN: llc < %s --filetype=obj -mattr=+multivalue | obj2yaml | FileCheck %s --check-prefix OBJ
; Test that the multivalue returns, function types, and block types
; work as expected.
@@ -42,3 +43,19 @@ loop:
; CHECK-NEXT: .int8 43
; CHECK-NEXT: .int8 10
; CHECK-NEXT: .ascii "multivalue"
+
+; OBJ-LABEL: - Type: TYPE
+; OBJ-NEXT: Signatures:
+; OBJ-NEXT: - Index: 0
+; OBJ-NEXT: ParamTypes:
+; OBJ-NEXT: - I32
+; OBJ-NEXT: - I32
+; OBJ-NEXT: ReturnTypes:
+; OBJ-NEXT: - I32
+; OBJ-NEXT: - I32
+; OBJ-NEXT: - Index: 1
+; OBJ-NEXT: ParamTypes:
+; OBJ-NEXT: - I32
+; OBJ-NEXT: ReturnTypes:
+; OBJ-NEXT: - I32
+; OBJ-NEXT: - I64
diff --git a/llvm/test/CodeGen/WebAssembly/tailcall.ll b/llvm/test/CodeGen/WebAssembly/tailcall.ll
index a277b4f7bc2..f4d4499bcef 100644
--- a/llvm/test/CodeGen/WebAssembly/tailcall.ll
+++ b/llvm/test/CodeGen/WebAssembly/tailcall.ll
@@ -215,12 +215,13 @@ define i1 @mismatched_return_trunc() {
; return-called functions include the proper return types
; YAML-LABEL: - Index: 8
-; YAML-NEXT: ReturnType: I32
; YAML-NEXT: ParamTypes:
; YAML-NEXT: - I32
; YAML-NEXT: - F32
; YAML-NEXT: - I64
; YAML-NEXT: - F64
+; YAML-NEXT: ReturnTypes:
+; YAML-NEXT: - I32
define i32 @unique_caller(i32 (i32, float, i64, double)** %p) {
%f = load i32 (i32, float, i64, double)*, i32 (i32, float, i64, double)** %p
%v = tail call i32 %f(i32 0, float 0., i64 0, double 0.)
OpenPOWER on IntegriCloud