4 ; RUN: llvm-mc -dwarf-version=5 -filetype=obj -triple x86_64-unknown-linux %p/Inputs/dwarf5-df-mono-main.s \
5 ; RUN: -split-dwarf-file=main.dwo -o main.o
6 ; RUN: llvm-mc -filetype=obj -triple x86_64-unknown-linux-gnu %p/Inputs/dwarf5-df-mono-helper.s -o=helper.o
7 ; RUN: %clang %cflags -gdwarf-5 main.o helper.o -o main.exe
8 ; RUN: llvm-bolt main.exe -o main.exe.bolt --update-debug-sections --always-convert-to-ranges
9 ; RUN: llvm-dwarfdump --show-form --verbose --debug-info main.exe | FileCheck -check-prefix=PRE-BOLT %s
10 ; RUN: llvm-dwarfdump --show-form --verbose --debug-addr main.exe.bolt &> %t/foo.txt
11 ; RUN: llvm-dwarfdump --show-form --verbose --debug-info main.exe.bolt >> %t/foo.txt
12 ; RUN: cat %t/foo.txt | FileCheck -check-prefix=BOLT %s
13 ; RUN: llvm-dwarfdump --show-form --verbose --debug-info main.dwo | FileCheck -check-prefix=PRE-BOLT-DWO-MAIN %s
14 ; RUN: llvm-dwarfdump --show-form --verbose --debug-info main.dwo.dwo | FileCheck -check-prefix=BOLT-DWO-MAIN %s
16 ; Testing dwarf5 mix of split dwarf and monolithic CUs.
18 ; PRE-BOLT: version = 0x0005
19 ; PRE-BOLT: DW_TAG_skeleton_unit
20 ; PRE-BOLT: DW_AT_low_pc [DW_FORM_addrx]
21 ; PRE-BOLT-NEXT: DW_AT_high_pc [DW_FORM_data4]
22 ; PRE-BOLT: DW_AT_addr_base [DW_FORM_sec_offset] (0x00000008)
23 ; PRE-BOLT: version = 0x0005
24 ; PRE-BOLT: DW_TAG_compile_unit
25 ; PRE-BOLT: DW_AT_low_pc [DW_FORM_addrx] (indexed (00000002)
26 ; PRE-BOLT-NEXT: DW_AT_high_pc [DW_FORM_data4] (0x0000003d)
27 ; PRE-BOLT-NEXT: DW_AT_addr_base [DW_FORM_sec_offset] (0x00000030)
32 ; BOLT-NEXT: 0x[[#%.16x,ADDR:]]
33 ; BOLT-NEXT: 0x[[#%.16x,ADDR2:]]
35 ; BOLT-NEXT: 0x[[#%.16x,ADDR3:]]
36 ; BOLT: DW_TAG_skeleton_unit
37 ; BOLT: DW_AT_dwo_name [DW_FORM_strx1] (indexed (00000001) string = "main.dwo.dwo")
38 ; BOLT-NEXT: DW_AT_low_pc [DW_FORM_addrx] (indexed (00000004) address = 0x0000000000000000)
39 ; BOLT-NEXT: DW_AT_ranges [DW_FORM_rnglistx] (indexed (0x0) rangelist = 0x00000010
40 ; BOLT-NEXT: [0x[[#ADDR]]
41 ; BOLT-SAME: 0x[[#ADDR + 0x24]]
42 ; BOLT-NEXT: [0x[[#ADDR2]]
43 ; BOLT-SAME: 0x[[#ADDR2 + 0x59]]
44 ; BOLT-NEXT: DW_AT_addr_base [DW_FORM_sec_offset] (0x00000008)
45 ; BOLT-NEXT: DW_AT_rnglists_base [DW_FORM_sec_offset] (0x0000000c)
46 ; BOLT: DW_TAG_compile_unit
47 ; BOLT: DW_AT_name [DW_FORM_strx1] (indexed (00000001) string = "helper.cpp")
48 ; BOLT: DW_AT_low_pc [DW_FORM_addrx] (indexed (00000001) address = 0x0000000000000000)
49 ; BOLT-NEXT: DW_AT_ranges [DW_FORM_rnglistx] (indexed (0x0) rangelist = 0x0000002e
50 ; BOLT-NEXT: [0x[[#ADDR3]]
51 ; BOLT-SAME: 0x[[#ADDR3 + 0x3D]]
52 ; BOLT-NEXT: DW_AT_addr_base [DW_FORM_sec_offset] (0x00000038)
53 ; BOLT-NEXT: DW_AT_rnglists_base [DW_FORM_sec_offset] (0x00000026)
54 ; BOLT: DW_TAG_variable
55 ; BOLT-NEXT: DW_AT_name [DW_FORM_strx1] (indexed (00000003) string = "z")
56 ; BOLT-NEXT: DW_AT_type
57 ; BOLT-NEXT: DW_AT_external
58 ; BOLT-NEXT: DW_AT_decl_file
59 ; BOLT-NEXT: DW_AT_decl_line
60 ; BOLT-NEXT: DW_AT_location [DW_FORM_exprloc] (DW_OP_addrx 0x2)
61 ; BOLT: DW_TAG_variable
62 ; BOLT-NEXT: DW_AT_name [DW_FORM_strx1] (indexed (00000005) string = "d")
63 ; BOLT-NEXT: DW_AT_type
64 ; BOLT-NEXT: DW_AT_external
65 ; BOLT-NEXT: DW_AT_decl_file
66 ; BOLT-NEXT: DW_AT_decl_line
67 ; BOLT-NEXT: DW_AT_location [DW_FORM_exprloc] (DW_OP_addrx 0x3)
68 ; BOLT: DW_TAG_subprogram
69 ; BOLT-NEXT: DW_AT_ranges [DW_FORM_rnglistx] (indexed (0x1) rangelist = 0x00000032
70 ; BOLT-NEXT: [0x[[#ADDR3]]
71 ; BOLT-SAME: 0x[[#ADDR3 + 0x3D]]
73 ; PRE-BOLT-DWO-MAIN: version = 0x0005
74 ; PRE-BOLT-DWO-MAIN: DW_TAG_compile_unit
75 ; PRE-BOLT-DWO-MAIN: DW_TAG_variable [2]
76 ; PRE-BOLT-DWO-MAIN-NEXT: DW_AT_name [DW_FORM_strx1] (indexed (00000000) string = "x")
77 ; PRE-BOLT-DWO-MAIN-NEXT: DW_AT_type
78 ; PRE-BOLT-DWO-MAIN-NEXT: DW_AT_external
79 ; PRE-BOLT-DWO-MAIN-NEXT: DW_AT_decl_file
80 ; PRE-BOLT-DWO-MAIN-NEXT: DW_AT_decl_line
81 ; PRE-BOLT-DWO-MAIN-NEXT: DW_AT_location [DW_FORM_exprloc] (DW_OP_addrx 0x0)
82 ; PRE-BOLT-DWO-MAIN: DW_TAG_variable [2]
83 ; PRE-BOLT-DWO-MAIN-NEXT: DW_AT_name [DW_FORM_strx1] (indexed (00000002) string = "y")
84 ; PRE-BOLT-DWO-MAIN-NEXT: DW_AT_type
85 ; PRE-BOLT-DWO-MAIN-NEXT: DW_AT_external
86 ; PRE-BOLT-DWO-MAIN-NEXT: DW_AT_decl_file
87 ; PRE-BOLT-DWO-MAIN-NEXT: DW_AT_decl_line
88 ; PRE-BOLT-DWO-MAIN-NEXT: DW_AT_location [DW_FORM_exprloc] (DW_OP_addrx 0x1)
89 ; PRE-BOLT-DWO-MAIN: DW_TAG_subprogram
90 ; PRE-BOLT-DWO-MAIN-NEXT: DW_AT_low_pc [DW_FORM_addrx] (indexed (00000002)
91 ; PRE-BOLT-DWO-MAIN-NEXT: DW_AT_high_pc [DW_FORM_data4] (0x00000024)
92 ; PRE-BOLT-DWO-MAIN-NEXT: DW_AT_frame_base
93 ; PRE-BOLT-DWO-MAIN-NEXT: DW_AT_linkage_name [DW_FORM_strx1] (indexed (00000003) string = "_Z3usePiS_")
94 ; PRE-BOLT-DWO-MAIN-NEXT: DW_AT_name [DW_FORM_strx1] (indexed (00000004) string = "use")
95 ; PRE-BOLT-DWO-MAIN: DW_TAG_subprogram
96 ; PRE-BOLT-DWO-MAIN-NEXT: DW_AT_low_pc [DW_FORM_addrx] (indexed (00000003)
97 ; PRE-BOLT-DWO-MAIN-NEXT: DW_AT_high_pc [DW_FORM_data4] (0x0000005f)
98 ; PRE-BOLT-DWO-MAIN-NEXT: DW_AT_frame_base
99 ; PRE-BOLT-DWO-MAIN-NEXT: DW_AT_name [DW_FORM_strx1] (indexed (00000005) string = "main")
101 ; BOLT-DWO-MAIN: DW_TAG_compile_unit
102 ; BOLT-DWO-MAIN: DW_TAG_variable [2]
103 ; BOLT-DWO-MAIN-NEXT: DW_AT_name [DW_FORM_strx1] (indexed (00000000) string = "x")
104 ; BOLT-DWO-MAIN-NEXT: DW_AT_type
105 ; BOLT-DWO-MAIN-NEXT: DW_AT_external
106 ; BOLT-DWO-MAIN-NEXT: DW_AT_decl_file
107 ; BOLT-DWO-MAIN-NEXT: DW_AT_decl_line
108 ; BOLT-DWO-MAIN-NEXT: DW_AT_location [DW_FORM_exprloc] (DW_OP_addrx 0x0)
109 ; BOLT-DWO-MAIN: DW_TAG_variable [2]
110 ; BOLT-DWO-MAIN-NEXT: DW_AT_name [DW_FORM_strx1] (indexed (00000002) string = "y")
111 ; BOLT-DWO-MAIN-NEXT: DW_AT_type
112 ; BOLT-DWO-MAIN-NEXT: DW_AT_external
113 ; BOLT-DWO-MAIN-NEXT: DW_AT_decl_file
114 ; BOLT-DWO-MAIN-NEXT: DW_AT_decl_line
115 ; BOLT-DWO-MAIN-NEXT: DW_AT_location [DW_FORM_exprloc] (DW_OP_addrx 0x1)
116 ; BOLT-DWO-MAIN: DW_TAG_subprogram [4]
117 ; BOLT-DWO-MAIN-NEXT: DW_AT_ranges [DW_FORM_rnglistx] (indexed (0x0) rangelist = 0x00000014
118 ; BOLT-DWO-MAIN-NEXT: [0x0000000000000000, 0x0000000000000024))
119 ; BOLT-DWO-MAIN-NEXT: DW_AT_frame_base
120 ; BOLT-DWO-MAIN-NEXT: DW_AT_linkage_name [DW_FORM_strx1] (indexed (00000003) string = "_Z3usePiS_")
121 ; BOLT-DWO-MAIN-NEXT: DW_AT_name [DW_FORM_strx1] (indexed (00000004) string = "use")
122 ; BOLT-DWO-MAIN: DW_TAG_subprogram [6]
123 ; BOLT-DWO-MAIN-NEXT: DW_AT_ranges [DW_FORM_rnglistx] (indexed (0x1) rangelist = 0x00000018
124 ; BOLT-DWO-MAIN-NEXT: [0x0000000000000000, 0x0000000000000059))
125 ; BOLT-DWO-MAIN-NEXT: DW_AT_frame_base [DW_FORM_exprloc] (DW_OP_reg6 RBP)
126 ; BOLT-DWO-MAIN-NEXT: DW_AT_name [DW_FORM_strx1] (indexed (00000005) string = "main")