[llvm-shlib] Fix the version naming style of libLLVM for Windows (#85710)
[llvm-project.git] / bolt / test / X86 / dwarf5-two-rnglists.test
blob98330558a573b7e5cdf92f5d88fd9f70ca65e1e3
1 # REQUIRES: system-linux
3 # RUN: llvm-mc -dwarf-version=5 -filetype=obj -triple x86_64-unknown-linux %p/Inputs/dwarf5_main.s -o %tmain.o
4 # RUN: llvm-mc -dwarf-version=5 -filetype=obj -triple x86_64-unknown-linux %p/Inputs/dwarf5_helper.s -o %thelper.o
5 # RUN: %clang %cflags -dwarf-5 %tmain.o %thelper.o -o %t.exe -Wl,-q
6 # RUN: llvm-bolt --always-convert-to-ranges %t.exe -o %t.bolt --update-debug-sections
7 # RUN: llvm-dwarfdump --show-form --verbose --debug-info %t.exe | FileCheck --check-prefix=PRECHECK %s
8 # RUN: llvm-dwarfdump --show-form --verbose --debug-addr %t.bolt > %t.txt
9 # RUN: llvm-dwarfdump --show-form --verbose --debug-info %t.bolt >> %t.txt
10 # RUN: cat %t.txt | FileCheck --check-prefix=POSTCHECK %s
12 # This tests checks that re-writing of .debug_rnglists is handled correctly for two CUs,
13 # and DW_AT_low_pc/DW_AT_high_pc conversion is handled correctly.
15 # PRECHECK: version = 0x0005
16 # PRECHECK: DW_AT_low_pc [DW_FORM_addrx]
17 # PRECHECK: DW_AT_high_pc [DW_FORM_data4]
18 # PRECHECK: DW_AT_loclists_base [DW_FORM_sec_offset] (0x0000000c)
19 # PRECHECK-EMPTY:
20 # PRECHECK: version = 0x0005
21 # PRECHECK: DW_AT_low_pc [DW_FORM_addrx]
22 # PRECHECK: DW_AT_high_pc [DW_FORM_data4]
23 # PRECHECK: DW_AT_loclists_base [DW_FORM_sec_offset]  (0x00000043)
25 # PRECHECK: DW_TAG_inlined_subroutine
26 # PRECHECK-NEXT: DW_AT_abstract_origin
27 # PRECHECK-NEXT: DW_AT_low_pc [DW_FORM_addrx]
28 # PRECHECK-NEXT: DW_AT_high_pc [DW_FORM_data4] (0x00000003)
30 # POSTCHECK: Addrs: [
31 # POSTCHECK-NEXT: 0x[[#%.16x,ADDR:]]
32 # POSTCHECK-NEXT: 0x
33 # POSTCHECK-NEXT: 0x[[#%.16x,ADDR1:]]
34 # POSTCHECK-NEXT: 0x[[#%.16x,ADDR2:]]
35 # For second CU.
36 # POSTCHECK: Addrs: [
37 # POSTCHECK-NEXT: 0x[[#%.16x,ADDR3:]]
38 # POSTCHECK-NEXT: 0x
39 # POSTCHECK-NEXT: 0x
40 # POSTCHECK-NEXT: 0x[[#%.16x,ADDR4:]]
42 # POSTCHECK: version = 0x0005
43 # POSTCHECK: DW_AT_ranges [DW_FORM_rnglistx]
44 # POSTCHECK-SAME: (indexed (0x0)
45 # POSTCHECK-SAME: rangelist = 0x00000018
46 # POSTCHECK-NEXT: [
47 # POSTCHECK-SAME: 0x[[#ADDR]]
48 # POSTCHECK-SAME: 0x[[#ADDR + 7]]
49 # POSTCHECK-NEXT: [
50 # POSTCHECK-SAME: 0x[[#ADDR1]]
51 # POSTCHECK-SAME: 0x[[#ADDR1 + 12]]
52 # POSTCHECK-NEXT: DW_AT_addr_base [DW_FORM_sec_offset]  (0x00000008)
53 # POSTCHECK-NEXT: DW_AT_loclists_base [DW_FORM_sec_offset]      (0x0000000c)
54 # POSTCHECK-NEXT: DW_AT_rnglists_base [DW_FORM_sec_offset]      (0x0000000c)
55 # POSTCHECK-EMPTY
56 # POSTCHECK: DW_TAG_subprogram
57 # POSTCHECK-NEXT: DW_AT_ranges [DW_FORM_rnglistx]
58 # POSTCHECK-SAME: indexed (0x1)
59 # POSTCHECK-SAME: rangelist = 0x00000021
60 # POSTCHECK-NEXT: [0x[[#ADDR]], 0x[[#ADDR + 7]])
62 # POSTCHECK: DW_TAG_subprogram
63 # POSTCHECK-NEXT: DW_AT_ranges [DW_FORM_rnglistx]
64 # POSTCHECK-SAME: indexed (0x2)
65 # POSTCHECK-SAME: rangelist = 0x00000025
66 # POSTCHECK-NEXT: [0x[[#ADDR1]], 0x[[#ADDR1 + 12]])
68 # Checking second CU
69 # POSTCHECK: version = 0x0005
70 # POSTCHECK: DW_AT_ranges [DW_FORM_rnglistx]
71 # POSTCHECK-SAME: (indexed (0x0)
72 # POSTCHECK-SAME: rangelist = 0x00000045
73 # POSTCHECK-NEXT: [0x[[#ADDR3]], 0x[[#ADDR3 + 4]])
74 # POSTCHECK-NEXT: [0x[[#ADDR4]], 0x[[#ADDR4 + 4]])
75 # POSTCHECK-NEXT: DW_AT_addr_base [DW_FORM_sec_offset]  (0x00000030)
76 # POSTCHECK-NEXT: DW_AT_loclists_base [DW_FORM_sec_offset]      (0x00000045)
77 # POSTCHECK-NEXT: DW_AT_rnglists_base [DW_FORM_sec_offset]      (0x00000035)
78 # POSTCHECK-EMPTY
80 # POSTCHECK: DW_TAG_subprogram
81 # POSTCHECK-NEXT: DW_AT_ranges [DW_FORM_rnglistx]
82 # POSTCHECK-SAME: indexed (0x1)
83 # POSTCHECK-SAME: rangelist = 0x0000004e
84 # POSTCHECK-NEXT: [0x[[#ADDR3]], 0x[[#ADDR3 + 4]])
85 # POSTCHECK: DW_TAG_subprogram
86 # POSTCHECK: DW_TAG_subprogram
87 # POSTCHECK-NEXT: DW_AT_ranges [DW_FORM_rnglistx]
88 # POSTCHECK-SAME: indexed (0x2)
89 # POSTCHECK-SAME: rangelist = 0x00000052
90 # POSTCHECK-NEXT: [0x[[#ADDR4]], 0x[[#ADDR4 + 4]])
92 # POSTCHECK: DW_TAG_inlined_subroutine
93 # POSTCHECK-NEXT: DW_AT_abstract_origin
94 # POSTCHECK-NEXT: DW_AT_ranges [DW_FORM_rnglistx]
95 # POSTCHECK-SAME: indexed (0x3)
96 # POSTCHECK-SAME: rangelist = 0x00000056
97 # POSTCHECK-NEXT: [0x[[#ADDR4]], 0x[[#ADDR4 + 3]])