2018-08-27 23:45:51 +08:00
|
|
|
; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -wasm-keep-registers | FileCheck %s
|
|
|
|
; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -wasm-keep-registers -fast-isel -fast-isel-abort=1 | FileCheck %s
|
2015-09-01 06:24:11 +08:00
|
|
|
|
|
|
|
; Test that basic loads are assembled properly.
|
|
|
|
|
2016-01-07 11:19:23 +08:00
|
|
|
target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
|
2018-05-11 01:49:11 +08:00
|
|
|
target triple = "wasm32-unknown-unknown"
|
2015-09-01 06:24:11 +08:00
|
|
|
|
2015-10-06 08:27:55 +08:00
|
|
|
; CHECK-LABEL: ldi32:
|
2018-11-20 01:10:36 +08:00
|
|
|
; CHECK-NEXT: .functype ldi32 (i32) -> (i32){{$}}
|
2017-02-25 07:18:00 +08:00
|
|
|
; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}}
|
|
|
|
; CHECK-NEXT: i32.load $push[[NUM:[0-9]+]]=, 0($pop[[L0]]){{$}}
|
2015-11-26 00:55:01 +08:00
|
|
|
; CHECK-NEXT: return $pop[[NUM]]{{$}}
|
2015-09-01 06:24:11 +08:00
|
|
|
define i32 @ldi32(i32 *%p) {
|
|
|
|
%v = load i32, i32* %p
|
|
|
|
ret i32 %v
|
|
|
|
}
|
|
|
|
|
2015-10-06 08:27:55 +08:00
|
|
|
; CHECK-LABEL: ldi64:
|
2018-11-20 01:10:36 +08:00
|
|
|
; CHECK-NEXT: .functype ldi64 (i32) -> (i64){{$}}
|
2017-02-25 07:18:00 +08:00
|
|
|
; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}}
|
|
|
|
; CHECK-NEXT: i64.load $push[[NUM:[0-9]+]]=, 0($pop[[L0]]){{$}}
|
2015-11-26 00:55:01 +08:00
|
|
|
; CHECK-NEXT: return $pop[[NUM]]{{$}}
|
2015-09-01 06:24:11 +08:00
|
|
|
define i64 @ldi64(i64 *%p) {
|
|
|
|
%v = load i64, i64* %p
|
|
|
|
ret i64 %v
|
|
|
|
}
|
|
|
|
|
2015-10-06 08:27:55 +08:00
|
|
|
; CHECK-LABEL: ldf32:
|
2018-11-20 01:10:36 +08:00
|
|
|
; CHECK-NEXT: .functype ldf32 (i32) -> (f32){{$}}
|
2017-02-25 07:18:00 +08:00
|
|
|
; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}}
|
|
|
|
; CHECK-NEXT: f32.load $push[[NUM:[0-9]+]]=, 0($pop[[L0]]){{$}}
|
2015-11-26 00:55:01 +08:00
|
|
|
; CHECK-NEXT: return $pop[[NUM]]{{$}}
|
2015-09-01 06:24:11 +08:00
|
|
|
define float @ldf32(float *%p) {
|
|
|
|
%v = load float, float* %p
|
|
|
|
ret float %v
|
|
|
|
}
|
|
|
|
|
2015-10-06 08:27:55 +08:00
|
|
|
; CHECK-LABEL: ldf64:
|
2018-11-20 01:10:36 +08:00
|
|
|
; CHECK-NEXT: .functype ldf64 (i32) -> (f64){{$}}
|
2017-02-25 07:18:00 +08:00
|
|
|
; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}}
|
|
|
|
; CHECK-NEXT: f64.load $push[[NUM:[0-9]+]]=, 0($pop[[L0]]){{$}}
|
2015-11-26 00:55:01 +08:00
|
|
|
; CHECK-NEXT: return $pop[[NUM]]{{$}}
|
2015-09-01 06:24:11 +08:00
|
|
|
define double @ldf64(double *%p) {
|
|
|
|
%v = load double, double* %p
|
|
|
|
ret double %v
|
|
|
|
}
|