2018-08-27 23:45:51 +08:00
|
|
|
; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -wasm-disable-explicit-locals -wasm-keep-registers | FileCheck %s
|
2015-08-01 02:13:27 +08:00
|
|
|
|
|
|
|
; Make sure that argument offsets are correct even if some arguments are unused.
|
|
|
|
|
2016-01-07 11:19:23 +08:00
|
|
|
target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
|
2018-05-11 01:49:11 +08:00
|
|
|
target triple = "wasm32-unknown-unknown"
|
2015-08-01 02:13:27 +08:00
|
|
|
|
2015-10-06 08:27:55 +08:00
|
|
|
; CHECK-LABEL: unused_first:
|
2018-11-20 01:10:36 +08:00
|
|
|
; CHECK-NEXT: .functype unused_first (i32, i32) -> (i32){{$}}
|
2015-11-19 00:12:01 +08:00
|
|
|
; CHECK-NEXT: return $1{{$}}
|
2015-08-01 02:13:27 +08:00
|
|
|
define i32 @unused_first(i32 %x, i32 %y) {
|
|
|
|
ret i32 %y
|
|
|
|
}
|
|
|
|
|
2015-10-06 08:27:55 +08:00
|
|
|
; CHECK-LABEL: unused_second:
|
2018-11-20 01:10:36 +08:00
|
|
|
; CHECK-NEXT: .functype unused_second (i32, i32) -> (i32){{$}}
|
2015-11-19 00:12:01 +08:00
|
|
|
; CHECK-NEXT: return $0{{$}}
|
2015-08-01 02:13:27 +08:00
|
|
|
define i32 @unused_second(i32 %x, i32 %y) {
|
|
|
|
ret i32 %x
|
|
|
|
}
|
2015-11-13 08:21:05 +08:00
|
|
|
|
|
|
|
; CHECK-LABEL: call_something:
|
[WebAssembly] Replace all calls with generalized multivalue calls
Summary:
Extends the multivalue call infrastructure to tail calls, removes all
legacy calls specialized for particular result types, and removes the
CallIndirectFixup pass, since all indirect call arguments are now
fixed up directly in the post-insertion hook.
In order to keep supporting pretty-printed defs and uses in test
expectations, MCInstLower now inserts an immediate containing the
number of defs for each call and call_indirect. The InstPrinter is
updated to query this immediate if it is present and determine which
MCOperands are defs and uses accordingly.
Depends on D72902.
Reviewers: aheejin
Subscribers: dschuff, mgorny, sbc100, jgravelle-google, hiraditya, sunfish, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D74192
2020-02-07 08:29:59 +08:00
|
|
|
; CHECK: {{^}} call $drop=, return_something{{$}}
|
2015-11-13 08:21:05 +08:00
|
|
|
; CHECK-NEXT: return{{$}}
|
|
|
|
declare i32 @return_something()
|
|
|
|
define void @call_something() {
|
2015-11-15 07:17:07 +08:00
|
|
|
call i32 @return_something()
|
|
|
|
ret void
|
2015-11-13 08:21:05 +08:00
|
|
|
}
|