1 ; RUN: llc < %s -mtriple=arm64-apple-ios7.0 | FileCheck %s
3 @t = weak global i32 ()* null
4 @x = external global i32, align 4
8 ; CHECK: adrp x[[GOTADDR:[0-9]+]], _t@GOTPAGE
9 ; CHECK: ldr x[[ADDR:[0-9]+]], [x[[GOTADDR]], _t@GOTPAGEOFF]
10 ; CHECK: ldr x[[DEST:[0-9]+]], [x[[ADDR]]]
12 %tmp = load i32 ()*, i32 ()** @t
13 %tmp.upgrd.2 = tail call i32 %tmp()
24 define double @t4(double %a) nounwind readonly ssp {
27 %tmp = tail call double @sin(double %a) nounwind readonly
31 define float @t5(float %a) nounwind readonly ssp {
34 %tmp = tail call float @sinf(float %a) nounwind readonly
38 define void @t7() nounwind {
43 br i1 undef, label %bb, label %bb1.lr.ph
45 bb1.lr.ph: ; preds = %entry
46 tail call void @bar() nounwind
50 tail call void @foo() nounwind
54 define i32 @t8(i32 %x) nounwind ssp {
60 %tobool = icmp eq i32 %and, 0
61 br i1 %tobool, label %if.end, label %if.then
63 if.then: ; preds = %entry
64 %call = tail call i32 @a(i32 %x) nounwind
67 if.end: ; preds = %entry
69 %tobool2 = icmp eq i32 %and1, 0
70 br i1 %tobool2, label %if.end5, label %if.then3
72 if.then3: ; preds = %if.end
73 %call4 = tail call i32 @b(i32 %x) nounwind
76 if.end5: ; preds = %if.end
77 %call6 = tail call i32 @c(i32 %x) nounwind
80 return: ; preds = %if.end5, %if.then3, %if.then
81 %retval.0 = phi i32 [ %call, %if.then ], [ %call4, %if.then3 ], [ %call6, %if.end5 ]
85 declare float @sinf(float) nounwind readonly
86 declare double @sin(double) nounwind readonly
87 declare void @bar() nounwind
88 declare void @foo() nounwind
93 ; CHECK-LABEL: tswift:
95 define swiftcc i32 @tswift(i32 %a) nounwind {
96 %res = tail call i32 @swiftfunc(i32 %a)
100 declare swiftcc i32 @swiftfunc(i32) nounwind