27 lines · plain
1; Test that we annotate entire program's summary to IR.2; RUN: opt -S %s -passes=sample-profile -sample-profile-file=%S/Inputs/summary.prof | FileCheck %s3; RUN: opt -S %s -passes=sample-profile -sample-profile-file=%S/Inputs/summary.prof | opt -S -passes=sample-profile -sample-profile-file=%S/Inputs/summary.prof | FileCheck %s4 5define i32 @bar() #0 !dbg !1 {6entry:7 ret i32 1, !dbg !28}9 10define i32 @baz() !dbg !3 {11entry:12 %call = call i32 @bar(), !dbg !413 ret i32 %call, !dbg !514}15 16; CHECK-DAG: {{![0-9]+}} = !{i32 1, !"ProfileSummary", {{![0-9]+}}}17; CHECK-DAG: {{![0-9]+}} = !{!"TotalCount", i64 900}18; CHECK-DAG: {{![0-9]+}} = !{!"NumCounts", i64 5}19; CHECK-DAG: {{![0-9]+}} = !{!"NumFunctions", i64 3}20; CHECK-DAG: {{![0-9]+}} = !{!"MaxFunctionCount", i64 3}21 22!1 = distinct !DISubprogram(name: "bar")23!2 = !DILocation(line: 2, scope: !2)24!3 = distinct !DISubprogram(name: "baz")25!4 = !DILocation(line: 1, scope: !4)26!5 = !DILocation(line: 2, scope: !5)27