blob: ff943b215438a07c8020370e13ea3718c79778ce [file] [log] [blame]
Dan Gohmanb7c24002016-05-21 00:21:56 +00001; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt | FileCheck %s
JF Bastiend7fcc6f2015-07-31 18:13:27 +00002
3; Make sure that argument offsets are correct even if some arguments are unused.
4
Dan Gohman0c6f5ac2016-01-07 03:19:23 +00005target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
JF Bastiend7fcc6f2015-07-31 18:13:27 +00006target triple = "wasm32-unknown-unknown"
7
Dan Gohmane51c0582015-10-06 00:27:55 +00008; CHECK-LABEL: unused_first:
Dan Gohman53828fd2015-11-23 16:50:18 +00009; CHECK-NEXT: .param i32, i32{{$}}
Dan Gohmane51c0582015-10-06 00:27:55 +000010; CHECK-NEXT: .result i32{{$}}
Dan Gohman4ba48162015-11-18 16:12:01 +000011; CHECK-NEXT: return $1{{$}}
JF Bastiend7fcc6f2015-07-31 18:13:27 +000012define i32 @unused_first(i32 %x, i32 %y) {
13 ret i32 %y
14}
15
Dan Gohmane51c0582015-10-06 00:27:55 +000016; CHECK-LABEL: unused_second:
Dan Gohman53828fd2015-11-23 16:50:18 +000017; CHECK-NEXT: .param i32, i32{{$}}
Dan Gohmane51c0582015-10-06 00:27:55 +000018; CHECK-NEXT: .result i32{{$}}
Dan Gohman4ba48162015-11-18 16:12:01 +000019; CHECK-NEXT: return $0{{$}}
JF Bastiend7fcc6f2015-07-31 18:13:27 +000020define i32 @unused_second(i32 %x, i32 %y) {
21 ret i32 %x
22}
Dan Gohman058fce52015-11-13 00:21:05 +000023
24; CHECK-LABEL: call_something:
Dan Gohman71008092016-05-17 23:19:03 +000025; CHECK-NEXT: {{^}} i32.call $drop=, return_something@FUNCTION{{$}}
Dan Gohman058fce52015-11-13 00:21:05 +000026; CHECK-NEXT: return{{$}}
27declare i32 @return_something()
28define void @call_something() {
Dan Gohman19601fb2015-11-14 23:17:07 +000029 call i32 @return_something()
30 ret void
Dan Gohman058fce52015-11-13 00:21:05 +000031}