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.
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
10 ; Currently the no-source-location type comes out first.
11 ; CHECK: .debug_info.dwo contents:
12 ; CHECK: 0x00000000: Type Unit: {{.*}} name = 'S'
13 ; CHECK-SAME: (next unit at [[TU2:0x[0-9a-f]+]])
14 ; CHECK: DW_TAG_type_unit
15 ; CHECK-NOT: DW_AT_stmt_list
16 ; CHECK-NOT: DW_AT_decl_file
17 ; CHECK: [[TU2]]: Type Unit: {{.*}} name = 'T'
18 ; CHECK: DW_TAG_type_unit
19 ; CHECK: DW_AT_stmt_list
20 ; CHECK: DW_AT_decl_file
22 ; CHECK: .debug_line.dwo
23 ; CHECK-NOT: standard_opcode_lengths
24 ; CHECK: file_names[ 0]:
25 ; CHECK-NEXT: name: "t.cpp"
26 ; CHECK-NEXT: dir_index: 0
29 source_filename = "t.cpp"
30 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
31 target triple = "x86_64-unknown-linux-gnu"
33 %struct.S = type { i32 }
34 %struct.T = type { i32 }
36 @s = global %struct.S zeroinitializer, align 4, !dbg !0
37 @t = global %struct.T zeroinitializer, align 4, !dbg !14
40 !llvm.module.flags = !{!8, !9}
43 !0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
44 !1 = distinct !DIGlobalVariable(name: "s", scope: !2, file: !3, line: 5, type: !6, isLocal: false, isDefinition: true)
45 !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)
46 !3 = !DIFile(filename: "t.cpp", directory: "/home/probinson/projects/scratch")
49 !6 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "S", size: 32, elements: !7, identifier: "_ZTS1S")
51 !8 = !{i32 2, !"Dwarf Version", i32 4}
52 !9 = !{i32 2, !"Debug Info Version", i32 3}
53 !10 = !{!"clang version 5.0.0 (trunk 295942)"}
54 !11 = distinct !DIGlobalVariable(name: "t", scope: !2, file: !3, line: 10, type: !12, isLocal: false, isDefinition: true)
55 !12 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "T", file: !3, line: 8, size: 32, elements: !13, identifier: "_ZTS1S")
57 !14 = !DIGlobalVariableExpression(var: !11, expr: !DIExpression())