50 lines · plain
1; RUN: opt < %s -passes=add-discriminators -S | FileCheck %s2 3; Discriminator support for calls that are defined in one line:4; #1 void bar();5; #26; #3 void foo() {7; #4 bar();bar()/*discriminator 2*/;bar()/*discriminator 4*/;8; #5 }9 10; Function Attrs: uwtable11define void @_Z3foov() !dbg !4 {12 call void @_Z3barv(), !dbg !1013; CHECK: call void @_Z3barv(), !dbg ![[CALL0:[0-9]+]]14 %a = alloca [100 x i8], align 1615 call void @llvm.lifetime.start.p0(ptr %a), !dbg !1116 call void @llvm.lifetime.end.p0(ptr %a), !dbg !1117 call void @_Z3barv(), !dbg !1118; CHECK: call void @_Z3barv(), !dbg ![[CALL1:[0-9]+]]19 call void @_Z3barv(), !dbg !1220; CHECK: call void @_Z3barv(), !dbg ![[CALL2:[0-9]+]]21 ret void, !dbg !1322}23 24declare void @_Z3barv()25declare void @llvm.lifetime.start.p0(ptr nocapture) nounwind argmemonly26declare void @llvm.lifetime.end.p0(ptr nocapture) nounwind argmemonly27 28!llvm.dbg.cu = !{!0}29!llvm.module.flags = !{!7, !8}30!llvm.ident = !{!9}31 32!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.8.0 (trunk 250915) (llvm/trunk 251830)", isOptimized: false, runtimeVersion: 0, emissionKind: NoDebug, enums: !2)33!1 = !DIFile(filename: "c.cc", directory: "/tmp")34!2 = !{}35!4 = distinct !DISubprogram(name: "foo", linkageName: "_Z3foov", scope: !1, file: !1, line: 3, type: !5, isLocal: false, isDefinition: true, scopeLine: 3, flags: DIFlagPrototyped, isOptimized: false, unit: !0, retainedNodes: !2)36!5 = !DISubroutineType(types: !6)37!6 = !{null}38!7 = !{i32 2, !"Dwarf Version", i32 4}39!8 = !{i32 2, !"Debug Info Version", i32 3}40!9 = !{!"clang version 3.8.0 (trunk 250915) (llvm/trunk 251830)"}41!10 = !DILocation(line: 4, column: 3, scope: !4)42!11 = !DILocation(line: 4, column: 9, scope: !4)43!12 = !DILocation(line: 4, column: 15, scope: !4)44!13 = !DILocation(line: 5, column: 1, scope: !4)45 46; CHECK: ![[CALL1]] = !DILocation(line: 4, column: 9, scope: ![[CALL1BLOCK:[0-9]+]])47; CHECK: ![[CALL1BLOCK]] = !DILexicalBlockFile({{.*}} discriminator: 2)48; CHECK: ![[CALL2]] = !DILocation(line: 4, column: 15, scope: ![[CALL2BLOCK:[0-9]+]])49; CHECK: ![[CALL2BLOCK]] = !DILexicalBlockFile({{.*}} discriminator: 4)50