xref: /llvm-project/llvm/test/tools/llvm-dwarfutil/ELF/X86/copy.test (revision 4539b44148918c332ff966a2a955aca0ab93dde4)
1*4539b441SAlexey Lapshin## This test checks that debug info contained in the source file
2*4539b441SAlexey Lapshin## is fully copied to the destination file in case --no-garbage-collection
3*4539b441SAlexey Lapshin## is specified.
4*4539b441SAlexey Lapshin
5*4539b441SAlexey Lapshin# RUN: yaml2obj %p/Inputs/common.yaml -o %t.o
6*4539b441SAlexey Lapshin
7*4539b441SAlexey Lapshin## Check that the resulting file contains debug info from source file.
8*4539b441SAlexey Lapshin# RUN: llvm-dwarfutil --no-garbage-collection %t.o %t1
9*4539b441SAlexey Lapshin# RUN: llvm-dwarfdump -a %t1 | FileCheck %s
10*4539b441SAlexey Lapshin
11*4539b441SAlexey Lapshin## Check that the second copy matches with the first.
12*4539b441SAlexey Lapshin# RUN: llvm-dwarfutil --no-garbage-collection %t1 %t2
13*4539b441SAlexey Lapshin# RUN: cmp %t1 %t2
14*4539b441SAlexey Lapshin
15*4539b441SAlexey Lapshin## Check that input file passed through <stdin> is correctly processesed.
16*4539b441SAlexey Lapshin# RUN: llvm-dwarfutil --no-garbage-collection - %t2 < %t1
17*4539b441SAlexey Lapshin# RUN: cmp %t1 %t2
18*4539b441SAlexey Lapshin
19*4539b441SAlexey Lapshin# CHECK: .debug_abbrev
20*4539b441SAlexey Lapshin# CHECK: DW_TAG_compile_unit
21*4539b441SAlexey Lapshin# CHECK: .debug_info
22*4539b441SAlexey Lapshin# CHECK: DW_TAG_compile_unit
23*4539b441SAlexey Lapshin# CHECK: DW_AT_producer{{.*}}"by_hand"
24*4539b441SAlexey Lapshin# CHECK: DW_AT_language{{.*}}DW_LANG_C_plus_plus
25*4539b441SAlexey Lapshin# CHECK: DW_AT_name{{.*}}"CU1"
26*4539b441SAlexey Lapshin# CHECK: DW_TAG_class_type
27*4539b441SAlexey Lapshin# CHECK: DW_AT_name{{.*}}"class1"
28*4539b441SAlexey Lapshin# CHECK: DW_TAG_base_type
29*4539b441SAlexey Lapshin# CHECK: DW_AT_name{{.*}}"int"
30*4539b441SAlexey Lapshin# CHECK: DW_AT_name{{.*}}"char"
31*4539b441SAlexey Lapshin# CHECK: DW_AT_name{{.*}}"float"
32*4539b441SAlexey Lapshin# CHECK: DW_TAG_pointer_type
33*4539b441SAlexey Lapshin# CHECK: DW_TAG_variable
34*4539b441SAlexey Lapshin# CHECK: DW_AT_name{{.*}}"var1"
35