1 ; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -wasm-disable-explicit-locals -wasm-keep-registers | FileCheck %s
3 ; Test that basic functions assemble as expected.
5 target triple = "wasm32-unknown-unknown"
9 ; CHECK: end_function{{$}}
15 ; CHECK-NEXT: .functype f1 () -> (i32){{$}}
16 ; CHECK-NEXT: i32.const $push[[NUM:[0-9]+]]=, 0{{$}}
17 ; CHECK-NEXT: return $pop[[NUM]]{{$}}
18 ; CHECK: end_function{{$}}
24 ; CHECK-NEXT: .functype f2 (i32, f32) -> (i32){{$}}
25 ; CHECK-NEXT: i32.const $push[[NUM:[0-9]+]]=, 0{{$}}
26 ; CHECK-NEXT: return $pop[[NUM]]{{$}}
27 ; CHECK: end_function{{$}}
28 define i32 @f2(i32 %p1, float %p2) {
33 ; CHECK-NEXT: .functype f3 (i32, f32) -> (){{$}}
35 ; CHECK-NEXT: return{{$}}
36 ; CHECK: end_function{{$}}
37 define void @f3(i32 %p1, float %p2) {
42 ; CHECK-NEXT: .functype f4 (i32) -> (i32){{$}}
44 ; CHECK: end_function{{$}}
45 define i32 @f4(i32 %x) {
47 %c = trunc i32 %x to i1
48 br i1 %c, label %true, label %false
56 ; CHECK-NEXT: .functype f5 () -> (f32){{$}}
57 ; CHECK-NEXT: unreachable