67 lines · plain
1; Inject metadata to set the .gcno file location2; RUN: rm -rf %t && mkdir -p %t3; RUN: echo '!19 = !{!"%/t/exit-block.ll", !0}' > %t/14; RUN: cat %s %t/1 > %t/25 6; The exit block is the second.7; RUN: opt -passes=insert-gcov-profiling -disable-output %t/28; RUN: llvm-cov gcov -n -dump %t/exit-block.gcno 2>&1 | FileCheck %s9 10target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"11target triple = "x86_64-unknown-linux-gnu"12 13@A = common global i32 0, align 4, !dbg !914 15; Function Attrs: nounwind uwtable16define void @test() !dbg !4 {17entry:18 tail call void (...) @f() #2, !dbg !1419 %0 = load i32, ptr @A, align 4, !dbg !1520 %tobool = icmp eq i32 %0, 0, !dbg !1521 br i1 %tobool, label %if.end, label %if.then, !dbg !1522 23if.then: ; preds = %entry24 tail call void (...) @g() #2, !dbg !1625 br label %if.end, !dbg !1626 27if.end: ; preds = %entry, %if.then28 ret void, !dbg !1829}30 31declare void @f(...)32 33declare void @g(...)34 35attributes #2 = { nounwind }36 37!llvm.gcov = !{!19}38!llvm.dbg.cu = !{!0}39!llvm.module.flags = !{!11, !12}40!llvm.ident = !{!13}41 42!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.6.0 (trunk 223182)", isOptimized: true, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !2, globals: !8, imports: !2)43!1 = !DIFile(filename: ".../llvm/test/Transforms/GCOVProfiling/exit-block.ll", directory: "")44!2 = !{}45!4 = distinct !DISubprogram(name: "test", line: 5, isLocal: false, isDefinition: true, isOptimized: true, unit: !0, scopeLine: 5, file: !1, scope: !5, type: !6, retainedNodes: !2)46!5 = !DIFile(filename: ".../llvm/test/Transforms/GCOVProfiling/exit-block.ll", directory: "")47!6 = !DISubroutineType(types: !7)48!7 = !{null}49!8 = !{!9}50!9 = !DIGlobalVariableExpression(var: !DIGlobalVariable(name: "A", line: 3, isLocal: false, isDefinition: true, scope: null, file: !5, type: !10), expr: !DIExpression())51!10 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)52!11 = !{i32 2, !"Dwarf Version", i32 4}53!12 = !{i32 2, !"Debug Info Version", i32 3}54!13 = !{!"clang version 3.6.0 (trunk 223182)"}55!14 = !DILocation(line: 6, column: 3, scope: !4)56!15 = !DILocation(line: 7, column: 7, scope: !4)57!16 = !DILocation(line: 8, column: 5, scope: !17)58!17 = distinct !DILexicalBlock(line: 7, column: 7, file: !1, scope: !4)59!18 = !DILocation(line: 9, column: 1, scope: !4)60 61; There should be no destination edges for the exit block.62; CHECK: Block : 1 Counter : 063; CHECK: Block : 2 Counter : 064; CHECK: Block : 4 Counter : 065; CHECK: Destination Edges66; CHECK-NOT: Block :67