1; RUN: llc < %s -mtriple=arm64-eabi -mcpu=cyclone | FileCheck %s
2; <rdar://problem/11294426>
3
4@b = private unnamed_addr constant [3 x i32] [i32 1768775988, i32 1685481784, i32 1836253201], align 4
5
6; The important thing for this test is that we need an unaligned load of `l_b'
7; ("ldr w2, [x1, #8]" in this case).
8
9; CHECK:      adrp x[[PAGE:[0-9]+]], {{l_b@PAGE|.Lb}}
10; CHECK: add  x[[ADDR:[0-9]+]], x[[PAGE]], {{l_b@PAGEOFF|:lo12:.Lb}}
11; CHECK-NEXT: ldr  [[VAL2:x[0-9]+]], [x[[ADDR]]]
12; CHECK-NEXT: ldr  [[VAL:w[0-9]+]], [x[[ADDR]], #8]
13; CHECK-NEXT: str  [[VAL]], [x0, #8]
14; CHECK-NEXT: str  [[VAL2]], [x0]
15
16define void @foo(i8* %a) {
17  call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 4 %a, i8* align 4 bitcast ([3 x i32]* @b to i8*), i64 12, i1 false)
18  ret void
19}
20
21declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i1) nounwind
22