1 ; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -wasm-keep-registers | FileCheck %s
2 ; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -wasm-keep-registers -fast-isel -fast-isel-abort=1 | FileCheck %s
4 ; Test that basic loads are assembled properly.
6 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
7 target triple = "wasm32-unknown-unknown"
10 ; CHECK-NEXT: .functype ldi32 (i32) -> (i32){{$}}
11 ; CHECK-NEXT: local.get $push[[L0:[0-9]+]]=, 0{{$}}
12 ; CHECK-NEXT: i32.load $push[[NUM:[0-9]+]]=, 0($pop[[L0]]){{$}}
13 ; CHECK-NEXT: return $pop[[NUM]]{{$}}
14 define i32 @ldi32(i32 *%p) {
15 %v = load i32, i32* %p
20 ; CHECK-NEXT: .functype ldi64 (i32) -> (i64){{$}}
21 ; CHECK-NEXT: local.get $push[[L0:[0-9]+]]=, 0{{$}}
22 ; CHECK-NEXT: i64.load $push[[NUM:[0-9]+]]=, 0($pop[[L0]]){{$}}
23 ; CHECK-NEXT: return $pop[[NUM]]{{$}}
24 define i64 @ldi64(i64 *%p) {
25 %v = load i64, i64* %p
30 ; CHECK-NEXT: .functype ldf32 (i32) -> (f32){{$}}
31 ; CHECK-NEXT: local.get $push[[L0:[0-9]+]]=, 0{{$}}
32 ; CHECK-NEXT: f32.load $push[[NUM:[0-9]+]]=, 0($pop[[L0]]){{$}}
33 ; CHECK-NEXT: return $pop[[NUM]]{{$}}
34 define float @ldf32(float *%p) {
35 %v = load float, float* %p
40 ; CHECK-NEXT: .functype ldf64 (i32) -> (f64){{$}}
41 ; CHECK-NEXT: local.get $push[[L0:[0-9]+]]=, 0{{$}}
42 ; CHECK-NEXT: f64.load $push[[NUM:[0-9]+]]=, 0($pop[[L0]]){{$}}
43 ; CHECK-NEXT: return $pop[[NUM]]{{$}}
44 define double @ldf64(double *%p) {
45 %v = load double, double* %p