114 lines · plain
1# REQUIRES: system-linux2 3## Check that BOLT updates DW_AT_stmt_list correctly for TUs when both objects are built with DWARF5.4 5# RUN: llvm-mc -dwarf-version=5 -filetype=obj -triple x86_64-unknown-linux %p/Inputs/dwarf5-debug-line-offset-change-after-bolt-main.s -o %tmain.o6# RUN: llvm-mc -dwarf-version=5 -filetype=obj -triple x86_64-unknown-linux %p/Inputs/dwarf4-types-dwarf5-types-helper.s -o %thelper.o7# RUN: %clang %cflags %tmain.o %thelper.o -o %t.exe -Wl,-q8# RUN: llvm-bolt %t.exe -o %t.bolt --update-debug-sections --lite=0 --reorder-blocks=reverse9# RUN: llvm-dwarfdump --debug-info -r 0 %t.exe > %tlogOffsetNotEqual.txt10# RUN: llvm-dwarfdump --debug-info -r 0 %t.bolt >> %tlogOffsetNotEqual.txt11# RUN: llvm-dwarfdump --debug-info -r 0 --debug-line %t.bolt > %tlogCheckLineTable.txt12# RUN: cat %tlogOffsetNotEqual.txt | FileCheck --check-prefix=CHECK1 %s13# RUN: cat %tlogCheckLineTable.txt | FileCheck --check-prefix=CHECK2 %s14 15## Check offset gets modified.16# CHECK1: DW_TAG_compile_unit17# CHECK1: DW_AT_stmt_list18# CHECK1: DW_TAG_type_unit19# CHECK1: DW_AT_stmt_list ([[OFFSET:0x[0-9a-f]*]])20# CHECK1: DW_TAG_type_unit21# CHECK1: DW_AT_stmt_list ([[OFFSET]])22# CHECK1: DW_TAG_compile_unit23# CHECK1: DW_AT_stmt_list ([[OFFSET]])24# CHECK1: DW_TAG_type_unit25# CHECK1-NOT: DW_AT_stmt_list ([[OFFSET]])26# CHECK1: DW_TAG_type_unit27# CHECK1-NOT: DW_AT_stmt_list ([[OFFSET]])28# CHECK1: DW_TAG_compile_unit29# CHECK1: DW_TAG_compile_unit30# CHECK1-NOT: DW_AT_stmt_list ([[OFFSET]])31 32## Check that offset is correct.33# CHECK2: DW_TAG_type_unit34# CHECK2: DW_AT_stmt_list ([[OFFSET1:0x[0-9a-f]*]])35# CHECK2: DW_TAG_type_unit36# CHECK2: DW_AT_stmt_list ([[OFFSET1]])37# CHECK2: DW_TAG_compile_unit38# CHECK2: DW_AT_stmt_list39# CHECK2: DW_TAG_compile_unit40# CHECK2: DW_AT_stmt_list ([[OFFSET1]])41# CHECK2: debug_line42# CHECK2: debug_line[[[OFFSET1]]]43# CHECK2-NOT: debug_line44 45## Check that BOLT updates DW_AT_stmt_list correctly for TUs when both objects are built with DWARF4.46 47# RUN: llvm-mc -dwarf-version=4 -filetype=obj -triple x86_64-unknown-linux %p/Inputs/dwarf4-debug-line-offset-change-after-bolt-main.s -o %tmain.o48# RUN: llvm-mc -dwarf-version=4 -filetype=obj -triple x86_64-unknown-linux %p/Inputs/dwarf4-debug-line-offset-change-after-bolt-helper.s -o %thelper.o49# RUN: %clang %cflags %tmain.o %thelper.o -o %t.exe -Wl,-q50# RUN: llvm-bolt %t.exe -o %t.bolt --update-debug-sections --lite=0 --reorder-blocks=reverse51# RUN: llvm-dwarfdump --debug-info --debug-types -r 0 %t.exe > %tlogOffsetNotEqual.txt52# RUN: llvm-dwarfdump --debug-info --debug-types -r 0 %t.bolt >> %tlogOffsetNotEqual.txt53# RUN: llvm-dwarfdump --debug-info --debug-types -r 0 --debug-line %t.bolt > %tlogCheckLineTable.txt54# RUN: cat %tlogOffsetNotEqual.txt | FileCheck --check-prefix=CHECK3 %s55# RUN: cat %tlogCheckLineTable.txt | FileCheck --check-prefix=CHECK4 %s56## Check offset gets modified.57# CHECK3: DW_TAG_compile_unit58# CHECK3: DW_TAG_compile_unit59# CHECK3: DW_AT_stmt_list ([[OFFSET2:0x[0-9a-f]*]])60# CHECK3: DW_TAG_type_unit61# CHECK3: DW_AT_stmt_list ([[OFFSET2]])62# CHECK3: DW_TAG_compile_unit63# CHECK3-NOT: DW_AT_stmt_list ([[OFFSET2]])64# CHECK3: DW_TAG_type_unit65# CHECK3-NOT: DW_AT_stmt_list ([[OFFSET2]])66 67## Check that offset is correct.68# CHECK4: DW_TAG_compile_unit69# CHECK4: DW_TAG_compile_unit70# CHECK4: DW_TAG_type_unit71# CHECK4: DW_AT_stmt_list ([[OFFSET3:0x[0-9a-f]*]])72# CHECK4: debug_line73# CHECK4: debug_line[[[OFFSET3]]]74# CHECK4-NOT: debug_line75 76## Check that BOLT updates DW_AT_stmt_list correctly for TUs when objects are built with DWARF4/DWARF5.77 78# RUN: llvm-mc -dwarf-version=4 -filetype=obj -triple x86_64-unknown-linux %p/Inputs/dwarf4-debug-line-offset-change-after-bolt-main.s -o %tmain.o79# RUN: llvm-mc -dwarf-version=5 -filetype=obj -triple x86_64-unknown-linux %p/Inputs/dwarf4-types-dwarf5-types-helper.s -o %thelper.o80# RUN: %clang %cflags %tmain.o %thelper.o -o %t.exe -Wl,-q81# RUN: llvm-bolt %t.exe -o %t.bolt --update-debug-sections --lite=0 --reorder-blocks=reverse82# RUN: llvm-dwarfdump --debug-info --debug-types -r 0 %t.exe > %tlogOffsetNotEqual.txt83# RUN: llvm-dwarfdump --debug-info --debug-types -r 0 %t.bolt >> %tlogOffsetNotEqual.txt84# RUN: llvm-dwarfdump --debug-info --debug-types -r 0 --debug-line %t.bolt > %tlogCheckLineTable.txt85# RUN: cat %tlogOffsetNotEqual.txt | FileCheck --check-prefix=CHECK5 %s86# RUN: cat %tlogCheckLineTable.txt | FileCheck --check-prefix=CHECK6 %s87 88## Check offset gets modified.89# CHECK5: DW_TAG_compile_unit90# CHECK5: DW_TAG_type_unit91# CHECK5: DW_AT_stmt_list ([[OFFSET4:0x[0-9a-f]*]])92# CHECK5: DW_TAG_type_unit93# CHECK5: DW_AT_stmt_list ([[OFFSET4]])94# CHECK5: DW_TAG_compile_unit95# CHECK5: DW_AT_stmt_list ([[OFFSET4]])96# CHECK5: DW_TAG_type_unit97# CHECK5-NOT: DW_AT_stmt_list ([[OFFSET4]])98# CHECK5: DW_TAG_type_unit99# CHECK5-NOT: DW_AT_stmt_list ([[OFFSET4]])100# CHECK5: DW_TAG_compile_unit101# CHECK5: DW_TAG_compile_unit102# CHECK5-NOT: DW_AT_stmt_list ([[OFFSET4]])103 104# CHECK6: DW_TAG_type_unit105# CHECK6: DW_AT_stmt_list ([[OFFSET5:0x[0-9a-f]*]])106# CHECK6: DW_TAG_type_unit107# CHECK6: DW_AT_stmt_list ([[OFFSET5]])108# CHECK6: DW_TAG_compile_unit109# CHECK6: DW_TAG_compile_unit110# CHECK6: DW_AT_stmt_list ([[OFFSET5]])111# CHECK6: debug_line112# CHECK6: debug_line[[[OFFSET5]]]113# CHECK6-NOT: debug_line114