blob: 165d145fde1ab67dc27dcfbabd42a32964ae2d3d [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 loads 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: ldi32:
10; CHECK-NEXT: .param i32{{$}}
11; CHECK-NEXT: .result i32{{$}}
Dan Gohmand934cb82017-02-24 23:18:00 +000012; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}}
13; CHECK-NEXT: i32.load $push[[NUM:[0-9]+]]=, 0($pop[[L0]]){{$}}
Dan Gohman81719f82015-11-25 16:55:01 +000014; CHECK-NEXT: return $pop[[NUM]]{{$}}
JF Bastien73ff6af2015-08-31 22:24:11 +000015define i32 @ldi32(i32 *%p) {
16 %v = load i32, i32* %p
17 ret i32 %v
18}
19
Dan Gohmane51c0582015-10-06 00:27:55 +000020; CHECK-LABEL: ldi64:
21; CHECK-NEXT: .param i32{{$}}
22; CHECK-NEXT: .result i64{{$}}
Dan Gohmand934cb82017-02-24 23:18:00 +000023; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}}
24; CHECK-NEXT: i64.load $push[[NUM:[0-9]+]]=, 0($pop[[L0]]){{$}}
Dan Gohman81719f82015-11-25 16:55:01 +000025; CHECK-NEXT: return $pop[[NUM]]{{$}}
JF Bastien73ff6af2015-08-31 22:24:11 +000026define i64 @ldi64(i64 *%p) {
27 %v = load i64, i64* %p
28 ret i64 %v
29}
30
Dan Gohmane51c0582015-10-06 00:27:55 +000031; CHECK-LABEL: ldf32:
32; CHECK-NEXT: .param i32{{$}}
33; CHECK-NEXT: .result f32{{$}}
Dan Gohmand934cb82017-02-24 23:18:00 +000034; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}}
35; CHECK-NEXT: f32.load $push[[NUM:[0-9]+]]=, 0($pop[[L0]]){{$}}
Dan Gohman81719f82015-11-25 16:55:01 +000036; CHECK-NEXT: return $pop[[NUM]]{{$}}
JF Bastien73ff6af2015-08-31 22:24:11 +000037define float @ldf32(float *%p) {
38 %v = load float, float* %p
39 ret float %v
40}
41
Dan Gohmane51c0582015-10-06 00:27:55 +000042; CHECK-LABEL: ldf64:
43; CHECK-NEXT: .param i32{{$}}
44; CHECK-NEXT: .result f64{{$}}
Dan Gohmand934cb82017-02-24 23:18:00 +000045; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}}
46; CHECK-NEXT: f64.load $push[[NUM:[0-9]+]]=, 0($pop[[L0]]){{$}}
Dan Gohman81719f82015-11-25 16:55:01 +000047; CHECK-NEXT: return $pop[[NUM]]{{$}}
JF Bastien73ff6af2015-08-31 22:24:11 +000048define double @ldf64(double *%p) {
49 %v = load double, double* %p
50 ret double %v
51}