1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-22 04:22:57 +02:00
llvm-mirror/test/CodeGen/WebAssembly/store-trunc.ll
JF Bastien 5023394ab8 WebAssembly: fix load/store syntax
Summary: The syntax has changed a bit recently.

Reviewers: binji

Subscribers: llvm-commits, jfb, sunfish, dschuff

Differential Revision: http://reviews.llvm.org/D13821

llvm-svn: 250535
2015-10-16 18:24:42 +00:00

47 lines
1.1 KiB
LLVM

; RUN: llc < %s -asm-verbose=false | FileCheck %s
; Test that truncating stores are assembled properly.
target datalayout = "e-p:32:32-i64:64-n32:64-S128"
target triple = "wasm32-unknown-unknown"
; CHECK-LABEL: trunc_i8_i32:
; CHECK: i32.store8 (get_local 3), (get_local 2){{$}}
define void @trunc_i8_i32(i8 *%p, i32 %v) {
%t = trunc i32 %v to i8
store i8 %t, i8* %p
ret void
}
; CHECK-LABEL: trunc_i16_i32:
; CHECK: i32.store16 (get_local 3), (get_local 2){{$}}
define void @trunc_i16_i32(i16 *%p, i32 %v) {
%t = trunc i32 %v to i16
store i16 %t, i16* %p
ret void
}
; CHECK-LABEL: trunc_i8_i64:
; CHECK: i64.store8 (get_local 3), (get_local 2){{$}}
define void @trunc_i8_i64(i8 *%p, i64 %v) {
%t = trunc i64 %v to i8
store i8 %t, i8* %p
ret void
}
; CHECK-LABEL: trunc_i16_i64:
; CHECK: i64.store16 (get_local 3), (get_local 2){{$}}
define void @trunc_i16_i64(i16 *%p, i64 %v) {
%t = trunc i64 %v to i16
store i16 %t, i16* %p
ret void
}
; CHECK-LABEL: trunc_i32_i64:
; CHECK: i64.store32 (get_local 3), (get_local 2){{$}}
define void @trunc_i32_i64(i32 *%p, i64 %v) {
%t = trunc i64 %v to i32
store i32 %t, i32* %p
ret void
}