Skip to content

Commit 610e03a

Browse files
committed
Fix test to not depend on another subdirectories Input directory
Inputs should be placed local to the test (or possibly in a common parent? I think we do that in some places - but the only common parent between these two directories is 'test' which seems a bit overly broad). llvm-svn: 313662
1 parent 523560e commit 610e03a

File tree

2 files changed

+51
-2
lines changed

2 files changed

+51
-2
lines changed
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Test object with an artifically constructed type unit header to verify
2+
# that the length field is correctly used to verify the validity of the
3+
# type_offset field.
4+
#
5+
# To generate the test object:
6+
# llvm-mc -triple x86_64-unknown-linux typeunit-header.s -filetype=obj \
7+
# -o typeunit-header.elf-x86-64
8+
#
9+
# We only have an abbreviation for the type unit die which is all we need.
10+
# Real type unit dies have quite different attributes of course, but we
11+
# just need to demonstrate an issue with validating length, so we just give it
12+
# a single visibility attribute.
13+
.section .debug_abbrev,"",@progbits
14+
.byte 0x01 # Abbrev code
15+
.byte 0x41 # DW_TAG_type_unit
16+
.byte 0x01 # DW_CHILDREN_yes
17+
.byte 0x17 # DW_AT_visibility
18+
.byte 0x0b # DW_FORM_data1
19+
.byte 0x00 # EOM(1)
20+
.byte 0x00 # EOM(2)
21+
.byte 0x02 # Abbrev code
22+
.byte 0x13 # DW_TAG_structure_type
23+
.byte 0x00 # DW_CHILDREN_no (no members)
24+
.byte 0x17 # DW_AT_visibility
25+
.byte 0x0b # DW_FORM_data1
26+
.byte 0x00 # EOM(1)
27+
.byte 0x00 # EOM(2)
28+
.byte 0x00 # EOM(3)
29+
30+
.section .debug_types,"",@progbits
31+
# DWARF v4 Type unit header - DWARF32 format.
32+
TU_4_32_start:
33+
.long TU_4_32_end-TU_4_32_version # Length of Unit
34+
TU_4_32_version:
35+
.short 4 # DWARF version number
36+
.long .debug_abbrev # Offset Into Abbrev. Section
37+
.byte 8 # Address Size (in bytes)
38+
.quad 0x0011223344556677 # Type Signature
39+
.long TU_4_32_type-TU_4_32_start # Type offset
40+
# The type-unit DIE, which has just a visibility attribute.
41+
.byte 1 # Abbreviation code
42+
.byte 1 # DW_VIS_local
43+
# The type DIE, which also just has a one-byte visibility attribute.
44+
TU_4_32_type:
45+
.byte 2 # Abbreviation code
46+
.byte 1 # DW_VIS_local
47+
.byte 0 # NULL
48+
.byte 0 # NULL
49+
TU_4_32_end:

llvm/test/tools/llvm-dwarfdump/X86/debug_type_offset.test

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
RUN: llvm-mc %S/../../../DebugInfo/Inputs/typeunit-header.s -filetype obj \
1+
RUN: llvm-mc %p/Inputs/typeunit-header.s -filetype obj \
22
RUN: -triple x86_64-unknown-elf -o - \
33
RUN: | llvm-dwarfdump -debug-types=0x00000019 - | FileCheck %s
44
CHECK: .debug_types contents:
@@ -7,7 +7,7 @@ CHECK: 0x00000019: DW_TAG_structure_type
77
CHECK: DW_AT_visibility
88
CHECK-NOT: {{:}}
99

10-
RUN: llvm-mc %S/../../../DebugInfo/Inputs/typeunit-header.s -filetype obj \
10+
RUN: llvm-mc %p/Inputs/typeunit-header.s -filetype obj \
1111
RUN: -triple x86_64-unknown-elf -o - \
1212
RUN: | llvm-dwarfdump -c -debug-types=0x0000017 - \
1313
RUN: | FileCheck %s --check-prefix=CHILDREN

0 commit comments

Comments
 (0)