1; Test that we annotate entire program's summary to IR.
2; RUN: opt < %s -sample-profile -sample-profile-file=%S/Inputs/summary.prof -S | FileCheck %s
3; RUN: opt < %s -sample-profile -sample-profile-file=%S/Inputs/summary.prof -S | opt -sample-profile -sample-profile-file=%S/Inputs/summary.prof -S | FileCheck %s
4
5define i32 @bar() #0 !dbg !1 {
6entry:
7  ret i32 1, !dbg !2
8}
9
10define i32 @baz() !dbg !3 {
11entry:
12    %call = call i32 @bar(), !dbg !4
13    ret i32 %call, !dbg !5
14}
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