1; RUN: llc < %s -mtriple=arm64-apple-ios7.0 | FileCheck %s
2; Test case related to <rdar://problem/15633429>.
3
4; CHECK-LABEL: small
5define i64 @small(i64 %encodedBase) {
6cmp:
7  %lnot.i.i = icmp eq i64 %encodedBase, 0
8  br i1 %lnot.i.i, label %if, label %else
9if:
10  %tmp1 = call i8* @llvm.returnaddress(i32 0)
11  br label %end
12else:
13  %tmp3 = call i8* @llvm.returnaddress(i32 0)
14  %ptr = getelementptr inbounds i8, i8* %tmp3, i64 -16
15  %ld = load i8, i8* %ptr, align 4
16  %tmp2 = inttoptr i8 %ld to i8*
17  br label %end
18end:
19  %tmp = phi i8* [ %tmp1, %if ], [ %tmp2, %else ]
20  %coerce.val.pi56 = ptrtoint i8* %tmp to i64
21  ret i64 %coerce.val.pi56
22}
23
24declare i8* @llvm.returnaddress(i32)
25