blob: c216c448e11b51675ef0f61975dd653420a20e64 [file] [log] [blame]
Tim Northoverdb2860f42014-04-14 13:18:48 +00001; RUN: llc < %s -mtriple=arm64-apple-ios7.0 | FileCheck %s
Quentin Colombet18b779e2013-12-12 00:15:47 +00002; 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)
David Blaikie79e6c742015-02-27 19:29:02 +000014 %ptr = getelementptr inbounds i8, i8* %tmp3, i64 -16
David Blaikiea79ac142015-02-27 21:17:42 +000015 %ld = load i8, i8* %ptr, align 4
Quentin Colombet18b779e2013-12-12 00:15:47 +000016 %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)