|
| 1 | +## This test checks updating debuginfo via dwarf4 dwp file |
1 | 2 | # RUN: rm -rf %t && mkdir -p %t && cd %t |
2 | 3 | # RUN: split-file %s %t |
3 | | -# RUN: %clangxx -g -gdwarf-4 -gsplit-dwarf %t/main.s %t/callee.s -o main.exe |
| 4 | +# RUN: %clangxx %cxxflags -g -gdwarf-4 -gsplit-dwarf %t/main.s %t/callee.s -o main.exe |
4 | 5 | # RUN: llvm-dwp -e %t/main.exe -o %t/main.exe.dwp |
5 | 6 | # RUN: llvm-bolt %t/main.exe -o %t/main.exe.bolt -update-debug-sections 2>&1 | FileCheck %s |
6 | 7 |
|
7 | 8 | # CHECK-NOT: Assertion |
8 | 9 |
|
9 | | -#--- main.cpp |
10 | | -int callee(int x); |
11 | | -int main() { return callee(0); } |
12 | | -#--- callee.cpp |
13 | | -int callee(int x) { return x; } |
14 | | -#--- gen |
15 | | -clang++ -c -g -gdwarf-4 -gsplit-dwarf -fdebug-compilation-dir=. -Xclang -split-dwarf-file -Xclang main.exe-main.dwo -S main.cpp -o - |
16 | | -echo '#--- callee.s' |
17 | | -clang++ -c -g -gdwarf-4 -gsplit-dwarf -fdebug-compilation-dir=. -Xclang -split-dwarf-file -Xclang main.exe-callee.dwo -S callee.cpp -o - |
18 | 10 | #--- main.s |
19 | 11 | .file "main.cpp" |
20 | | - .text |
21 | 12 | .globl main # -- Begin function main |
22 | | - .p2align 4 |
23 | 13 | .type main,@function |
24 | 14 | main: # @main |
25 | 15 | .Lfunc_begin0: |
26 | 16 | .file 1 "." "main.cpp" |
27 | 17 | .loc 1 2 0 # main.cpp:2:0 |
28 | | - .cfi_startproc |
29 | | -# %bb.0: # %entry |
30 | | - pushq %rbp |
31 | | - .cfi_def_cfa_offset 16 |
32 | | - .cfi_offset %rbp, -16 |
33 | | - movq %rsp, %rbp |
34 | | - .cfi_def_cfa_register %rbp |
35 | | - subq $16, %rsp |
36 | | - movl $0, -4(%rbp) |
37 | | -.Ltmp0: |
38 | 18 | .loc 1 2 21 prologue_end # main.cpp:2:21 |
39 | | - xorl %edi, %edi |
40 | | - callq _Z6calleei@PLT |
41 | 19 | .loc 1 2 14 epilogue_begin is_stmt 0 # main.cpp:2:14 |
42 | | - addq $16, %rsp |
43 | | - popq %rbp |
44 | | - .cfi_def_cfa %rsp, 8 |
45 | 20 | retq |
46 | | -.Ltmp1: |
47 | 21 | .Lfunc_end0: |
48 | 22 | .size main, .Lfunc_end0-main |
49 | | - .cfi_endproc |
50 | | - # -- End function |
51 | 23 | .section .debug_abbrev,"",@progbits |
52 | 24 | .byte 1 # Abbreviation Code |
53 | 25 | .byte 17 # DW_TAG_compile_unit |
@@ -219,34 +191,17 @@ main: # @main |
219 | 191 | .Lline_table_start0: |
220 | 192 | #--- callee.s |
221 | 193 | .file "callee.cpp" |
222 | | - .text |
223 | 194 | .globl _Z6calleei # -- Begin function _Z6calleei |
224 | | - .p2align 4 |
225 | 195 | .type _Z6calleei,@function |
226 | 196 | _Z6calleei: # @_Z6calleei |
227 | 197 | .Lfunc_begin0: |
228 | 198 | .file 1 "." "callee.cpp" |
229 | 199 | .loc 1 1 0 # callee.cpp:1:0 |
230 | | - .cfi_startproc |
231 | | -# %bb.0: # %entry |
232 | | - pushq %rbp |
233 | | - .cfi_def_cfa_offset 16 |
234 | | - .cfi_offset %rbp, -16 |
235 | | - movq %rsp, %rbp |
236 | | - .cfi_def_cfa_register %rbp |
237 | | - movl %edi, -4(%rbp) |
238 | | -.Ltmp0: |
239 | 200 | .loc 1 1 28 prologue_end # callee.cpp:1:28 |
240 | | - movl -4(%rbp), %eax |
241 | 201 | .loc 1 1 21 epilogue_begin is_stmt 0 # callee.cpp:1:21 |
242 | | - popq %rbp |
243 | | - .cfi_def_cfa %rsp, 8 |
244 | 202 | retq |
245 | | -.Ltmp1: |
246 | 203 | .Lfunc_end0: |
247 | 204 | .size _Z6calleei, .Lfunc_end0-_Z6calleei |
248 | | - .cfi_endproc |
249 | | - # -- End function |
250 | 205 | .section .debug_abbrev,"",@progbits |
251 | 206 | .byte 1 # Abbreviation Code |
252 | 207 | .byte 17 # DW_TAG_compile_unit |
|
0 commit comments