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 = "thumbv7m-arm-none-eabi"
6 ; volatile int a, b, c, d, e, f;
9 ; int r = a + b + c + d + e + f;
14 ; int r = a + b + c + d + e + f;
18 @a = hidden global i32 0, align 4
19 @b = hidden global i32 0, align 4
20 @c = hidden global i32 0, align 4
21 @d = hidden global i32 0, align 4
22 @e = hidden global i32 0, align 4
23 @f = hidden global i32 0, align 4
25 define hidden i32 @x() local_unnamed_addr #0 {
27 %0 = load volatile i32, ptr @a, align 4
28 %1 = load volatile i32, ptr @b, align 4
29 %2 = load volatile i32, ptr @c, align 4
30 %3 = load volatile i32, ptr @d, align 4
31 %4 = load volatile i32, ptr @e, align 4
32 %5 = load volatile i32, ptr @f, align 4
34 %add1 = add i32 %add, %1
35 %add2 = add i32 %add1, %2
36 %add3 = add i32 %add2, %3
37 %add4 = add i32 %add3, %4
38 %add5 = add i32 %add4, %5
42 ; CHECK: ldr r{{.*}}, .LCPI0_0
43 ; CHECK-NEXT: mov r[[A:[0-9]*]], lr
44 ; CHECK-NEXT: .cfi_register lr, r[[A]]
45 ; CHECK-NEXT: bl OUTLINED_FUNCTION_0
46 ; CHECK-NEXT: mov lr, r[[A]]
47 ; CHECK-NEXT: .cfi_restore lr
48 ; CHECK-NEXT: adds r0, #1
51 define hidden i32 @y() local_unnamed_addr #0 {
53 %0 = load volatile i32, ptr @a, align 4
54 %1 = load volatile i32, ptr @b, align 4
55 %2 = load volatile i32, ptr @c, align 4
56 %3 = load volatile i32, ptr @d, align 4
57 %4 = load volatile i32, ptr @e, align 4
58 %5 = load volatile i32, ptr @f, align 4
60 %add1 = add i32 %add, %1
61 %add2 = add i32 %add1, %2
62 %add3 = add i32 %add2, %3
63 %add4 = add i32 %add3, %4
64 %add5 = add i32 %add4, %5
68 ; CHECK: ldr r{{.*}}, .LCPI1_0
69 ; CHECK-NEXT: mov r[[B:[0-9]*]], lr
70 ; CHECK-NEXT: .cfi_register lr, r[[B]]
71 ; CHECK-NEXT: bl OUTLINED_FUNCTION_0
72 ; CHECK-NEXT: mov lr, r[[B]]
73 ; CHECK-NEXT: .cfi_restore lr
74 ; CHECK-NEXT: adds r0, #2
77 ; CHECK-LABEL: OUTLINED_FUNCTION_0:
83 attributes #0 = { minsize nofree norecurse nounwind optsize}
85 !llvm.module.flags = !{!0, !1, !2}
87 !0 = !{i32 8, !"branch-target-enforcement", i32 0}
88 !1 = !{i32 8, !"sign-return-address", i32 1}
89 !2 = !{i32 8, !"sign-return-address-all", i32 0}