• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; 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
3
4; Test that basic loads are assembled properly.
5
6target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
7target triple = "wasm32-unknown-unknown"
8
9; CHECK-LABEL: ldi32:
10; CHECK-NEXT: .param i32{{$}}
11; CHECK-NEXT: .result i32{{$}}
12; CHECK-NEXT: i32.load $push[[NUM:[0-9]+]]=, 0($0){{$}}
13; CHECK-NEXT: return $pop[[NUM]]{{$}}
14define i32 @ldi32(i32 *%p) {
15  %v = load i32, i32* %p
16  ret i32 %v
17}
18
19; CHECK-LABEL: ldi64:
20; CHECK-NEXT: .param i32{{$}}
21; CHECK-NEXT: .result i64{{$}}
22; CHECK-NEXT: i64.load $push[[NUM:[0-9]+]]=, 0($0){{$}}
23; CHECK-NEXT: return $pop[[NUM]]{{$}}
24define i64 @ldi64(i64 *%p) {
25  %v = load i64, i64* %p
26  ret i64 %v
27}
28
29; CHECK-LABEL: ldf32:
30; CHECK-NEXT: .param i32{{$}}
31; CHECK-NEXT: .result f32{{$}}
32; CHECK-NEXT: f32.load $push[[NUM:[0-9]+]]=, 0($0){{$}}
33; CHECK-NEXT: return $pop[[NUM]]{{$}}
34define float @ldf32(float *%p) {
35  %v = load float, float* %p
36  ret float %v
37}
38
39; CHECK-LABEL: ldf64:
40; CHECK-NEXT: .param i32{{$}}
41; CHECK-NEXT: .result f64{{$}}
42; CHECK-NEXT: f64.load $push[[NUM:[0-9]+]]=, 0($0){{$}}
43; CHECK-NEXT: return $pop[[NUM]]{{$}}
44define double @ldf64(double *%p) {
45  %v = load double, double* %p
46  ret double %v
47}
48