1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 03:53:04 +02:00
llvm-mirror/test/CodeGen/WebAssembly/unused-argument.ll
Dan Gohman 2f67df6acf [WebAssembly] Add type prefixes to call instructions
Add return type information to call and call_indirect instructions. This
allows them to be disambiguated without knowledge of the callee.

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

llvm-svn: 255565
2015-12-14 22:56:51 +00:00

32 lines
821 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-n32:64-S128"
target triple = "wasm32-unknown-unknown"
; CHECK-LABEL: unused_first:
; CHECK-NEXT: .param i32, i32{{$}}
; CHECK-NEXT: .result i32{{$}}
; CHECK-NEXT: return $1{{$}}
define i32 @unused_first(i32 %x, i32 %y) {
ret i32 %y
}
; CHECK-LABEL: unused_second:
; CHECK-NEXT: .param i32, i32{{$}}
; CHECK-NEXT: .result i32{{$}}
; CHECK-NEXT: return $0{{$}}
define i32 @unused_second(i32 %x, i32 %y) {
ret i32 %x
}
; CHECK-LABEL: call_something:
; CHECK-NEXT: {{^}} i32.call $discard=, return_something{{$}}
; CHECK-NEXT: return{{$}}
declare i32 @return_something()
define void @call_something() {
call i32 @return_something()
ret void
}