1;; RUN: llc --mattr=+v8.3a %s -o - | FileCheck %s
2target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
3target triple = "aarch64-unknown-linux"
4
5@__llvm_gcov_ctr = internal global [1 x i64] zeroinitializer
6@0 = private unnamed_addr constant [7 x i8] c"m.gcda\00", align 1
7@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 0, void ()* @__llvm_gcov_init, i8* null }]
8
9define dso_local i32 @f() local_unnamed_addr #0 {
10entry:
11  ret i32 0
12}
13;; CHECK-LABEL: f:
14;; CHECK: pacibsp
15
16declare void @llvm_gcda_start_file(i8*, i32, i32) local_unnamed_addr
17
18declare void @llvm_gcda_emit_function(i32, i32, i32) local_unnamed_addr
19
20declare void @llvm_gcda_emit_arcs(i32, i64*) local_unnamed_addr
21
22declare void @llvm_gcda_summary_info() local_unnamed_addr
23
24declare void @llvm_gcda_end_file() local_unnamed_addr
25
26define internal void @__llvm_gcov_writeout() unnamed_addr #1 {
27entry:
28  tail call void @llvm_gcda_start_file(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @0, i64 0, i64 0), i32 875575338, i32 0)
29  tail call void @llvm_gcda_emit_function(i32 0, i32 0, i32 0)
30  tail call void @llvm_gcda_emit_arcs(i32 1, i64* getelementptr inbounds ([1 x i64], [1 x i64]* @__llvm_gcov_ctr, i64 0, i64 0))
31  tail call void @llvm_gcda_summary_info()
32  tail call void @llvm_gcda_end_file()
33  ret void
34}
35;; CHECK-LABEL: __llvm_gcov_writeout:
36;; CHECK:       .cfi_b_key_frame
37;; CHECK-NEXT:  pacibsp
38;; CHECK-NEXT: .cfi_negate_ra_state
39
40define internal void @__llvm_gcov_reset() unnamed_addr #2 {
41entry:
42  store i64 0, i64* getelementptr inbounds ([1 x i64], [1 x i64]* @__llvm_gcov_ctr, i64 0, i64 0), align 8
43  ret void
44}
45;; CHECK-LABEL: __llvm_gcov_reset:
46;; CHECK:       pacibsp
47
48declare void @llvm_gcov_init(void ()*, void ()*) local_unnamed_addr
49
50define internal void @__llvm_gcov_init() unnamed_addr #1 {
51entry:
52  tail call void @llvm_gcov_init(void ()* nonnull @__llvm_gcov_writeout, void ()* nonnull @__llvm_gcov_reset)
53  ret void
54}
55;; CHECK-LABEL: __llvm_gcov_init:
56;; CHECK:      .cfi_b_key_frame
57;; CHECK-NEXT:  pacibsp
58;; CHECK-NEXT: .cfi_negate_ra_state
59
60attributes #0 = { norecurse nounwind readnone "sign-return-address"="all" "sign-return-address-key"="b_key" }
61attributes #1 = { noinline }
62attributes #2 = { nofree noinline norecurse nounwind writeonly }
63
64!llvm.module.flags = !{!0, !1, !2, !3, !4, !5}
65
66!0 = !{i32 2, !"Debug Info Version", i32 3}
67!1 = !{i32 1, !"wchar_size", i32 4}
68!2 = !{i32 1, !"branch-target-enforcement", i32 0}
69!3 = !{i32 1, !"sign-return-address", i32 1}
70!4 = !{i32 1, !"sign-return-address-all", i32 1}
71!5 = !{i32 1, !"sign-return-address-with-bkey", i32 1}
72