1 2; Verify that DWARF v5 debug_names omit names from CUs that opt-out. 3; RUN: llc -mtriple x86_64-pc-linux -filetype=obj < %s \ 4; RUN: | llvm-dwarfdump -debug-info -debug-names - | FileCheck %s 5 6 7; Check that the one CU that is indexed has a non-zero. 8; Avoid checking for a specific offset to make the test more resilient. 9; CHECK: [[CU1OFF:0x00000000]]: Compile Unit: 10; CHECK: [[CU2OFF:0x[0-9a-f]{8}]]: Compile Unit: 11; CHECK: [[CU3OFF:0x[0-9a-f]{8}]]: Compile Unit: 12 13; CHECK: CU count: 2 14; CHECK: Compilation Unit offsets [ 15; CHECK-NEXT: CU[0]: [[CU1OFF]] 16; CHECK-NEXT: CU[1]: [[CU3OFF]] 17; CHECK-NEXT: ] 18; CHECK-NOT: DW_IDX_compile_unit: 0x02 19; CHECK: String: {{.*}} "f3" 20; CHECK-NOT: DW_IDX_compile_unit 21; CHECK: DW_IDX_compile_unit: 0x01 22 23; Function Attrs: noinline nounwind optnone uwtable 24define dso_local void @_Z2f1v() !dbg !11 { 25entry: 26 ret void, !dbg !14 27} 28 29; Function Attrs: noinline nounwind optnone uwtable 30define dso_local void @_Z2f2v() !dbg !15 { 31entry: 32 ret void, !dbg !16 33} 34 35; Function Attrs: noinline nounwind optnone uwtable 36define dso_local void @_Z2f3v() !dbg !17 { 37entry: 38 ret void, !dbg !18 39} 40 41!llvm.dbg.cu = !{!0, !3, !5} 42!llvm.ident = !{!7, !7, !7} 43!llvm.module.flags = !{!8, !9, !10} 44 45!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 8.0.0 (trunk 340586) (llvm/trunk 340588)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, nameTableKind: Default) 46!1 = !DIFile(filename: "f1.cpp", directory: "/usr/local/google/home/blaikie/dev/scratch", checksumkind: CSK_MD5, checksum: "5cf4a85ae773dd04a42282b1a708a179") 47!2 = !{} 48!3 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !4, producer: "clang version 8.0.0 (trunk 340586) (llvm/trunk 340588)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, nameTableKind: None) 49!4 = !DIFile(filename: "f2.cpp", directory: "/usr/local/google/home/blaikie/dev/scratch", checksumkind: CSK_MD5, checksum: "17efa328ddcbb22a3043feeec3190783") 50!5 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !6, producer: "clang version 8.0.0 (trunk 340586) (llvm/trunk 340588)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, nameTableKind: Default) 51!6 = !DIFile(filename: "f3.cpp", directory: "/usr/local/google/home/blaikie/dev/scratch", checksumkind: CSK_MD5, checksum: "73ed062a3b287e0193c695c550d2cef2") 52!7 = !{!"clang version 8.0.0 (trunk 340586) (llvm/trunk 340588)"} 53!8 = !{i32 2, !"Dwarf Version", i32 5} 54!9 = !{i32 2, !"Debug Info Version", i32 3} 55!10 = !{i32 1, !"wchar_size", i32 4} 56!11 = distinct !DISubprogram(name: "f1", linkageName: "_Z2f1v", scope: !1, file: !1, line: 1, type: !12, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: false, unit: !0, retainedNodes: !2) 57!12 = !DISubroutineType(types: !13) 58!13 = !{null} 59!14 = !DILocation(line: 2, column: 1, scope: !11) 60!15 = distinct !DISubprogram(name: "f2", linkageName: "_Z2f2v", scope: !4, file: !4, line: 1, type: !12, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: false, unit: !3, retainedNodes: !2) 61!16 = !DILocation(line: 2, column: 1, scope: !15) 62!17 = distinct !DISubprogram(name: "f3", linkageName: "_Z2f3v", scope: !6, file: !6, line: 1, type: !12, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: false, unit: !5, retainedNodes: !2) 63!18 = !DILocation(line: 2, column: 1, scope: !17) 64