blob: 09a9708c09f3c31bce756f3533d3208aec51e2d3 [file] [log] [blame]
Wouter van Oortmerssen8a9cb242018-08-27 15:45:51 +00001; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -wasm-disable-explicit-locals -wasm-keep-registers | 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"
Sam Clegga5908002018-05-10 17:49:11 +00006target triple = "wasm32-unknown-unknown"
JF Bastiend7fcc6f2015-07-31 18:13:27 +00007
Dan Gohmane51c0582015-10-06 00:27:55 +00008; CHECK-LABEL: unused_first:
Wouter van Oortmerssen49482f82018-11-19 17:10:36 +00009; CHECK-NEXT: .functype unused_first (i32, i32) -> (i32){{$}}
Dan Gohman4ba48162015-11-18 16:12:01 +000010; CHECK-NEXT: return $1{{$}}
JF Bastiend7fcc6f2015-07-31 18:13:27 +000011define i32 @unused_first(i32 %x, i32 %y) {
12 ret i32 %y
13}
14
Dan Gohmane51c0582015-10-06 00:27:55 +000015; CHECK-LABEL: unused_second:
Wouter van Oortmerssen49482f82018-11-19 17:10:36 +000016; CHECK-NEXT: .functype unused_second (i32, i32) -> (i32){{$}}
Dan Gohman4ba48162015-11-18 16:12:01 +000017; CHECK-NEXT: return $0{{$}}
JF Bastiend7fcc6f2015-07-31 18:13:27 +000018define i32 @unused_second(i32 %x, i32 %y) {
19 ret i32 %x
20}
Dan Gohman058fce52015-11-13 00:21:05 +000021
22; CHECK-LABEL: call_something:
Wouter van Oortmerssen49482f82018-11-19 17:10:36 +000023; CHECK: {{^}} i32.call $drop=, return_something@FUNCTION{{$}}
Dan Gohman058fce52015-11-13 00:21:05 +000024; CHECK-NEXT: return{{$}}
25declare i32 @return_something()
26define void @call_something() {
Dan Gohman19601fb2015-11-14 23:17:07 +000027 call i32 @return_something()
28 ret void
Dan Gohman058fce52015-11-13 00:21:05 +000029}