• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt | FileCheck %s
2
3; Make sure that argument offsets are correct even if some arguments are unused.
4
5target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
6target triple = "wasm32-unknown-unknown"
7
8; CHECK-LABEL: unused_first:
9; CHECK-NEXT: .param i32, i32{{$}}
10; CHECK-NEXT: .result i32{{$}}
11; CHECK-NEXT: return $1{{$}}
12define i32 @unused_first(i32 %x, i32 %y) {
13  ret i32 %y
14}
15
16; CHECK-LABEL: unused_second:
17; CHECK-NEXT: .param i32, i32{{$}}
18; CHECK-NEXT: .result i32{{$}}
19; CHECK-NEXT: return $0{{$}}
20define i32 @unused_second(i32 %x, i32 %y) {
21  ret i32 %x
22}
23
24; CHECK-LABEL: call_something:
25; CHECK-NEXT: {{^}} i32.call $drop=, return_something@FUNCTION{{$}}
26; CHECK-NEXT: return{{$}}
27declare i32 @return_something()
28define void @call_something() {
29  call i32 @return_something()
30  ret void
31}
32