1 ; RUN: llc < %s -mtriple=arm64-apple-ios7.0 | FileCheck %s
2 ; RUN: llc -global-isel < %s -mtriple=arm64-apple-ios7.0 | FileCheck %s
4 @t = weak global i32 ()* null
5 @x = external global i32, align 4
9 ; CHECK: adrp x[[GOTADDR:[0-9]+]], _t@GOTPAGE
10 ; CHECK: ldr x[[ADDR:[0-9]+]], [x[[GOTADDR]], _t@GOTPAGEOFF]
11 ; CHECK: ldr x[[DEST:[0-9]+]], [x[[ADDR]]]
13 %tmp = load i32 ()*, i32 ()** @t
14 %tmp.upgrd.2 = tail call i32 %tmp()
25 define double @t4(double %a) nounwind readonly ssp {
28 %tmp = tail call double @sin(double %a) nounwind readonly
32 define float @t5(float %a) nounwind readonly ssp {
35 %tmp = tail call float @sinf(float %a) nounwind readonly
39 define void @t7() nounwind {
44 br i1 undef, label %bb, label %bb1.lr.ph
46 bb1.lr.ph: ; preds = %entry
47 tail call void @bar() nounwind
51 tail call void @foo() nounwind
55 define i32 @t8(i32 %x) nounwind ssp {
61 %tobool = icmp eq i32 %and, 0
62 br i1 %tobool, label %if.end, label %if.then
64 if.then: ; preds = %entry
65 %call = tail call i32 @a(i32 %x) nounwind
68 if.end: ; preds = %entry
70 %tobool2 = icmp eq i32 %and1, 0
71 br i1 %tobool2, label %if.end5, label %if.then3
73 if.then3: ; preds = %if.end
74 %call4 = tail call i32 @b(i32 %x) nounwind
77 if.end5: ; preds = %if.end
78 %call6 = tail call i32 @c(i32 %x) nounwind
81 return: ; preds = %if.end5, %if.then3, %if.then
82 %retval.0 = phi i32 [ %call, %if.then ], [ %call4, %if.then3 ], [ %call6, %if.end5 ]
86 declare float @sinf(float) nounwind readonly
87 declare double @sin(double) nounwind readonly
88 declare void @bar() nounwind
89 declare void @foo() nounwind
94 ; CHECK-LABEL: tswift:
96 define swiftcc i32 @tswift(i32 %a) nounwind {
97 %res = tail call i32 @swiftfunc(i32 %a)
101 declare swiftcc i32 @swiftfunc(i32) nounwind