1 ; RUN: llc -march=hexagon < %s | FileCheck %s
2 ; Honor the alignment of a halfword on byte boundaries.
5 target triple = "hexagon-unknown-linux-gnu"
7 %s.0 = type <{ i16, i8, i16 }>
9 @g0 = common global %s.0 zeroinitializer, align 1
11 ; Function Attrs: nounwind
12 define i32 @f0(i32 %a0) #0 {
14 %v0 = alloca i32, align 4
15 store i32 %a0, ptr %v0, align 4
16 store i8 1, ptr getelementptr inbounds (%s.0, ptr @g0, i32 0, i32 1), align 1
17 %v1 = load i16, ptr getelementptr inbounds (%s.0, ptr @g0, i32 0, i32 2), align 1
19 store i16 %v2, ptr getelementptr inbounds (%s.0, ptr @g0, i32 0, i32 2), align 1
20 %v3 = load i32, ptr %v0, align 4
21 %v4 = icmp ne i32 %v3, 0
22 br i1 %v4, label %b1, label %b2
25 %v5 = load i16, ptr getelementptr inbounds (%s.0, ptr @g0, i32 0, i32 2), align 1
26 %v6 = zext i16 %v5 to i32
27 %v7 = or i32 %v6, 6144
28 %v8 = trunc i32 %v7 to i16
29 store i16 %v8, ptr getelementptr inbounds (%s.0, ptr @g0, i32 0, i32 2), align 1
33 %v9 = load i16, ptr getelementptr inbounds (%s.0, ptr @g0, i32 0, i32 2), align 1
34 %v10 = zext i16 %v9 to i32
35 %v11 = or i32 %v10, 2048
36 %v12 = trunc i32 %v11 to i16
37 store i16 %v12, ptr getelementptr inbounds (%s.0, ptr @g0, i32 0, i32 2), align 1
40 b3: ; preds = %b2, %b1
44 attributes #0 = { nounwind }