[llvm-shlib] Fix the version naming style of libLLVM for Windows (#85710)
[llvm-project.git] / bolt / test / X86 / debug-fission-single-convert.s
blob82db6700079f9f634f46ead9b312dffc05858cb1
1 # Checks debug fission support in BOLT
3 # REQUIRES: system-linux
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.o
11 # 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.exe
17 # RUN: llvm-bolt %t.exe \
18 # RUN: --reorder-blocks=reverse \
19 # RUN: --update-debug-sections \
20 # RUN: --dwarf-output-path=%T \
21 # RUN: --always-convert-to-ranges=true \
22 # RUN: -o %t.bolt.1.exe 2>&1 | FileCheck %s
23 # RUN: llvm-dwarfdump --show-form --verbose --debug-ranges %t.bolt.1.exe &> %tAddrIndexTest
24 # RUN: not llvm-dwarfdump --show-form --verbose --debug-info %T/debug-fission-simple-convert.dwo0.dwo >> %tAddrIndexTest
25 # RUN: cat %tAddrIndexTest | FileCheck %s --check-prefix=CHECK-DWO-DWO
26 # RUN: llvm-dwarfdump --show-form --verbose --debug-addr %t.bolt.1.exe | FileCheck %s --check-prefix=CHECK-ADDR-SEC
28 # CHECK-NOT: warning: DWARF unit from offset {{.*}} incl. to offset {{.*}} excl. tries to read DIEs at offset {{.*}}
30 # CHECK-DWO-DWO: 00000010
31 # CHECK-DWO-DWO: 00000010
32 # CHECK-DWO-DWO: 00000050
33 # CHECK-DWO-DWO: DW_TAG_subprogram
34 # CHECK-DWO-DWO-NEXT: DW_AT_ranges [DW_FORM_sec_offset] (0x00000000
35 # CHECK-DWO-DWO: DW_TAG_subprogram
36 # CHECK-DWO-DWO-NEXT: DW_AT_ranges [DW_FORM_sec_offset] (0x00000020
37 # CHECK-DWO-DWO: DW_TAG_subprogram
38 # CHECK-DWO-DWO-NEXT: DW_AT_ranges [DW_FORM_sec_offset] (0x00000040
40 # CHECK-ADDR-SEC: .debug_addr contents:
41 # CHECK-ADDR-SEC: 0x00000000: Addrs: [
42 # CHECK-ADDR-SEC: 0x0000000000601000
44 # RUN: llvm-bolt %t.exe --reorder-blocks=reverse --update-debug-sections --dwarf-output-path=%T -o %t.bolt.2.exe --write-dwp=true \
45 # RUN: --always-convert-to-ranges=true
46 # RUN: not llvm-dwarfdump --show-form --verbose --debug-info %t.bolt.2.exe.dwp &> %tAddrIndexTestDwp
47 # RUN: cat %tAddrIndexTestDwp | FileCheck %s --check-prefix=CHECK-DWP-DEBUG
49 # CHECK-DWP-DEBUG: DW_TAG_compile_unit [1] *
50 # CHECK-DWP-DEBUG: DW_AT_producer [DW_FORM_GNU_str_index] (indexed (0000000a) string = "clang version 13.0.0")
51 # CHECK-DWP-DEBUG: DW_AT_language [DW_FORM_data2] (DW_LANG_C_plus_plus)
52 # CHECK-DWP-DEBUG: DW_AT_name [DW_FORM_GNU_str_index] (indexed (0000000b) string = "foo")
53 # CHECK-DWP-DEBUG: DW_AT_GNU_dwo_name [DW_FORM_GNU_str_index] (indexed (0000000c) string = "foo")
54 # CHECK-DWP-DEBUG: DW_AT_GNU_dwo_id [DW_FORM_data8] (0x06105e732fad3796)
57 //clang++ -ffunction-sections -fno-exceptions -g -gsplit-dwarf=split -S debug-fission-simple.cpp -o debug-fission-simple.s
58 static int foo = 2;
59 int doStuff(int val) {
60 if (val == 5)
61 val += 1 + foo;
62 else
63 val -= 1;
64 return val;
67 int doStuff2(int val) {
68 return val += 3;
71 int main(int argc, const char** argv) {
72 return doStuff(argc);