brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.6 KiB · 7342ac1 Raw
102 lines · plain
1; RUN: llc < %s -mtriple=arm64-apple-ios7.0 | FileCheck %s2; RUN: llc -global-isel < %s -mtriple=arm64-apple-ios7.0 | FileCheck %s3 4@t = weak global ptr null5@x = external global i32, align 46 7define void @t2() {8; CHECK-LABEL: t2:9; CHECK: adrp	x[[GOTADDR:[0-9]+]], _t@GOTPAGE10; CHECK: ldr	x[[ADDR:[0-9]+]], [x[[GOTADDR]], _t@GOTPAGEOFF]11; CHECK: ldr	x[[DEST:[0-9]+]], [x[[ADDR]]]12; CHECK: br	x[[DEST]]13  %tmp = load ptr, ptr @t14  %tmp.upgrd.2 = tail call i32 %tmp()15  ret void16}17 18define void @t3() {19; CHECK-LABEL: t3:20; CHECK: b	_t221  tail call void @t2()22  ret void23}24 25define double @t4(double %a) nounwind readonly ssp {26; CHECK-LABEL: t4:27; CHECK: b	_sin28  %tmp = tail call double @sin(double %a) nounwind readonly29  ret double %tmp30}31 32define float @t5(float %a) nounwind readonly ssp {33; CHECK-LABEL: t5:34; CHECK: b	_sinf35  %tmp = tail call float @sinf(float %a) nounwind readonly36  ret float %tmp37}38 39define void @t7(i1 %arg) nounwind {40; CHECK-LABEL: t7:41; CHECK: b	_foo42; CHECK: b	_bar43 44  br i1 %arg, label %bb, label %bb1.lr.ph45 46bb1.lr.ph:                                        ; preds = %entry47  tail call void @bar() nounwind48  ret void49 50bb:                                               ; preds = %entry51  tail call void @foo() nounwind52  ret void53}54 55define i32 @t8(i32 %x) nounwind ssp {56; CHECK-LABEL: t8:57; CHECK: b	_c58; CHECK: b	_a59; CHECK: b	_b60  %and = and i32 %x, 161  %tobool = icmp eq i32 %and, 062  br i1 %tobool, label %if.end, label %if.then63 64if.then:                                          ; preds = %entry65  %call = tail call i32 @a(i32 %x) nounwind66  br label %return67 68if.end:                                           ; preds = %entry69  %and1 = and i32 %x, 270  %tobool2 = icmp eq i32 %and1, 071  br i1 %tobool2, label %if.end5, label %if.then372 73if.then3:                                         ; preds = %if.end74  %call4 = tail call i32 @b(i32 %x) nounwind75  br label %return76 77if.end5:                                          ; preds = %if.end78  %call6 = tail call i32 @c(i32 %x) nounwind79  br label %return80 81return:                                           ; preds = %if.end5, %if.then3, %if.then82  %retval.0 = phi i32 [ %call, %if.then ], [ %call4, %if.then3 ], [ %call6, %if.end5 ]83  ret i32 %retval.084}85 86declare float @sinf(float) nounwind readonly87declare double @sin(double) nounwind readonly88declare void @bar() nounwind89declare void @foo() nounwind90declare i32 @a(i32)91declare i32 @b(i32)92declare i32 @c(i32)93 94; CHECK-LABEL: tswift:95; CHECK: b _swiftfunc96define swiftcc i32 @tswift(i32 %a) nounwind {97  %res = tail call i32 @swiftfunc(i32 %a)98  ret i32 %res99}100 101declare swiftcc i32 @swiftfunc(i32) nounwind102