1 ; RUN: llc --force-dwarf-frame-section %s -o - | FileCheck %s
2 target datalayout = "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64"
3 target triple = "thumbv8.1m.main-arm-none-eabi"
5 %"struct.std::__va_list" = type { ptr }
7 define hidden i32 @_Z1fiz(i32 %n, ...) local_unnamed_addr #0 {
9 %ap = alloca %"struct.std::__va_list", align 4
10 call void @llvm.va_start(ptr nonnull %ap)
11 %cmp7 = icmp sgt i32 %n, 0
12 br i1 %cmp7, label %for.body.lr.ph, label %for.cond.cleanup
14 for.body.lr.ph: ; preds = %entry
15 %argp.cur.pre = load ptr, ptr %ap, align 4
18 for.cond.cleanup: ; preds = %for.body, %entry
19 %s.0.lcssa = phi i32 [ 0, %entry ], [ %add, %for.body ]
20 call void @llvm.va_end(ptr nonnull %ap)
23 for.body: ; preds = %for.body.lr.ph, %for.body
24 %argp.cur = phi ptr [ %argp.cur.pre, %for.body.lr.ph ], [ %argp.next, %for.body ]
25 %i.09 = phi i32 [ 0, %for.body.lr.ph ], [ %inc, %for.body ]
26 %s.08 = phi i32 [ 0, %for.body.lr.ph ], [ %add, %for.body ]
27 %argp.next = getelementptr inbounds i8, ptr %argp.cur, i32 4
28 store ptr %argp.next, ptr %ap, align 4
29 %0 = load i32, ptr %argp.cur, align 4
30 %add = add nsw i32 %0, %s.08
31 %inc = add nuw nsw i32 %i.09, 1
32 %exitcond.not = icmp eq i32 %inc, %n
33 br i1 %exitcond.not, label %for.cond.cleanup, label %for.body
36 ; CHECK-LABEL: _Z1fiz:
37 ; CHECK: pac r12, lr, sp
38 ; CHECK-NEXT: .pad #12
39 ; CHECK-NEXT: sub sp, #12
40 ; CHECK-NEXT: .cfi_def_cfa_offset 12
41 ; CHECK-NEXT: .save {r7, lr}
42 ; CHECK-NEXT: push {r7, lr}
43 ; CHECK-NEXT: .cfi_def_cfa_offset 20
44 ; CHECK-NEXT: .cfi_offset lr, -16
45 ; CHECK-NEXT: .cfi_offset r7, -20
46 ; CHECK-NEXT: .save {ra_auth_code}
47 ; CHECK-NEXT: str r12, [sp, #-4]!
48 ; CHECK-NEXT: .cfi_def_cfa_offset 24
49 ; CHECK-NEXT: .cfi_offset ra_auth_code, -24
51 ; CHECK-NEXT: sub sp, #4
52 ; CHECK-NEXT: .cfi_def_cfa_offset 28
54 ; CHECK: add.w r[[N:[0-9]*]], sp, #16
55 ; CHECK: stm.w r[[N]], {r1, r2, r3}
58 ; CHECK-NEXT: ldr r12, [sp], #4
59 ; CHECK-NEXT: pop.w {r7, lr}
60 ; CHECK-NEXT: add sp, #12
61 ; CHECK-NEXT: aut r12, lr, sp
64 declare void @llvm.va_start(ptr) #1
65 declare void @llvm.va_end(ptr) #1
67 attributes #0 = { nounwind optsize "sign-return-address"="non-leaf" }
68 attributes #1 = { nounwind "sign-return-address"="non-leaf" }
70 !llvm.module.flags = !{!0, !1, !2}
72 !0 = !{i32 8, !"branch-target-enforcement", i32 0}
73 !1 = !{i32 8, !"sign-return-address", i32 1}
74 !2 = !{i32 8, !"sign-return-address-all", i32 0}