summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/WebAssembly/unused-argument.ll
blob: 46bbb9b9ace6a6912a2998099d60849abb6bd6fc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
; RUN: llc < %s -asm-verbose=false | FileCheck %s

; Make sure that argument offsets are correct even if some arguments are unused.

target datalayout = "e-p:32:32-i64:64-n32:64-S128"
target triple = "wasm32-unknown-unknown"

; CHECK-LABEL: (func $unused_first
; CHECK-NEXT: (param i32) (param i32) (result i32)
; CHECK-NEXT: (setlocal @0 (argument 1))
; CHECK-NEXT: (return @0)
define i32 @unused_first(i32 %x, i32 %y) {
  ret i32 %y
}

; CHECK-LABEL: (func $unused_second
; CHECK-NEXT: (param i32) (param i32) (result i32)
; CHECK-NEXT: (setlocal @0 (argument 0))
; CHECK-NEXT: (return @0)
define i32 @unused_second(i32 %x, i32 %y) {
  ret i32 %x
}
OpenPOWER on IntegriCloud