[llvm-shlib] Fix the version naming style of libLLVM for Windows (#85710)
[llvm-project.git] / bolt / test / X86 / debug-fission-single.s
blob0d25aaef274a08b83c1a8e657330f2d3988bd4f7
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.dwo \
9 # RUN: %p/Inputs/debug-fission-simple.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: -o %t.bolt.1.exe 2>&1 | FileCheck %s
22 # RUN: llvm-dwarfdump --show-form --verbose --debug-ranges %t.bolt.1.exe &> %tAddrIndexTest
23 # RUN: llvm-dwarfdump --show-form --verbose --debug-info %T/debug-fission-simple.dwo0.dwo >> %tAddrIndexTest
24 # RUN: cat %tAddrIndexTest | FileCheck %s --check-prefix=CHECK-DWO-DWO
25 # RUN: llvm-dwarfdump --show-form --verbose --debug-addr %t.bolt.1.exe | FileCheck %s --check-prefix=CHECK-ADDR-SEC
27 # CHECK-NOT: warning: DWARF unit from offset {{.*}} incl. to offset {{.*}} excl. tries to read DIEs at offset {{.*}}
29 # CHECK-DWO-DWO: 00000010
30 # CHECK-DWO-DWO: 00000010
31 # CHECK-DWO-DWO: DW_TAG_subprogram
32 # CHECK-DWO-DWO-NEXT: DW_AT_low_pc [DW_FORM_GNU_addr_index] (indexed (00000001)
33 # CHECK-DWO-DWO-NEXT: DW_AT_high_pc [DW_FORM_data4] (0x00000031)
34 # CHECK-DWO-DWO: DW_TAG_subprogram
35 # CHECK-DWO-DWO-NEXT: DW_AT_low_pc [DW_FORM_GNU_addr_index] (indexed (00000002)
36 # CHECK-DWO-DWO-NEXT: DW_AT_high_pc [DW_FORM_data4] (0x00000012)
37 # CHECK-DWO-DWO: DW_TAG_subprogram
38 # CHECK-DWO-DWO-NEXT: DW_AT_low_pc [DW_FORM_GNU_addr_index] (indexed (00000003)
39 # CHECK-DWO-DWO-NEXT: DW_AT_high_pc [DW_FORM_data4] (0x0000001d)
41 # CHECK-ADDR-SEC: .debug_addr contents:
42 # CHECK-ADDR-SEC: 0x00000000: Addrs: [
43 # CHECK-ADDR-SEC: 0x0000000000601000
45 # RUN: llvm-bolt %t.exe --reorder-blocks=reverse --update-debug-sections --dwarf-output-path=%T -o %t.bolt.2.exe --write-dwp=true
46 # RUN: 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);