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 datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
6 target triple = "wasm32-unknown-unknown"
10 ; CHECK: end_function{{$}}
17 ; CHECK-NEXT: .functype f1 () -> (i32){{$}}
18 ; CHECK-NEXT: i32.const $push[[NUM:[0-9]+]]=, 0{{$}}
19 ; CHECK-NEXT: return $pop[[NUM]]{{$}}
26 ; CHECK-NEXT: .functype f2 (i32, f32) -> (i32){{$}}
27 ; CHECK-NEXT: i32.const $push[[NUM:[0-9]+]]=, 0{{$}}
28 ; CHECK-NEXT: return $pop[[NUM]]{{$}}
30 define i32 @f2(i32 %p1, float %p2) {
35 ; CHECK-NEXT: .functype f3 (i32, f32) -> (){{$}}
37 ; CHECK-NEXT: return{{$}}
39 define void @f3(i32 %p1, float %p2) {
44 ; CHECK-NEXT: .functype f4 (i32) -> (i32){{$}}
47 define i32 @f4(i32 %x) {
49 %c = trunc i32 %x to i1
50 br i1 %c, label %true, label %false
58 ; CHECK-NEXT: .functype f5 () -> (f32){{$}}
59 ; CHECK-NEXT: unreachable