[llvm] r313662 - Fix test to not depend on another subdirectories Input directory

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 19 12:20:08 PDT 2017


Author: dblaikie
Date: Tue Sep 19 12:20:08 2017
New Revision: 313662

URL: http://llvm.org/viewvc/llvm-project?rev=313662&view=rev
Log:
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).

Added:
    llvm/trunk/test/tools/llvm-dwarfdump/X86/Inputs/
    llvm/trunk/test/tools/llvm-dwarfdump/X86/Inputs/typeunit-header.s
Modified:
    llvm/trunk/test/tools/llvm-dwarfdump/X86/debug_type_offset.test

Added: llvm/trunk/test/tools/llvm-dwarfdump/X86/Inputs/typeunit-header.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-dwarfdump/X86/Inputs/typeunit-header.s?rev=313662&view=auto
==============================================================================
--- llvm/trunk/test/tools/llvm-dwarfdump/X86/Inputs/typeunit-header.s (added)
+++ llvm/trunk/test/tools/llvm-dwarfdump/X86/Inputs/typeunit-header.s Tue Sep 19 12:20:08 2017
@@ -0,0 +1,49 @@
+# Test object with an artifically constructed type unit header to verify 
+# that the length field is correctly used to verify the validity of the
+# type_offset field.
+#
+# To generate the test object:
+# llvm-mc -triple x86_64-unknown-linux typeunit-header.s -filetype=obj \
+#         -o typeunit-header.elf-x86-64
+#
+# We only have an abbreviation for the type unit die which is all we need.
+# Real type unit dies have quite different attributes of course, but we
+# just need to demonstrate an issue with validating length, so we just give it
+# a single visibility attribute.
+        .section .debug_abbrev,"", at progbits
+        .byte 0x01  # Abbrev code
+        .byte 0x41  # DW_TAG_type_unit
+        .byte 0x01  # DW_CHILDREN_yes
+        .byte 0x17  # DW_AT_visibility
+        .byte 0x0b  # DW_FORM_data1
+        .byte 0x00  # EOM(1)
+        .byte 0x00  # EOM(2)
+        .byte 0x02  # Abbrev code
+        .byte 0x13  # DW_TAG_structure_type
+        .byte 0x00  # DW_CHILDREN_no (no members)
+        .byte 0x17  # DW_AT_visibility
+        .byte 0x0b  # DW_FORM_data1
+        .byte 0x00  # EOM(1)
+        .byte 0x00  # EOM(2)
+        .byte 0x00  # EOM(3)
+        
+        .section .debug_types,"", at progbits
+# DWARF v4 Type unit header - DWARF32 format.
+TU_4_32_start:
+        .long TU_4_32_end-TU_4_32_version  # Length of Unit
+TU_4_32_version:
+        .short 4               # DWARF version number
+        .long .debug_abbrev    # Offset Into Abbrev. Section
+        .byte 8                # Address Size (in bytes)
+        .quad 0x0011223344556677 # Type Signature
+        .long TU_4_32_type-TU_4_32_start # Type offset
+# The type-unit DIE, which has just a visibility attribute.
+        .byte 1                # Abbreviation code
+        .byte 1                # DW_VIS_local
+# The type DIE, which also just has a one-byte visibility attribute.
+TU_4_32_type:
+        .byte 2                # Abbreviation code
+        .byte 1                # DW_VIS_local
+        .byte 0 # NULL
+        .byte 0 # NULL
+TU_4_32_end:

Modified: llvm/trunk/test/tools/llvm-dwarfdump/X86/debug_type_offset.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-dwarfdump/X86/debug_type_offset.test?rev=313662&r1=313661&r2=313662&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-dwarfdump/X86/debug_type_offset.test (original)
+++ llvm/trunk/test/tools/llvm-dwarfdump/X86/debug_type_offset.test Tue Sep 19 12:20:08 2017
@@ -1,4 +1,4 @@
-RUN: llvm-mc %S/../../../DebugInfo/Inputs/typeunit-header.s -filetype obj \
+RUN: llvm-mc %p/Inputs/typeunit-header.s -filetype obj \
 RUN:   -triple x86_64-unknown-elf -o - \
 RUN:   | llvm-dwarfdump -debug-types=0x00000019 - | FileCheck %s
 CHECK: .debug_types contents:
@@ -7,7 +7,7 @@ CHECK: 0x00000019: DW_TAG_structure_type
 CHECK:               DW_AT_visibility
 CHECK-NOT: {{:}}
 
-RUN: llvm-mc %S/../../../DebugInfo/Inputs/typeunit-header.s -filetype obj \
+RUN: llvm-mc %p/Inputs/typeunit-header.s -filetype obj \
 RUN:   -triple x86_64-unknown-elf -o - \
 RUN:   | llvm-dwarfdump -c -debug-types=0x0000017 - \
 RUN:   | FileCheck %s --check-prefix=CHILDREN




More information about the llvm-commits mailing list