[llvm-shlib] Fix the version naming style of libLLVM for Windows (#85710)
[llvm-project.git] / bolt / test / X86 / dwarf5-two-loclists.test
blobf5c399a944a9114fe065b520994ab0356dbffa03
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 %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_loclists is handled correctly for two CUs,
13 # and two loclist entries.
15 # PRECHECK: version = 0x0005
16 # PRECHECK: DW_AT_loclists_base [DW_FORM_sec_offset] (0x0000000c)
17 # PRECHECK-EMPTY:
18 # PRECHECK: DW_TAG_variable
19 # PRECHECK: DW_AT_location [DW_FORM_loclistx]
20 # PRECHECK-SAME: indexed (0x0)
21 # PRECHECK-SAME: loclist = 0x00000014
22 # PRECHECK: DW_AT_location [DW_FORM_loclistx]
23 # PRECHECK-SAME: indexed (0x1)
24 # PRECHECK-SAME: loclist = 0x00000028
25 # PRECHECK: DW_AT_loclists_base [DW_FORM_sec_offset]  (0x00000043)
26 # PRECHECK-EMPTY:
27 # PRECHECK: DW_TAG_variable
28 # PRECHECK: DW_TAG_variable
29 # PRECHECK: DW_AT_location [DW_FORM_loclistx]
30 # PRECHECK-SAME: indexed (0x0)
31 # PRECHECK-SAME: loclist = 0x00000047
33 # POSTCHECK: Addrs: [
34 # POSTCHECK-NEXT: 0x
35 # POSTCHECK-NEXT: 0x
36 # POSTCHECK-NEXT: 0x[[#%.16x,ADDR:]]
37 # POSTCHECK-NEXT: 0x[[#%.16x,ADDR2:]]
38 # For second CU.
39 # POSTCHECK: Addrs: [
40 # POSTCHECK-NEXT: 0x
41 # POSTCHECK-NEXT: 0x
42 # POSTCHECK-NEXT: 0x
43 # POSTCHECK-NEXT: 0x[[#%.16x,ADDR3:]]
45 # POSTCHECK: version = 0x0005
46 # POSTCHECK: DW_AT_loclists_base [DW_FORM_sec_offset]   (0x0000000c)
47 # POSTCHECK: DW_AT_rnglists_base [DW_FORM_sec_offset]   (0x0000000c)
48 # POSTCHECK-EMPTY
49 # POSTCHECK: DW_TAG_variable
50 # POSTCHECK: DW_AT_location [DW_FORM_loclistx]
51 # POSTCHECK-SAME: indexed (0x0)
52 # POSTCHECK-SAME: loclist = 0x00000014
53 # POSTCHECK-NEXT: [0x[[#ADDR]]
54 # POSTCHECK-SAME: 0x[[#ADDR + 0x6]]
55 # POSTCHECK-NEXT: [0x[[#ADDR + 0x6]]
56 # POSTCHECK-SAME: 0x[[#ADDR + 0xc]]
57 # POSTCHECK: DW_TAG_variable
58 # POSTCHECK: DW_AT_location [DW_FORM_loclistx]
59 # POSTCHECK-SAME: indexed (0x1)
60 # POSTCHECK-SAME: loclist = 0x0000002a
61 # POSTCHECK-NEXT: [0x[[#ADDR2]]
62 # POSTCHECK-SAME: 0x[[#ADDR2 + 0x2]]
64 # Checking second CU
65 # POSTCHECK: version = 0x0005
66 # POSTCHECK: DW_AT_loclists_base [DW_FORM_sec_offset]   (0x00000045)
67 # POSTCHECK: DW_AT_rnglists_base [DW_FORM_sec_offset]   (0x00000025)
68 # POSTCHECK-EMPTY:
69 # POSTCHECK: DW_TAG_variable
70 # POSTCHECK: DW_TAG_variable
71 # POSTCHECK: DW_AT_location [DW_FORM_loclistx]
72 # POSTCHECK-SAME: indexed (0x0)
73 # POSTCHECK-SAME: loclist = 0x00000049
74 # POSTCHECK-NEXT: [0x[[#ADDR3]]
75 # POSTCHECK-SAME: 0x[[#ADDR3 + 0x3]]
76 # POSTCHECK-NEXT: [0x[[#ADDR3 + 0x3]]
77 # POSTCHECK-SAME: 0x[[#ADDR3  + 0x4]]