blob: 49610f645a5fa1d6fd149c8b9f7b1e71cda01728 [file] [log] [blame]
Diego Novilloffc84e32015-05-13 17:04:29 +00001; RUN: opt < %s -sample-profile -sample-profile-file=%S/Inputs/entry_counts.prof -S | FileCheck %s
2
3; According to the profile, function empty() was called 13,293 times.
4; CHECK: {{.*}} = !{!"function_entry_count", i64 13293}
5
Peter Collingbourned4bff302015-11-05 22:03:56 +00006define void @empty() !dbg !4 {
Diego Novilloffc84e32015-05-13 17:04:29 +00007entry:
8 ret void, !dbg !9
9}
10
Dehao Chen6c73b492016-02-22 22:46:21 +000011; This function does not have profile, check if function_entry_count is 0
12; CHECK: {{.*}} = !{!"function_entry_count", i64 0}
13define void @no_profile() {
14entry:
15 ret void
16}
17
Diego Novilloffc84e32015-05-13 17:04:29 +000018!llvm.dbg.cu = !{!0}
19!llvm.module.flags = !{!6, !7}
20!llvm.ident = !{!8}
21
Adrian Prantl75819ae2016-04-15 15:57:41 +000022!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.7.0 (trunk 237249) (llvm/trunk 237261)", isOptimized: false, runtimeVersion: 0, emissionKind: LineTablesOnly, enums: !2, retainedTypes: !2, globals: !2, imports: !2)
Diego Novillo5eb5ad02015-10-26 18:14:44 +000023!1 = !DIFile(filename: "entry_counts.c", directory: ".")
Diego Novilloffc84e32015-05-13 17:04:29 +000024!2 = !{}
Adrian Prantl75819ae2016-04-15 15:57:41 +000025!4 = distinct !DISubprogram(name: "empty", scope: !1, file: !1, line: 1, type: !5, isLocal: false, isDefinition: true, scopeLine: 1, isOptimized: false, unit: !0, variables: !2)
Diego Novilloffc84e32015-05-13 17:04:29 +000026!5 = !DISubroutineType(types: !2)
27!6 = !{i32 2, !"Dwarf Version", i32 4}
28!7 = !{i32 2, !"Debug Info Version", i32 3}
29!8 = !{!"clang version 3.7.0 (trunk 237249) (llvm/trunk 237261)"}
30!9 = !DILocation(line: 1, column: 15, scope: !4)