blob: 153d7d9addf75af480f8dee7cf26821f15cca1ad [file] [log] [blame]
Dan Gohmanb7c24002016-05-21 00:21:56 +00001; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt | FileCheck %s
2; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -fast-isel -fast-isel-abort=1 | FileCheck %s
JF Bastien73ff6af2015-08-31 22:24:11 +00003
4; Test that basic stores are assembled properly.
5
Dan Gohman0c6f5ac2016-01-07 03:19:23 +00006target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
Dan Gohmand934cb82017-02-24 23:18:00 +00007target triple = "wasm32-unknown-unknown-wasm"
JF Bastien73ff6af2015-08-31 22:24:11 +00008
Dan Gohmane51c0582015-10-06 00:27:55 +00009; CHECK-LABEL: sti32:
Dan Gohman53828fd2015-11-23 16:50:18 +000010; CHECK-NEXT: .param i32, i32{{$}}
Dan Gohmand934cb82017-02-24 23:18:00 +000011; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}}
12; CHECK-NEXT: get_local $push[[L1:[0-9]+]]=, 1{{$}}
13; CHECK-NEXT: i32.store 0($pop[[L0]]), $pop[[L1]]{{$}}
Dan Gohmane51c0582015-10-06 00:27:55 +000014; CHECK-NEXT: return{{$}}
JF Bastien73ff6af2015-08-31 22:24:11 +000015define void @sti32(i32 *%p, i32 %v) {
16 store i32 %v, i32* %p
17 ret void
18}
19
Dan Gohmane51c0582015-10-06 00:27:55 +000020; CHECK-LABEL: sti64:
Dan Gohman53828fd2015-11-23 16:50:18 +000021; CHECK-NEXT: .param i32, i64{{$}}
Dan Gohmand934cb82017-02-24 23:18:00 +000022; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}}
23; CHECK-NEXT: get_local $push[[L1:[0-9]+]]=, 1{{$}}
24; CHECK-NEXT: i64.store 0($pop[[L0]]), $pop[[L1]]{{$}}
Dan Gohmane51c0582015-10-06 00:27:55 +000025; CHECK-NEXT: return{{$}}
JF Bastien73ff6af2015-08-31 22:24:11 +000026define void @sti64(i64 *%p, i64 %v) {
27 store i64 %v, i64* %p
28 ret void
29}
30
Dan Gohmane51c0582015-10-06 00:27:55 +000031; CHECK-LABEL: stf32:
Dan Gohman53828fd2015-11-23 16:50:18 +000032; CHECK-NEXT: .param i32, f32{{$}}
Dan Gohmand934cb82017-02-24 23:18:00 +000033; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}}
34; CHECK-NEXT: get_local $push[[L1:[0-9]+]]=, 1{{$}}
35; CHECK-NEXT: f32.store 0($pop[[L0]]), $pop[[L1]]{{$}}
Dan Gohmane51c0582015-10-06 00:27:55 +000036; CHECK-NEXT: return{{$}}
JF Bastien73ff6af2015-08-31 22:24:11 +000037define void @stf32(float *%p, float %v) {
38 store float %v, float* %p
39 ret void
40}
41
Dan Gohmane51c0582015-10-06 00:27:55 +000042; CHECK-LABEL: stf64:
Dan Gohman53828fd2015-11-23 16:50:18 +000043; CHECK-NEXT: .param i32, f64{{$}}
Dan Gohmand934cb82017-02-24 23:18:00 +000044; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}}
45; CHECK-NEXT: get_local $push[[L1:[0-9]+]]=, 1{{$}}
46; CHECK-NEXT: f64.store 0($pop[[L0]]), $pop[[L1]]{{$}}
Dan Gohmane51c0582015-10-06 00:27:55 +000047; CHECK-NEXT: return{{$}}
JF Bastien73ff6af2015-08-31 22:24:11 +000048define void @stf64(double *%p, double %v) {
49 store double %v, double* %p
50 ret void
51}