xref: /llvm-project/llvm/test/DebugInfo/X86/skeleton-unit-verify.s (revision 52961491ca347e7c8766dc7c45841bacac6a4470)
1# RUN: llvm-mc -triple x86_64-unknown-linux %s -filetype=obj -o %t.o
2# RUN: not llvm-dwarfdump --error-display=details --verify %t.o | FileCheck %s
3
4# CHECK: Verifying .debug_abbrev...
5# CHECK-NEXT: Verifying .debug_info Unit Header Chain...
6# CHECK-NEXT: Verifying .debug_types Unit Header Chain...
7# CHECK-NEXT: Verifying non-dwo Units...
8# CHECK-NEXT: Verifying unit: 1 / 2, "test.cpp"
9# CHECK-NEXT: Verifying unit: 2 / 2{{$}}
10# CHECK-NEXT: warning: DW_TAG_skeleton_unit has DW_CHILDREN_yes but DIE has no children
11# CHECK-NEXT: DW_TAG_skeleton_unit
12# CHECK-NEXT: error: Skeleton compilation unit has children.
13# CHECK-NEXT: Verifying dwo Units...
14# CHECK-NEXT: Verifying .debug_line...
15# CHECK-NEXT: Verifying .debug_str_offsets...
16# CHECK-NEXT: Errors detected.
17
18        .section .debug_abbrev,"",@progbits
19        .byte   1                       # Abbreviation Code
20        .byte   74                      # DW_TAG_skeleton_unit
21        .byte   0                       # DW_CHILDREN_no
22        .byte   3                       # DW_AT_name
23        .byte   8                       # DW_FORM_string
24        .byte   0                       # EOM(1)
25        .byte   0                       # EOM(2)
26        .byte   2                       # Abbreviation Code
27        .byte   74                      # DW_TAG_skeleton_unit
28        .byte   1                       # DW_CHILDREN_yes
29        .byte   0                       # EOM(1)
30        .byte   0                       # EOM(2)
31        .byte   0                       # EOM(3)
32
33        .section        .debug_info,"",@progbits
34.Lcu_begin0:
35        .long   .Lcu_end0-.Lcu_start0 # Length of Unit
36.Lcu_start0:
37        .short  5                       # DWARF version number
38        .byte   4                       # DWARF Unit Type
39        .byte   8                       # Address Size (in bytes)
40        .long   .debug_abbrev           # Offset Into Abbrev. Section
41        .quad   -6573227469967412476
42        .byte   1                       # Abbrev [1]
43        .asciz  "test.cpp"
44        .byte   0
45.Lcu_end0:
46        .long   .Lcu_end1-.Lcu_start1 # Length of Unit
47.Lcu_start1:
48        .short  5                       # DWARF version number
49        .byte   4                       # DWARF Unit Type
50        .byte   8                       # Address Size (in bytes)
51        .long   .debug_abbrev           # Offset Into Abbrev. Section
52        .quad   -6573227469967412476
53        .byte   2                       # Abbrev [2]
54        .byte   0
55.Lcu_end1:
56