1 ; Verify that if we have two split type units, one with source locations and 2 ; one without, the one without locations doesn't have a DW_AT_stmt_list 3 ; attribute, but the other one does and the .debug_line.dwo section is present. 4 5 ; RUN: llc -split-dwarf-file=foo.dwo -split-dwarf-output=%t.dwo \ 6 ; RUN: -dwarf-version=5 -generate-type-units \ 7 ; RUN: -filetype=obj -O0 -mtriple=x86_64-unknown-linux-gnu < %s 8 ; RUN: llvm-dwarfdump -v %t.dwo | FileCheck %s 9 10 ; Currently the no-source-location type comes out first. 11 ; FIXME: V5 wants type units in .debug_info.dwo not .debug_types.dwo. 12 ; CHECK: .debug_types.dwo contents: 13 ; CHECK: 0x00000000: Type Unit: {{.*}} name = 'S' 14 ; CHECK-SAME: (next unit at [[TU2:0x[0-9a-f]+]]) 15 ; CHECK: DW_TAG_type_unit 16 ; CHECK-NOT: DW_AT_stmt_list 17 ; CHECK-NOT: DW_AT_decl_file 18 ; CHECK: [[TU2]]: Type Unit: {{.*}} name = 'T' 19 ; CHECK: DW_TAG_type_unit 20 ; CHECK: DW_AT_stmt_list 21 ; CHECK: DW_AT_decl_file 22 23 ; CHECK: .debug_line.dwo 24 ; CHECK-NOT: standard_opcode_lengths 25 ; CHECK: file_names[ 0]: 26 ; CHECK-NEXT: name: "t.cpp" 27 ; CHECK-NEXT: dir_index: 0 28 29 ; ModuleID = 't.cpp' 30 source_filename = "t.cpp" 31 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" 32 target triple = "x86_64-unknown-linux-gnu" 33 34 %struct.S = type { i32 } 35 %struct.T = type { i32 } 36 37 @s = global %struct.S zeroinitializer, align 4, !dbg !0 38 @t = global %struct.T zeroinitializer, align 4, !dbg !14 39 40 !llvm.dbg.cu = !{!2} 41 !llvm.module.flags = !{!8, !9} 42 !llvm.ident = !{!10} 43 44 !0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression()) 45 !1 = distinct !DIGlobalVariable(name: "s", scope: !2, file: !3, line: 5, type: !6, isLocal: false, isDefinition: true) 46 !2 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !3, producer: "clang version 5.0.0 (trunk 295942)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5) 47 !3 = !DIFile(filename: "t.cpp", directory: "/home/probinson/projects/scratch") 48 !4 = !{} 49 !5 = !{!0,!14} 50 !6 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "S", size: 32, elements: !7, identifier: "_ZTS1S") 51 !7 = !{} 52 !8 = !{i32 2, !"Dwarf Version", i32 4} 53 !9 = !{i32 2, !"Debug Info Version", i32 3} 54 !10 = !{!"clang version 5.0.0 (trunk 295942)"} 55 !11 = distinct !DIGlobalVariable(name: "t", scope: !2, file: !3, line: 10, type: !12, isLocal: false, isDefinition: true) 56 !12 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "T", file: !3, line: 8, size: 32, elements: !13, identifier: "_ZTS1S") 57 !13 = !{} 58 !14 = !DIGlobalVariableExpression(var: !11, expr: !DIExpression()) 59