blob: 7b4eef5e4b904cbf13e370d6357a32eb5734f801 [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{{$}}
Dan Gohman9dd55a82015-11-12 06:10:03 +000013; CHECK-NEXT: return (get_local 1){{$}}
JF Bastiend7fcc6f2015-07-31 18:13:27 +000014define i32 @unused_first(i32 %x, i32 %y) {
15 ret i32 %y
16}
17
Dan Gohmane51c0582015-10-06 00:27:55 +000018; CHECK-LABEL: unused_second:
19; CHECK-NEXT: .param i32{{$}}
20; CHECK-NEXT: .param i32{{$}}
21; CHECK-NEXT: .result i32{{$}}
JF Bastien1d20a5e2015-10-16 00:53:49 +000022; CHECK-NEXT: .local i32{{$}}
Dan Gohman9dd55a82015-11-12 06:10:03 +000023; CHECK-NEXT: return (get_local 0){{$}}
JF Bastiend7fcc6f2015-07-31 18:13:27 +000024define i32 @unused_second(i32 %x, i32 %y) {
25 ret i32 %x
26}