WebAssembly: handle more than int32 argument/return
[oota-llvm.git] / test / CodeGen / WebAssembly / unused-argument.ll
1 ; RUN: llc < %s -asm-verbose=false | FileCheck %s
2
3 ; Make sure that argument offsets are correct even if some arguments are unused.
4
5 target datalayout = "e-p:32:32-i64:64-v128:8:128-n32:64-S128"
6 target triple = "wasm32-unknown-unknown"
7
8 ; CHECK-LABEL: unused_first:
9 ; CHECK-NEXT: (setlocal @0 (argument 1))
10 ; CHECK-NEXT: (return @0)
11 define i32 @unused_first(i32 %x, i32 %y) {
12   ret i32 %y
13 }
14
15 ; CHECK-LABEL: unused_second:
16 ; CHECK-NEXT: (setlocal @0 (argument 0))
17 ; CHECK-NEXT: (return @0)
18 define i32 @unused_second(i32 %x, i32 %y) {
19   ret i32 %x
20 }