1 ; RUN: opt < %s -disable-output -passes=print-profile-summary -S 2>&1 | FileCheck %s
2 ; RUN: opt < %s -disable-output -profile-summary-hot-count=500 -passes=print-profile-summary -S 2>&1 | FileCheck %s -check-prefixes=OVERRIDE-HOT
3 ; RUN: opt < %s -disable-output -profile-summary-cold-count=0 -passes=print-profile-summary -S 2>&1 | FileCheck %s -check-prefixes=OVERRIDE-COLD
4 ; RUN: opt < %s -disable-output -profile-summary-cold-count=200 -profile-summary-hot-count=1000 -passes=print-profile-summary -S 2>&1 | FileCheck %s -check-prefixes=OVERRIDE-BOTH
6 define void @f1() !prof !20 {
8 ; OVERRIDE-HOT-LABEL: f1
9 ; OVERRIDE-COLD-LABEL: f1 :hot
10 ; OVERRIDE-BOTH-LABEL: f1
15 define void @f2() !prof !21 {
16 ; CHECK-LABEL: f2 :cold
17 ; OVERRIDE-HOT-LABEL: f2 :cold
18 ; OVERRIDE-COLD-LABEL: f2
19 ; OVERRIDE-BOTH-LABEL: f2
24 define void @f3() !prof !22 {
26 ; OVERRIDE-HOT-LABEL: f3
27 ; OVERRIDE-COLD-LABEL: f3
28 ; OVERRIDE-BOTH-LABEL: f3
33 !llvm.module.flags = !{!1}
34 !20 = !{!"function_entry_count", i64 400}
35 !21 = !{!"function_entry_count", i64 1}
36 !22 = !{!"function_entry_count", i64 100}
38 !1 = !{i32 1, !"ProfileSummary", !2}
39 !2 = !{!3, !4, !5, !6, !7, !8, !9, !10}
40 !3 = !{!"ProfileFormat", !"InstrProf"}
41 !4 = !{!"TotalCount", i64 10000}
42 !5 = !{!"MaxCount", i64 10}
43 !6 = !{!"MaxInternalCount", i64 1}
44 !7 = !{!"MaxFunctionCount", i64 1000}
45 !8 = !{!"NumCounts", i64 3}
46 !9 = !{!"NumFunctions", i64 3}
47 !10 = !{!"DetailedSummary", !11}
48 !11 = !{!12, !13, !14}
49 !12 = !{i32 10000, i64 100, i32 1}
50 !13 = !{i32 999000, i64 100, i32 1}
51 !14 = !{i32 999999, i64 1, i32 2}