brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.1 KiB · ea05ccd Raw
62 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-convert.dwo \9# RUN:   %p/Inputs/debug-fission-simple-convert.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:   --always-convert-to-ranges=true \23# RUN:   -o %t.bolt.1.exe 2>&1 | FileCheck %s24# RUN: llvm-dwarfdump --show-form --verbose --debug-ranges %t.bolt.1.exe &> %tAddrIndexTest25# RUN: not llvm-dwarfdump --show-form --verbose --debug-info %t.dwarf-output/debug-fission-simple-convert.dwo0.dwo >> %tAddrIndexTest26# RUN: cat %tAddrIndexTest | FileCheck %s --check-prefix=CHECK-DWO-DWO27# RUN: llvm-dwarfdump --show-form --verbose   --debug-addr  %t.bolt.1.exe | FileCheck %s --check-prefix=CHECK-ADDR-SEC28 29# CHECK-NOT: warning: DWARF unit from offset {{.*}} incl. to offset {{.*}} excl. tries to read DIEs at offset {{.*}}30 31# CHECK-DWO-DWO: 0000000032# CHECK-DWO-DWO: 0000001033# CHECK-DWO-DWO: 0000001034# CHECK-DWO-DWO: DW_TAG_subprogram35# CHECK-DWO-DWO-NEXT: DW_AT_ranges [DW_FORM_sec_offset] (0x0000000036# CHECK-DWO-DWO: DW_TAG_subprogram37# CHECK-DWO-DWO-NEXT: DW_AT_ranges [DW_FORM_sec_offset] (0x0000002038# CHECK-DWO-DWO: DW_TAG_subprogram39# CHECK-DWO-DWO-NEXT: DW_AT_ranges [DW_FORM_sec_offset] (0x0000004040 41# CHECK-ADDR-SEC: .debug_addr contents:42# CHECK-ADDR-SEC: 0x00000000: Addrs: [43# CHECK-ADDR-SEC: 0x000000000060100044 45//clang++ -ffunction-sections -fno-exceptions -g -gsplit-dwarf=split -S debug-fission-simple.cpp -o debug-fission-simple.s46static int foo = 2;47int doStuff(int val) {48  if (val == 5)49    val += 1 + foo;50  else51    val -= 1;52  return val;53}54 55int doStuff2(int val) {56  return val += 3;57}58 59int main(int argc, const char** argv) {60  return doStuff(argc);61}62