1; RUN: llc -mtriple=arm-eabi %s -o - | FileCheck %s
2
3	%struct.A = type { i8, i8, i8, i8, i16, i8, i8, %struct.B** }
4	%struct.B = type { float, float, i32, i32, i32, [0 x i8] }
5
6define i8 @f1(%struct.A* %d) {
7	%tmp2 = getelementptr %struct.A, %struct.A* %d, i32 0, i32 4
8	%tmp23 = bitcast i16* %tmp2 to i32*
9	%tmp4 = load i32, i32* %tmp23
10	%tmp512 = lshr i32 %tmp4, 24
11	%tmp56 = trunc i32 %tmp512 to i8
12	ret i8 %tmp56
13}
14
15define i32 @f2(%struct.A* %d) {
16	%tmp2 = getelementptr %struct.A, %struct.A* %d, i32 0, i32 4
17	%tmp23 = bitcast i16* %tmp2 to i32*
18	%tmp4 = load i32, i32* %tmp23
19	%tmp512 = lshr i32 %tmp4, 24
20	%tmp56 = trunc i32 %tmp512 to i8
21        %tmp57 = sext i8 %tmp56 to i32
22	ret i32 %tmp57
23}
24
25; CHECK: ldrb{{.*}}7
26; CHECK-NOT: ldrb{{.*}}7
27
28; CHECK: ldrsb{{.*}}7
29; CHECK-NOT: ldrsb{{.*}}7
30
31