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