WebAssembly: handle unused function arguments.

Subscribers: llvm-commits, sunfish, jfb

Differential Revision: http://reviews.llvm.org/D11684

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243770 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
JF Bastien
2015-07-31 18:13:27 +00:00
parent 4c43d5bdfa
commit 6877df25a0
2 changed files with 26 additions and 4 deletions

View File

@@ -0,0 +1,20 @@
; 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-v128:8:128-n32:64-S128"
target triple = "wasm32-unknown-unknown"
; CHECK-LABEL: unused_first:
; CHECK-NEXT: (setlocal @0 (argument 1))
; CHECK-NEXT: (RETURN @0)
define i32 @unused_first(i32 %x, i32 %y) {
ret i32 %y
}
; CHECK-LABEL: unused_second:
; CHECK-NEXT: (setlocal @0 (argument 0))
; CHECK-NEXT: (RETURN @0)
define i32 @unused_second(i32 %x, i32 %y) {
ret i32 %x
}