61 lines · plain
1; Test the profile _Z3sumii won't be mistakenly annotated to foo2; when '-sample-profile-merge-inlinee' is enabled. When the mistake3; happens, there will be a "No debug information found" warning message.4; RUN: opt < %s -passes=sample-profile \5; RUN: -sample-profile-file=%S/Inputs/inline-mergeprof.prof \6; RUN: -sample-profile-merge-inlinee=true -S 2>&1| FileCheck %s7 8@.str = private unnamed_addr constant [11 x i8] c"sum is %d\0A\00", align 19declare void @__cxa_call_unexpected(ptr)10declare i32 @__gxx_personality_v0(...)11declare i32 @_Z3subii(i32 %x, i32 %y)12 13define i32 @main() "use-sample-profile" nounwind uwtable ssp personality ptr @__gxx_personality_v0 !dbg !6 {14entry:15 %retval = alloca i32, align 416 %s = alloca i32, align 417 %i = alloca i32, align 418 %tmp = load i32, ptr %i, align 4, !dbg !819 %tmp1 = load i32, ptr %s, align 4, !dbg !820 %call = invoke i32 @foo(i32 %tmp, i32 %tmp1)21 to label %cont unwind label %lpad, !dbg !822; CHECK-NOT: warning: No debug information found in function foo23; CHECK: invoke i32 @foo24cont:25 store i32 %call, ptr %s, align 4, !dbg !826 ret i32 0, !dbg !1127lpad:28 %lptmp0 = landingpad { ptr, i32 }29 filter [0 x ptr] zeroinitializer30 %lptmp1 = extractvalue { ptr, i32 } %lptmp0, 031 tail call void @__cxa_call_unexpected(ptr %lptmp1) noreturn nounwind32 unreachable33}34 35define i32 @foo(i32 %x, i32 %y) #0 {36entry:37 %add = add nsw i32 %x, %y38 ret i32 %add39}40 41attributes #0 = { "use-sample-profile" }42 43declare i32 @printf(ptr, ...)44 45!llvm.dbg.cu = !{!0}46!llvm.module.flags = !{!3, !4}47!llvm.ident = !{!5}48 49!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.5 ", isOptimized: false, runtimeVersion: 0, emissionKind: NoDebug, enums: !2, retainedTypes: !2, globals: !2, imports: !2)50!1 = !DIFile(filename: "calls.cc", directory: ".")51!2 = !{}52!3 = !{i32 2, !"Dwarf Version", i32 4}53!4 = !{i32 1, !"Debug Info Version", i32 3}54!5 = !{!"clang version 3.5 "}55!6 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 7, type: !7, scopeLine: 7, virtualIndex: 6, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !2)56!7 = !DISubroutineType(types: !2)57!8 = !DILocation(line: 10, scope: !9)58!9 = !DILexicalBlockFile(scope: !10, file: !1, discriminator: 2)59!10 = distinct !DILexicalBlock(scope: !6, file: !1, line: 10)60!11 = !DILocation(line: 12, scope: !6)61