xref: /aosp_15_r20/external/llvm/test/CodeGen/ARM/str_trunc.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc -mtriple=arm-eabi %s -o - | FileCheck %s
2*9880d681SAndroid Build Coastguard Worker
3*9880d681SAndroid Build Coastguard Workerdefine void @test1(i32 %v, i16* %ptr) {
4*9880d681SAndroid Build Coastguard Worker        %tmp = trunc i32 %v to i16              ; <i16> [#uses=1]
5*9880d681SAndroid Build Coastguard Worker        store i16 %tmp, i16* %ptr
6*9880d681SAndroid Build Coastguard Worker        ret void
7*9880d681SAndroid Build Coastguard Worker}
8*9880d681SAndroid Build Coastguard Worker
9*9880d681SAndroid Build Coastguard Workerdefine void @test2(i32 %v, i8* %ptr) {
10*9880d681SAndroid Build Coastguard Worker        %tmp = trunc i32 %v to i8               ; <i8> [#uses=1]
11*9880d681SAndroid Build Coastguard Worker        store i8 %tmp, i8* %ptr
12*9880d681SAndroid Build Coastguard Worker        ret void
13*9880d681SAndroid Build Coastguard Worker}
14*9880d681SAndroid Build Coastguard Worker
15*9880d681SAndroid Build Coastguard Worker; CHECK: strh
16*9880d681SAndroid Build Coastguard Worker; CHECK-NOT: strh
17*9880d681SAndroid Build Coastguard Worker
18*9880d681SAndroid Build Coastguard Worker; CHECK: strb
19*9880d681SAndroid Build Coastguard Worker; CHECK-NOT: strb
20*9880d681SAndroid Build Coastguard Worker
21