llvm-6502/test/CodeGen/WebAssembly/unused-argument.ll
JF Bastien e428ba798e WebAssembly: handle more than int32 argument/return
Summary: Also test 64-bit integers, except shifts for now which are broken because isel dislikes the 32-bit truncate that precedes them.

Reviewers: sunfish

Subscribers: llvm-commits, jfb

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243822 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-01 04:48:44 +00:00

21 lines
548 B
LLVM

; 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
}