1 # REQUIRES: system-linux
3 # RUN: llvm-mc -dwarf-version=4 -filetype=obj -triple x86_64-unknown-linux %p/Inputs/dwarf4-types-dwarf5-main.s -o %tmain.o
4 # RUN: llvm-mc -dwarf-version=5 -filetype=obj -triple x86_64-unknown-linux %p/Inputs/dwarf4-types-dwarf5-helper.s -o %thelper.o
5 # RUN: %clang %cflags %tmain.o %thelper.o -o %t.exe -Wl,-q
6 # RUN: llvm-bolt %t.exe -o %t.bolt --update-debug-sections
7 # RUN: llvm-dwarfdump --show-form --verbose --debug-info %t.bolt | FileCheck --check-prefix=POSTCHECK %s
8 # RUN: llvm-dwarfdump --show-form --verbose --debug-types %t.bolt | FileCheck --check-prefix=POSTCHECKTU %s
10 # Check BOLT handles DWARF4 with fdebug-types, and DWARF5 without.
12 # POSTCHECK: version = 0x0004
13 # POSTCHECK: DW_TAG_compile_unit
14 # POSTCHECK: DW_TAG_subprogram
15 # POSTCHECK: DW_AT_type [DW_FORM_ref4] (cu + 0x007c => {0x0000007c} "int")
16 # POSTCHECK: DW_TAG_formal_parameter
17 # POSTCHECK: DW_TAG_structure_type
18 # POSTCHECK: DW_AT_signature [DW_FORM_ref_sig8] (0x675d23e4f33235f2)
19 # POSTCHECK: version = 0x0005
20 # POSTCHECK: DW_TAG_compile_unit
21 # POSTCHECK: DW_TAG_subprogram
22 # POSTCHECK: DW_AT_type [DW_FORM_ref4] (cu + 0x0034 => {0x000000db} "int")
23 # POSTCHECK: DW_TAG_base_type
25 # POSTCHECKTU: version = 0x0004
26 # POSTCHECKTU: DW_TAG_type_unit [1]
27 # POSTCHECKTU: DW_TAG_structure_type [2]
28 # POSTCHECKTU: DW_TAG_member [3]
29 # POSTCHECKTU: DW_TAG_member [3]
30 # POSTCHECKTU: DW_AT_type [DW_FORM_ref4] (cu + 0x004c => {0x0000004c} "char *")
31 # POSTCHECKTU: DW_TAG_pointer_type [4]
32 # POSTCHECKTU-NEXT: DW_AT_type [DW_FORM_ref4] (cu + 0x0051 => {0x00000051} "char")
33 # POSTCHECKTU: DW_TAG_base_type [5]
34 # POSTCHECKTU: version = 0x0004
35 # POSTCHECKTU: DW_TAG_type_unit [1]
36 # POSTCHECKTU: DW_TAG_structure_type [2]
37 # POSTCHECKTU: DW_TAG_member [3]
38 # POSTCHECKTU: DW_AT_type [DW_FORM_ref4] (cu + 0x0040 => {0x00000099} "char *")
39 # POSTCHECKTU: DW_TAG_pointer_type [4]
40 # POSTCHECKTU-NEXT: DW_AT_type [DW_FORM_ref4] (cu + 0x0045 => {0x0000009e} "char")