1; RUN: llc < %s -march=xcore | FileCheck %s
2
3; Byte aligned load.
4; CHECK: align1
5; CHECK: bl __misaligned_load
6define i32 @align1(i32* %p) nounwind {
7entry:
8	%0 = load i32, i32* %p, align 1		; <i32> [#uses=1]
9	ret i32 %0
10}
11
12; Half word aligned load.
13; CHECK-LABEL: align2:
14; CHECK: ld16s
15; CHECK: ld16s
16; CHECK: or
17define i32 @align2(i32* %p) nounwind {
18entry:
19	%0 = load i32, i32* %p, align 2		; <i32> [#uses=1]
20	ret i32 %0
21}
22
23@a = global [5 x i8] zeroinitializer, align 4
24
25; Constant offset from word aligned base.
26; CHECK-LABEL: align3:
27; CHECK: ldw {{r[0-9]+}}, dp
28; CHECK: ldw {{r[0-9]+}}, dp
29; CHECK: or
30define i32 @align3() nounwind {
31entry:
32	%0 = load i32, i32* bitcast (i8* getelementptr ([5 x i8], [5 x i8]* @a, i32 0, i32 1) to i32*), align 1
33	ret i32 %0
34}
35