65 lines · plain
1# REQUIRES: system-linux2 3# RUN: llvm-mc -dwarf-version=4 -filetype=obj -triple x86_64-unknown-linux %p/Inputs/dwarf4-types-main.s -o %tmain.o4# RUN: llvm-mc -dwarf-version=4 -filetype=obj -triple x86_64-unknown-linux %p/Inputs/dwarf4-types-helper.s -o %thelper.o5# RUN: %clang %cflags %tmain.o %thelper.o -o %t.exe -Wl,-q6# RUN: llvm-bolt %t.exe -o %t.bolt --update-debug-sections7# RUN: llvm-dwarfdump --show-form --verbose --debug-info %t.bolt | FileCheck --check-prefix=POSTCHECK %s8# RUN: llvm-dwarfdump --show-form --verbose --debug-types %t.bolt | FileCheck --check-prefix=POSTCHECKTU %s9 10## Check BOLT handles DWARF4/5 with fdebug-types.11 12# POSTCHECK: version = 0x000413# POSTCHECK: DW_TAG_compile_unit [6]14# POSTCHECK: DW_TAG_subprogram [7]15# POSTCHECK: DW_AT_type [DW_FORM_ref4] (cu + 0x007c => {0x0000007c} "int")16# POSTCHECK: DW_TAG_formal_parameter [8]17# POSTCHECK: DW_AT_type [DW_FORM_ref4] (cu + 0x007c => {0x0000007c} "int")18# POSTCHECK: DW_TAG_formal_parameter [8]19# POSTCHECK: DW_AT_type [DW_FORM_ref4] (cu + 0x0083 => {0x00000083} "char **")20# POSTCHECK: DW_TAG_variable [9]21# POSTCHECK: DW_AT_type [DW_FORM_ref4] (cu + 0x0094 => {0x00000094} "Foo")22# POSTCHECK: DW_TAG_base_type [5]23# POSTCHECK: DW_TAG_pointer_type [4]24 25# POSTCHECK: version = 0x000426# POSTCHECK: DW_TAG_compile_unit [6]27# POSTCHECK: DW_TAG_subprogram [11]28# POSTCHECK: DW_TAG_variable [9]29# POSTCHECK: DW_AT_type [DW_FORM_ref4] (cu + 0x006b => {0x00000112} "Foo2a")30# POSTCHECK: DW_TAG_variable [9]31# POSTCHECK: DW_AT_type [DW_FORM_ref4] (cu + 0x0074 => {0x0000011b} "Foo3")32# POSTCHECK: DW_TAG_base_type [5]33# POSTCHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x{{[0-9a-f]+}}] = "int")34# POSTCHECK: DW_TAG_structure_type [10]35# POSTCHECK: DW_AT_signature [DW_FORM_ref_sig8] (0x104ec427d2ebea6f)36# POSTCHECK: DW_TAG_structure_type [10]37# POSTCHECK: DW_AT_signature [DW_FORM_ref_sig8] (0xb4580bc1535df1e4)38 39# POSTCHECKTU: version = 0x000440# POSTCHECKTU-SAME: type_signature = 0x675d23e4f33235f241# POSTCHECKTU-SAME: type_offset = 0x001e42# POSTCHECKTU: DW_TAG_type_unit [1]43# POSTCHECKTU: DW_TAG_member [3]44# POSTCHECKTU: DW_AT_type [DW_FORM_ref4] (cu + 0x004c => {0x0000004c} "char *")45# POSTCHECKTU: DW_TAG_member [3]46# POSTCHECKTU: DW_AT_type [DW_FORM_ref4] (cu + 0x004c => {0x0000004c} "char *")47# POSTCHECKTU: DW_TAG_pointer_type [4]48# POSTCHECKTU-NEXT: DW_AT_type [DW_FORM_ref4] (cu + 0x0051 => {0x00000051} "char")49# POSTCHECKTU: DW_TAG_base_type [5]50# POSTCHECKTU: DW_AT_name [DW_FORM_strp] ( .debug_str[0x{{[0-9a-f]+}}] = "char")51 52# POSTCHECKTU: version = 0x000453# POSTCHECKTU-SAME: type_signature = 0x49dc260088be7e5654# POSTCHECKTU-SAME: type_offset = 0x001e55# POSTCHECKTU: DW_TAG_type_unit [1]56# POSTCHECKTU: DW_TAG_structure_type [2]57# POSTCHECKTU: DW_TAG_member [3]58# POSTCHECKTU: DW_AT_type [DW_FORM_ref4] (cu + 0x0040 => {0x00000099} "char *")59# POSTCHECKTU: DW_TAG_member [3]60# POSTCHECKTU: DW_AT_type [DW_FORM_ref4] (cu + 0x0040 => {0x00000099} "char *")61# POSTCHECKTU: DW_TAG_pointer_type [4]62# POSTCHECKTU-NEXT: DW_AT_type [DW_FORM_ref4] (cu + 0x0045 => {0x0000009e} "char")63# POSTCHECKTU: DW_TAG_base_type [5]64# POSTCHECKTU-NEXT: DW_AT_name [DW_FORM_strp] ( .debug_str[0x{{[0-9a-f]+}}] = "char")65