1 ; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {ldrh r0} | count 7
2 ; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep mov | grep 1
3 ; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | not grep mvn
4 ; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep ldrh | grep lsl
5 ; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep lsr | not grep ldrh
7 define i16 @f1(i16* %v) {
13 define i16 @f2(i16* %v) {
15 %tmp2 = getelementptr i16* %v, i16 1023
16 %tmp = load i16* %tmp2
20 define i16 @f3(i16* %v) {
22 %tmp2 = getelementptr i16* %v, i16 2048
23 %tmp = load i16* %tmp2
27 define i16 @f4(i32 %base) {
29 %tmp1 = sub i32 %base, 128
30 %tmp2 = inttoptr i32 %tmp1 to i16*
31 %tmp3 = load i16* %tmp2
35 define i16 @f5(i32 %base, i32 %offset) {
37 %tmp1 = add i32 %base, %offset
38 %tmp2 = inttoptr i32 %tmp1 to i16*
39 %tmp3 = load i16* %tmp2
43 define i16 @f6(i32 %base, i32 %offset) {
45 %tmp1 = shl i32 %offset, 2
46 %tmp2 = add i32 %base, %tmp1
47 %tmp3 = inttoptr i32 %tmp2 to i16*
48 %tmp4 = load i16* %tmp3
52 define i16 @f7(i32 %base, i32 %offset) {
54 %tmp1 = lshr i32 %offset, 2
55 %tmp2 = add i32 %base, %tmp1
56 %tmp3 = inttoptr i32 %tmp2 to i16*
57 %tmp4 = load i16* %tmp3