2015-08-25 05:03:24 +08:00
|
|
|
; RUN: llc < %s -asm-verbose=false | FileCheck %s
|
|
|
|
|
|
|
|
; Test that basic memory operations assemble as expected with 32-bit addresses.
|
|
|
|
|
|
|
|
target datalayout = "e-p:32:32-i64:64-n32:64-S128"
|
|
|
|
target triple = "wasm32-unknown-unknown"
|
|
|
|
|
|
|
|
declare i32 @llvm.wasm.page.size.i32() nounwind readnone
|
2015-10-03 03:21:15 +08:00
|
|
|
declare i32 @llvm.wasm.memory.size.i32() nounwind readnone
|
2015-08-25 05:03:24 +08:00
|
|
|
|
2015-08-26 06:58:05 +08:00
|
|
|
; CHECK-LABEL: (func $page_size
|
|
|
|
; CHECK-NEXT: (result i32)
|
2015-08-25 05:03:24 +08:00
|
|
|
; CHECK-NEXT: (setlocal @0 (page_size))
|
|
|
|
; CHECK-NEXT: (return @0)
|
|
|
|
define i32 @page_size() {
|
|
|
|
%a = call i32 @llvm.wasm.page.size.i32()
|
|
|
|
ret i32 %a
|
|
|
|
}
|
2015-10-03 03:21:15 +08:00
|
|
|
|
|
|
|
; CHECK-LABEL: (func $memory_size
|
|
|
|
; CHECK-NEXT: (result i32)
|
|
|
|
; CHECK-NEXT: (setlocal @0 (memory_size))
|
|
|
|
; CHECK-NEXT: (return @0)
|
|
|
|
define i32 @memory_size() {
|
|
|
|
%a = call i32 @llvm.wasm.memory.size.i32()
|
|
|
|
ret i32 %a
|
|
|
|
}
|