63 lines · plain
1## Checks debug fission support in BOLT2 3# REQUIRES: system-linux4 5# RUN: llvm-mc -g \6# RUN: --filetype=obj \7# RUN: --triple x86_64-unknown-unknown \8# RUN: --split-dwarf-file=debug-fission-simple.dwo \9# RUN: %p/Inputs/debug-fission-simple.s \10# RUN: -o %t.o11# RUN: %clangxx %cxxflags -no-pie -g \12# RUN: -Wl,--gc-sections,-q,-nostdlib \13# RUN: -Wl,--undefined=_Z6_startv \14# RUN: -nostartfiles \15# RUN: -Wl,--script=%p/Inputs/debug-fission-script.txt \16# RUN: %t.o -o %t.exe17# RUN: mkdir -p %t.dwarf-output18# RUN: llvm-bolt %t.exe \19# RUN: --reorder-blocks=reverse \20# RUN: --update-debug-sections \21# RUN: --dwarf-output-path=%t.dwarf-output \22# RUN: -o %t.bolt.1.exe 2>&1 | FileCheck %s23# RUN: llvm-dwarfdump --show-form --verbose --debug-ranges %t.bolt.1.exe &> %tAddrIndexTest24# RUN: llvm-dwarfdump --show-form --verbose --debug-info %t.dwarf-output/debug-fission-simple.dwo0.dwo >> %tAddrIndexTest25# RUN: cat %tAddrIndexTest | FileCheck %s --check-prefix=CHECK-DWO-DWO26# RUN: llvm-dwarfdump --show-form --verbose --debug-addr %t.bolt.1.exe | FileCheck %s --check-prefix=CHECK-ADDR-SEC27 28# CHECK-NOT: warning: DWARF unit from offset {{.*}} incl. to offset {{.*}} excl. tries to read DIEs at offset {{.*}}29 30# CHECK-DWO-DWO: 0000001031# CHECK-DWO-DWO: 0000001032# CHECK-DWO-DWO: DW_TAG_subprogram33# CHECK-DWO-DWO-NEXT: DW_AT_low_pc [DW_FORM_GNU_addr_index] (indexed (00000001)34# CHECK-DWO-DWO-NEXT: DW_AT_high_pc [DW_FORM_data4] (0x00000031)35# CHECK-DWO-DWO: DW_TAG_subprogram36# CHECK-DWO-DWO-NEXT: DW_AT_low_pc [DW_FORM_GNU_addr_index] (indexed (00000002)37# CHECK-DWO-DWO-NEXT: DW_AT_high_pc [DW_FORM_data4] (0x00000012)38# CHECK-DWO-DWO: DW_TAG_subprogram39# CHECK-DWO-DWO-NEXT: DW_AT_low_pc [DW_FORM_GNU_addr_index] (indexed (00000003)40# CHECK-DWO-DWO-NEXT: DW_AT_high_pc [DW_FORM_data4] (0x0000001d)41 42# CHECK-ADDR-SEC: .debug_addr contents:43# CHECK-ADDR-SEC: 0x00000000: Addrs: [44# CHECK-ADDR-SEC: 0x000000000060100045 46//clang++ -ffunction-sections -fno-exceptions -g -gsplit-dwarf=split -S debug-fission-simple.cpp -o debug-fission-simple.s47static int foo = 2;48int doStuff(int val) {49 if (val == 5)50 val += 1 + foo;51 else52 val -= 1;53 return val;54}55 56int doStuff2(int val) {57 return val += 3;58}59 60int main(int argc, const char** argv) {61 return doStuff(argc);62}63