1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: mkdir -p %t && cd %t
3 ; RUN: opt < %s -passes=insert-gcov-profiling -S | FileCheck %s
5 ; Test that the noprofile attribute disables profiling.
6 define dso_local i32 @no_instr(i32 %a) noprofile !dbg !9 {
7 ; CHECK-LABEL: @no_instr(
8 ; CHECK-NEXT: ret i32 42, !dbg [[DBG6:![0-9]+]]
13 define dso_local i32 @instr(i32 %a) !dbg !28 {
14 ; CHECK-LABEL: @instr(
15 ; CHECK-NEXT: [[GCOV_CTR:%.*]] = load i64, i64* getelementptr inbounds ([1 x i64], [1 x i64]* @__llvm_gcov_ctr, i64 0, i64 0), align 4, !dbg [[DBG8:![0-9]+]]
16 ; CHECK-NEXT: [[TMP1:%.*]] = add i64 [[GCOV_CTR]], 1, !dbg [[DBG8]]
17 ; CHECK-NEXT: store i64 [[TMP1]], i64* getelementptr inbounds ([1 x i64], [1 x i64]* @__llvm_gcov_ctr, i64 0, i64 0), align 4, !dbg [[DBG8]]
18 ; CHECK-NEXT: ret i32 42, !dbg [[DBG8]]
24 !llvm.module.flags = !{!3}
26 !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, emissionKind: FullDebug, enums: !2)
27 !1 = !DIFile(filename: "a.c", directory: "")
29 !3 = !{i32 2, !"Debug Info Version", i32 3}
30 !9 = distinct !DISubprogram(name: "no_instr", scope: !1, file: !1, line: 5, type: !10, scopeLine: 5, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !2)
31 !10 = !DISubroutineType(types: !2)
32 !27 = !DILocation(line: 9, column: 3, scope: !9)
33 !28 = distinct !DISubprogram(name: "instr", scope: !1, file: !1, line: 12, type: !10, scopeLine: 12, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !2)
34 !44 = !DILocation(line: 16, column: 3, scope: !28)