blob: 4f183b592e68acde0a5299e812649242e83bbcfd [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:
9; CHECK-NEXT: .param i32{{$}}
10; CHECK-NEXT: .param i32{{$}}
11; CHECK-NEXT: .result i32{{$}}
JF Bastien1d20a5e2015-10-16 00:53:49 +000012; CHECK-NEXT: .local i32{{$}}
13; CHECK-NEXT: get_local 1{{$}}
14; CHECK-NEXT: set_local 2, pop{{$}}
15; CHECK-NEXT: return (get_local 2){{$}}
JF Bastiend7fcc6f2015-07-31 18:13:27 +000016define i32 @unused_first(i32 %x, i32 %y) {
17 ret i32 %y
18}
19
Dan Gohmane51c0582015-10-06 00:27:55 +000020; CHECK-LABEL: unused_second:
21; CHECK-NEXT: .param i32{{$}}
22; CHECK-NEXT: .param i32{{$}}
23; CHECK-NEXT: .result i32{{$}}
JF Bastien1d20a5e2015-10-16 00:53:49 +000024; CHECK-NEXT: .local i32{{$}}
25; CHECK-NEXT: get_local 0{{$}}
26; CHECK-NEXT: set_local 2, pop{{$}}
27; CHECK-NEXT: return (get_local 2){{$}}
JF Bastiend7fcc6f2015-07-31 18:13:27 +000028define i32 @unused_second(i32 %x, i32 %y) {
29 ret i32 %x
30}