1cee313d2SEric Christopher; RUN: opt < %s -passes=sample-profile -sample-profile-file=%S/Inputs/entry_counts.prof -S | FileCheck %s 2cee313d2SEric Christopher 3cee313d2SEric Christopher; According to the profile, function empty() was called 13,293 times. 4cee313d2SEric Christopher; CHECK: {{.*}} = !{!"function_entry_count", i64 13294} 5cee313d2SEric Christopher 6*7a6c8942SWei Midefine void @empty() #0 !dbg !4 { 7cee313d2SEric Christopherentry: 8cee313d2SEric Christopher ret void, !dbg !9 9cee313d2SEric Christopher} 10cee313d2SEric Christopher 11cee313d2SEric Christopher; This function does not have profile, check if function_entry_count is -1 12cee313d2SEric Christopher; CHECK: {{.*}} = !{!"function_entry_count", i64 -1} 13*7a6c8942SWei Midefine void @no_profile() #0 { 14cee313d2SEric Christopherentry: 15cee313d2SEric Christopher ret void 16cee313d2SEric Christopher} 17cee313d2SEric Christopher 18*7a6c8942SWei Miattributes #0 = {"use-sample-profile"} 19*7a6c8942SWei Mi 20cee313d2SEric Christopher!llvm.dbg.cu = !{!0} 21cee313d2SEric Christopher!llvm.module.flags = !{!6, !7} 22cee313d2SEric Christopher!llvm.ident = !{!8} 23cee313d2SEric Christopher 24cee313d2SEric Christopher!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) 25cee313d2SEric Christopher!1 = !DIFile(filename: "entry_counts.c", directory: ".") 26cee313d2SEric Christopher!2 = !{} 27cee313d2SEric Christopher!4 = distinct !DISubprogram(name: "empty", scope: !1, file: !1, line: 1, type: !5, isLocal: false, isDefinition: true, scopeLine: 1, isOptimized: false, unit: !0, retainedNodes: !2) 28cee313d2SEric Christopher!5 = !DISubroutineType(types: !2) 29cee313d2SEric Christopher!6 = !{i32 2, !"Dwarf Version", i32 4} 30cee313d2SEric Christopher!7 = !{i32 2, !"Debug Info Version", i32 3} 31cee313d2SEric Christopher!8 = !{!"clang version 3.7.0 (trunk 237249) (llvm/trunk 237261)"} 32cee313d2SEric Christopher!9 = !DILocation(line: 1, column: 15, scope: !4) 33