blob: eb12cdefbf3bab7b820d39f04a9ada7ea809f4a5 [file] [log] [blame]
JF Bastiend7fcc6f2015-07-31 18:13:27 +00001; RUN: llc < %s -asm-verbose=false | FileCheck %s
2
3; Make sure that argument offsets are correct even if some arguments are unused.
4
Dan Gohmandde8dce2015-08-19 20:30:20 +00005target datalayout = "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:
25; CHECK-NEXT: call return_something, $discard{{$}}
26; 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}