Skip to content

Commit 9ec5638

Browse files
committed
[DebugInfo] Add new test
1 parent f162e71 commit 9ec5638

File tree

1 file changed

+75
-0
lines changed

1 file changed

+75
-0
lines changed
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# This test checks that llvm-dwarfdump correctly reports errors when parsing
2+
# DWARF Unit Headers in DWP files
3+
4+
# RUN: llvm-mc -triple x86_64-unknown-linux %s -filetype=obj -o %t.o \
5+
# RUN: -split-dwarf-file=%t.dwo -dwarf-version=5
6+
# RUN: llvm-dwp %t.dwo -o %t.dwp
7+
# RUN: llvm-dwarfdump -debug-info -debug-cu-index -debug-tu-index \
8+
# RUN: -manaully-generate-unit-index %t.dwp 2>&1 | FileCheck %s
9+
10+
## Note: In order to check whether the type unit index is generated
11+
## there is no need to add the missing DIEs for the structure type of the type unit.
12+
13+
# CHECK-NOT: .debug_info.dwo contents:
14+
15+
# CHECK-DAG: .debug_cu_index contents:
16+
# CHECK: Failed to parse CU header in DWP file
17+
# CHECK-NEXT: DWARF unit at offset 0x00000000 has unsupported version 6, supported are 2-5
18+
19+
# CHECK-DAG: .debug_tu_index contents:
20+
# CHECK: Failed to parse CU header in DWP file
21+
# CHECK-NEXT: DWARF unit at offset 0x00000000 has unsupported version 6, supported are 2-5
22+
23+
.section .debug_info.dwo,"e",@progbits
24+
.long .Ldebug_info_dwo_end0-.Ldebug_info_dwo_start0 # Length of Unit
25+
.Ldebug_info_dwo_start0:
26+
.short 6 # DWARF version number
27+
.byte 6 # DWARF Unit Type (DW_UT_split_type)
28+
.byte 8 # Address Size (in bytes)
29+
.long 0 # Offset Into Abbrev. Section
30+
.quad 5657452045627120676 # Type Signature
31+
.long 25 # Type DIE Offset
32+
.byte 2 # Abbrev [2] DW_TAG_type_unit
33+
.byte 3 # Abbrev [3] DW_TAG_structure_type
34+
.byte 0 # End Of Children Mark
35+
.Ldebug_info_dwo_end0:
36+
.section .debug_info.dwo,"e",@progbits
37+
.long .Ldebug_info_dwo_end1-.Ldebug_info_dwo_start1 # Length of Unit
38+
.Ldebug_info_dwo_start1:
39+
.short 6 # DWARF version number
40+
.byte 6 # DWARF Unit Type (DW_UT_split_type)
41+
.byte 8 # Address Size (in bytes)
42+
.long 0 # Offset Into Abbrev. Section
43+
.quad -8528522068957683993 # Type Signature
44+
.long 25 # Type DIE Offset
45+
.byte 4 # Abbrev [4] DW_TAG_type_unit
46+
.byte 5 # Abbrev [5] DW_TAG_structure_type
47+
.byte 0 # End Of Children Mark
48+
.Ldebug_info_dwo_end1:
49+
.section .debug_info.dwo,"e",@progbits
50+
.long .Ldebug_info_dwo_end2-.Ldebug_info_dwo_start2 # Length of Unit
51+
.Ldebug_info_dwo_start2:
52+
.short 6 # DWARF version number
53+
.byte 5 # DWARF Unit Type (DW_UT_split_compile)
54+
.byte 8 # Address Size (in bytes)
55+
.long 0 # Offset Into Abbrev. Section
56+
.quad 1152943841751211454
57+
.byte 1 # Abbrev [1] DW_TAG_compile_unit
58+
.Ldebug_info_dwo_end2:
59+
.section .debug_abbrev.dwo,"e",@progbits
60+
.byte 1 # Abbreviation Code
61+
.byte 17 # DW_TAG_compile_unit
62+
.byte 0 # DW_CHILDREN_no
63+
.byte 0 # EOM(1)
64+
.byte 0 # EOM(2)
65+
.byte 2 # Abbreviation Code
66+
.byte 65 # DW_TAG_type_unit
67+
.byte 1 # DW_CHILDREN_yes
68+
.byte 0 # EOM
69+
.byte 0 # EOM
70+
.byte 4 # Abbreviation Code
71+
.byte 65 # DW_TAG_type_unit
72+
.byte 1 # DW_CHILDREN_yes
73+
.byte 0 # EOM
74+
.byte 0 # EOM
75+
.byte 0 # EOM

0 commit comments

Comments
 (0)