2015-08-01 02:13:27 +08:00
|
|
|
; RUN: llc < %s -asm-verbose=false | FileCheck %s
|
|
|
|
|
|
|
|
; Make sure that argument offsets are correct even if some arguments are unused.
|
|
|
|
|
2015-08-20 04:30:20 +08:00
|
|
|
target datalayout = "e-p:32:32-i64:64-n32:64-S128"
|
2015-08-01 02:13:27 +08:00
|
|
|
target triple = "wasm32-unknown-unknown"
|
|
|
|
|
2015-10-06 08:27:55 +08:00
|
|
|
; CHECK-LABEL: unused_first:
|
|
|
|
; CHECK-NEXT: .param i32{{$}}
|
|
|
|
; CHECK-NEXT: .param i32{{$}}
|
|
|
|
; CHECK-NEXT: .result i32{{$}}
|
2015-10-16 08:53:49 +08:00
|
|
|
; CHECK-NEXT: .local i32{{$}}
|
2015-11-13 01:04:33 +08:00
|
|
|
; CHECK-NEXT: return (get_local 1){{$}}
|
2015-08-01 02:13:27 +08:00
|
|
|
define i32 @unused_first(i32 %x, i32 %y) {
|
|
|
|
ret i32 %y
|
|
|
|
}
|
|
|
|
|
2015-10-06 08:27:55 +08:00
|
|
|
; CHECK-LABEL: unused_second:
|
|
|
|
; CHECK-NEXT: .param i32{{$}}
|
|
|
|
; CHECK-NEXT: .param i32{{$}}
|
|
|
|
; CHECK-NEXT: .result i32{{$}}
|
2015-10-16 08:53:49 +08:00
|
|
|
; CHECK-NEXT: .local i32{{$}}
|
2015-11-13 01:04:33 +08:00
|
|
|
; CHECK-NEXT: return (get_local 0){{$}}
|
2015-08-01 02:13:27 +08:00
|
|
|
define i32 @unused_second(i32 %x, i32 %y) {
|
|
|
|
ret i32 %x
|
|
|
|
}
|
2015-11-13 08:21:05 +08:00
|
|
|
|
|
|
|
; CHECK-LABEL: call_something:
|
|
|
|
; CHECK-NEXT: call return_something, $discard{{$}}
|
|
|
|
; CHECK-NEXT: return{{$}}
|
|
|
|
declare i32 @return_something()
|
|
|
|
define void @call_something() {
|
2015-11-15 07:17:07 +08:00
|
|
|
call i32 @return_something()
|
|
|
|
ret void
|
2015-11-13 08:21:05 +08:00
|
|
|
}
|