xref: /aosp_15_r20/external/llvm/test/Transforms/SampleProfile/summary.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; Test that we annotate entire program's summary to IR.
2*9880d681SAndroid Build Coastguard Worker; RUN: opt < %s -sample-profile -sample-profile-file=%S/Inputs/summary.prof -S | FileCheck %s
3*9880d681SAndroid Build Coastguard Worker
4*9880d681SAndroid Build Coastguard Workerdefine i32 @bar() #0 !dbg !1 {
5*9880d681SAndroid Build Coastguard Workerentry:
6*9880d681SAndroid Build Coastguard Worker  ret i32 1, !dbg !2
7*9880d681SAndroid Build Coastguard Worker}
8*9880d681SAndroid Build Coastguard Worker
9*9880d681SAndroid Build Coastguard Worker; CHECK-DAG: {{![0-9]+}} = !{i32 1, !"ProfileSummary", {{![0-9]+}}}
10*9880d681SAndroid Build Coastguard Worker; CHECK-DAG: {{![0-9]+}} = !{!"NumFunctions", i64 2}
11*9880d681SAndroid Build Coastguard Worker; CHECK-DAG: {{![0-9]+}} = !{!"MaxFunctionCount", i64 3}
12*9880d681SAndroid Build Coastguard Worker
13*9880d681SAndroid Build Coastguard Worker!1 = distinct !DISubprogram(name: "bar")
14*9880d681SAndroid Build Coastguard Worker!2 = !DILocation(line: 2, scope: !2)
15