1 ;; Ensure __llvm_gcov_(writeout|reset|init) have !kcfi_type with KCFI.
2 ; RUN: mkdir -p %t && cd %t
3 ; RUN: opt < %s -S -passes=insert-gcov-profiling \
4 ; RUN: -mtriple=x86_64-unknown-linux-gnu | FileCheck \
5 ; RUN: --check-prefixes=CHECK,CHECK-CTOR-INIT %s
6 ; RUN: opt < %s -S -passes=insert-gcov-profiling \
7 ; RUN: -mtriple=powerpc64-ibm-aix | FileCheck \
8 ; RUN: --check-prefixes=CHECK,CHECK-RT-INIT %s
10 ; Check for gcov initialization function pointers when we initialize
11 ; the writeout and reset functions in the runtime.
12 ; CHECK-RT-INIT: @__llvm_covinit_functions = private constant { ptr, ptr } { ptr @__llvm_gcov_writeout, ptr @__llvm_gcov_reset }, section "__llvm_covinit"
14 define dso_local void @empty() !dbg !5 {
20 !llvm.module.flags = !{!3, !4, !9}
22 !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, emissionKind: FullDebug, enums: !2)
23 !1 = !DIFile(filename: "a.c", directory: "")
25 !3 = !{i32 7, !"Dwarf Version", i32 5}
26 !4 = !{i32 2, !"Debug Info Version", i32 3}
27 !5 = distinct !DISubprogram(name: "empty", scope: !1, file: !1, line: 1, type: !6, scopeLine: 1, flags: DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !2)
28 !6 = !DISubroutineType(types: !7)
30 !8 = !DILocation(line: 2, column: 1, scope: !5)
31 !9 = !{i32 4, !"kcfi", i32 1}
33 ; CHECK: define internal void @__llvm_gcov_writeout()
34 ; CHECK-SAME: !kcfi_type ![[#TYPE:]]
35 ; CHECK: define internal void @__llvm_gcov_reset()
36 ; CHECK-SAME: !kcfi_type ![[#TYPE]]
37 ; CHECK-CTOR-INIT: define internal void @__llvm_gcov_init()
38 ; CHECK-CTOR-INIT-SAME: !kcfi_type ![[#TYPE]]
40 ; CHECK: ![[#TYPE]] = !{i32 -1522505972}