blob: b96f447a39743df7a5fb56c8081feded53fe3463 [file] [log] [blame]
Evan Chengcfe07982007-03-21 20:14:56 +00001; RUN: llvm-as < %s | llc -march=arm &&
Evan Cheng60864a82007-03-22 01:55:16 +00002; RUN: llvm-as < %s | llc -march=arm | grep "ldrb.*7" | wc -l | grep 1
3; RUN: llvm-as < %s | llc -march=arm | grep "ldrsb.*7" | wc -l | grep 1
Evan Chengcfe07982007-03-21 20:14:56 +00004
5 %struct.A = type { i8, i8, i8, i8, i16, i8, i8, %struct.B** }
6 %struct.B = type { float, float, i32, i32, i32, [0 x i8] }
7
Evan Cheng60864a82007-03-22 01:55:16 +00008define i8 @f1(%struct.A* %d) {
Evan Chengcfe07982007-03-21 20:14:56 +00009 %tmp2 = getelementptr %struct.A* %d, i32 0, i32 4
10 %tmp23 = bitcast i16* %tmp2 to i32*
11 %tmp4 = load i32* %tmp23
12 %tmp512 = lshr i32 %tmp4, 24
13 %tmp56 = trunc i32 %tmp512 to i8
Evan Cheng60864a82007-03-22 01:55:16 +000014 ret i8 %tmp56
Evan Chengcfe07982007-03-21 20:14:56 +000015}
16
Evan Cheng60864a82007-03-22 01:55:16 +000017define i32 @f2(%struct.A* %d) {
18 %tmp2 = getelementptr %struct.A* %d, i32 0, i32 4
19 %tmp23 = bitcast i16* %tmp2 to i32*
20 %tmp4 = load i32* %tmp23
21 %tmp512 = lshr i32 %tmp4, 24
22 %tmp56 = trunc i32 %tmp512 to i8
23 %tmp57 = sext i8 %tmp56 to i32
24 ret i32 %tmp57
25}