summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Yermolovich <43973793+ayermolo@users.noreply.github.com>2024-02-14 15:43:39 -0800
committerGitHub <noreply@github.com>2024-02-14 15:43:39 -0800
commit82ca75239340c6e2b92125fe39bf872faa044f11 (patch)
tree04566acf2219ac041b05d35c5c2dd1570201076c
parent7249692bd24afc81fbbaa24240e3c9bba046f854 (diff)
[BOLT][DWARF] Add test for DW_AT_ranges input without function output (#81794)
Added a test that relies on -fbasic-block-sections=all and --gc-sections that exercises a code path that previously printed a warning.
-rw-r--r--bolt/lib/Rewrite/DWARFRewriter.cpp9
-rw-r--r--bolt/test/X86/dwarf4-subprogram-single-gc-ranges.test6
-rw-r--r--bolt/test/X86/dwarf5-empty-function-ranges.s538
-rw-r--r--bolt/test/X86/dwarf5-subprogram-single-gc-ranges.test6
4 files changed, 544 insertions, 15 deletions
diff --git a/bolt/lib/Rewrite/DWARFRewriter.cpp b/bolt/lib/Rewrite/DWARFRewriter.cpp
index 27fa937c7508..592b2352fc9a 100644
--- a/bolt/lib/Rewrite/DWARFRewriter.cpp
+++ b/bolt/lib/Rewrite/DWARFRewriter.cpp
@@ -919,15 +919,10 @@ void DWARFRewriter::updateUnitDebugInfo(
DIEValue LowPCVal = Die->findAttribute(dwarf::DW_AT_low_pc);
DIEValue HighPCVal = Die->findAttribute(dwarf::DW_AT_high_pc);
if (FunctionRanges.empty()) {
- if (LowPCVal && HighPCVal) {
+ if (LowPCVal && HighPCVal)
FunctionRanges.push_back({0, HighPCVal.getDIEInteger().getValue()});
- } else {
- // I haven't seen this case, but who knows what other compilers
- // generate.
+ else
FunctionRanges.push_back({0, 1});
- errs() << "BOLT-WARNING: [internal-dwarf-error]: subprogram got GCed "
- "by the linker, DW_AT_ranges is used\n";
- }
}
if (FunctionRanges.size() == 1 && !opts::AlwaysConvertToRanges) {
diff --git a/bolt/test/X86/dwarf4-subprogram-single-gc-ranges.test b/bolt/test/X86/dwarf4-subprogram-single-gc-ranges.test
index 9080052a2991..3e7e765f98b1 100644
--- a/bolt/test/X86/dwarf4-subprogram-single-gc-ranges.test
+++ b/bolt/test/X86/dwarf4-subprogram-single-gc-ranges.test
@@ -2,14 +2,12 @@
# RUN: llvm-mc -dwarf-version=4 -filetype=obj -triple x86_64-unknown-linux %p/Inputs/dwarf4-subprogram-single-gc-ranges-main.s -o %t1.o
# RUN: %clang %cflags %t1.o -o %t.exe -Wl,-q
-# RUN: llvm-bolt %t.exe -o %t.bolt --update-debug-sections &> %t1.txt
-# RUN: llvm-dwarfdump --show-form --verbose --debug-info %t.bolt >> %t1.txt
+# RUN: llvm-bolt %t.exe -o %t.bolt --update-debug-sections
+# RUN: llvm-dwarfdump --show-form --verbose --debug-info %t.bolt > %t1.txt
# RUN: cat %t1.txt | FileCheck --check-prefix=POSTCHECK %s
# This test checks BOLT correctly handles DW_TAG_subprogram with Ranges with single entry, when function was GCed.
-# POSTCHECK: BOLT-WARNING: [internal-dwarf-error]: subprogram got GCed by the linker, DW_AT_ranges is used
-
# POSTCHECK: DW_TAG_subprogram
# POSTCHECK-NEXT: DW_AT_frame_base
# POSTCHECK-NEXT: DW_AT_linkage_name
diff --git a/bolt/test/X86/dwarf5-empty-function-ranges.s b/bolt/test/X86/dwarf5-empty-function-ranges.s
new file mode 100644
index 000000000000..bfa317808163
--- /dev/null
+++ b/bolt/test/X86/dwarf5-empty-function-ranges.s
@@ -0,0 +1,538 @@
+# REQUIRES: system-linux
+
+# RUN: llvm-mc -dwarf-version=5 -filetype=obj -triple x86_64-unknown-linux %s -o %t1.o
+# RUN: %clang %cflags -dwarf-5 %t1.o -o %t.exe -Wl,-q -Wl,-gc-sections -fuse-ld=lld -Wl,--entry=main
+# RUN: llvm-bolt %t.exe -o %t.bolt --update-debug-sections
+# RUN: llvm-dwarfdump --debug-info %t.exe | FileCheck --check-prefix=PRECHECK %s
+# RUN: llvm-dwarfdump --debug-info %t.bolt | FileCheck --check-prefix=POSTCHECK %s
+
+# PRECHECK: DW_TAG_subprogram
+# PRECHECK-NEXT: DW_AT_ranges
+# PRECHECK-NEXT: [0x0000000000000000
+# PRECHECK-NEXT: [0x0000000000000000
+# PRECHECK-NEXT: [0x0000000000000000
+# PRECHECK-NEXT: [0x0000000000000000
+# PRECHECK-NEXT: DW_AT_frame_base
+# PRECHECK-NEXT: DW_AT_linkage_name ("_Z6helperi")
+# PRECHECK-NEXT: DW_AT_name ("helper")
+
+# POSTCHECK: DW_TAG_subprogram
+# POSTCHECK-NEXT: DW_AT_frame_base
+# POSTCHECK-NEXT: DW_AT_linkage_name ("_Z6helperi")
+# POSTCHECK-NEXT: DW_AT_name ("helper")
+# POSTCHECK-NEXT: DW_AT_decl_file
+# POSTCHECK-NEXT: DW_AT_decl_line
+# POSTCHECK-NEXT: DW_AT_type
+# POSTCHECK-NEXT: DW_AT_external
+# POSTCHECK-NEXT: DW_AT_low_pc (0x0000000000000000)
+# POSTCHECK-NEXT: DW_AT_high_pc (0x0000000000000001)
+
+## Tests BOLT path that handles DW_AT_ranges with no output function ranges.
+
+## clang++ main.cpp -O0 -fno-inline-functions -fbasic-block-sections=all -g2 -S
+## int helper(int argc) {
+## int x = argc;
+## if (x == 3)
+## x++;
+## else
+## x--;
+## return x;
+## }
+## int main(int argc, char *argv[]) {
+## int x = argc;
+## if (x == 3)
+## x++;
+## else
+## x--;
+## return x;
+## }
+
+ .text
+ .file "main.cpp"
+ .section .text._Z6helperi,"ax",@progbits
+ .globl _Z6helperi # -- Begin function _Z6helperi
+ .p2align 4, 0x90
+ .type _Z6helperi,@function
+_Z6helperi: # @_Z6helperi
+.Lfunc_begin0:
+ .file 0 "/repro2" "main.cpp" md5 0x888a2704226ec400f256aa9c2207456c
+ .loc 0 1 0 # main.cpp:1:0
+ .cfi_startproc
+# %bb.0: # %entry
+ pushq %rbp
+ .cfi_def_cfa_offset 16
+ .cfi_offset %rbp, -16
+ movq %rsp, %rbp
+ .cfi_def_cfa_register %rbp
+ movl %edi, -4(%rbp)
+.Ltmp0:
+ .loc 0 2 11 prologue_end # main.cpp:2:11
+ movl -4(%rbp), %eax
+ .loc 0 2 7 is_stmt 0 # main.cpp:2:7
+ movl %eax, -8(%rbp)
+.Ltmp1:
+ .loc 0 3 9 is_stmt 1 # main.cpp:3:9
+ cmpl $3, -8(%rbp)
+.Ltmp2:
+ .loc 0 3 7 is_stmt 0 # main.cpp:3:7
+ jne _Z6helperi.__part.2
+ jmp _Z6helperi.__part.1
+.LBB_END0_0:
+ .cfi_endproc
+ .section .text._Z6helperi,"ax",@progbits,unique,1
+_Z6helperi.__part.1: # %if.then
+ .cfi_startproc
+ .cfi_def_cfa %rbp, 16
+ .cfi_offset %rbp, -16
+ .loc 0 4 6 is_stmt 1 # main.cpp:4:6
+ movl -8(%rbp), %eax
+ addl $1, %eax
+ movl %eax, -8(%rbp)
+ .loc 0 4 5 is_stmt 0 # main.cpp:4:5
+ jmp _Z6helperi.__part.3
+.LBB_END0_1:
+ .size _Z6helperi.__part.1, .LBB_END0_1-_Z6helperi.__part.1
+ .cfi_endproc
+ .section .text._Z6helperi,"ax",@progbits,unique,2
+_Z6helperi.__part.2: # %if.else
+ .cfi_startproc
+ .cfi_def_cfa %rbp, 16
+ .cfi_offset %rbp, -16
+ .loc 0 6 6 is_stmt 1 # main.cpp:6:6
+ movl -8(%rbp), %eax
+ addl $-1, %eax
+ movl %eax, -8(%rbp)
+ jmp _Z6helperi.__part.3
+.LBB_END0_2:
+ .size _Z6helperi.__part.2, .LBB_END0_2-_Z6helperi.__part.2
+ .cfi_endproc
+ .section .text._Z6helperi,"ax",@progbits,unique,3
+_Z6helperi.__part.3: # %if.end
+ .cfi_startproc
+ .cfi_def_cfa %rbp, 16
+ .cfi_offset %rbp, -16
+ .loc 0 7 10 # main.cpp:7:10
+ movl -8(%rbp), %eax
+ .loc 0 7 3 epilogue_begin is_stmt 0 # main.cpp:7:3
+ popq %rbp
+ .cfi_def_cfa %rsp, 8
+ retq
+.LBB_END0_3:
+ .size _Z6helperi.__part.3, .LBB_END0_3-_Z6helperi.__part.3
+ .cfi_endproc
+ .section .text._Z6helperi,"ax",@progbits
+.Lfunc_end0:
+ .size _Z6helperi, .Lfunc_end0-_Z6helperi
+ # -- End function
+ .section .text.main,"ax",@progbits
+ .globl main # -- Begin function main
+ .p2align 4, 0x90
+ .type main,@function
+main: # @main
+.Lfunc_begin1:
+ .loc 0 9 0 is_stmt 1 # main.cpp:9:0
+ .cfi_startproc
+# %bb.0: # %entry
+ pushq %rbp
+ .cfi_def_cfa_offset 16
+ .cfi_offset %rbp, -16
+ movq %rsp, %rbp
+ .cfi_def_cfa_register %rbp
+ movl $0, -4(%rbp)
+ movl %edi, -8(%rbp)
+ movq %rsi, -16(%rbp)
+.Ltmp3:
+ .loc 0 10 11 prologue_end # main.cpp:10:11
+ movl -8(%rbp), %eax
+ .loc 0 10 7 is_stmt 0 # main.cpp:10:7
+ movl %eax, -20(%rbp)
+.Ltmp4:
+ .loc 0 11 9 is_stmt 1 # main.cpp:11:9
+ cmpl $3, -20(%rbp)
+.Ltmp5:
+ .loc 0 11 7 is_stmt 0 # main.cpp:11:7
+ jne main.__part.2
+ jmp main.__part.1
+.LBB_END1_0:
+ .cfi_endproc
+ .section .text.main,"ax",@progbits,unique,4
+main.__part.1: # %if.then
+ .cfi_startproc
+ .cfi_def_cfa %rbp, 16
+ .cfi_offset %rbp, -16
+ .loc 0 12 6 is_stmt 1 # main.cpp:12:6
+ movl -20(%rbp), %eax
+ addl $1, %eax
+ movl %eax, -20(%rbp)
+ .loc 0 12 5 is_stmt 0 # main.cpp:12:5
+ jmp main.__part.3
+.LBB_END1_1:
+ .size main.__part.1, .LBB_END1_1-main.__part.1
+ .cfi_endproc
+ .section .text.main,"ax",@progbits,unique,5
+main.__part.2: # %if.else
+ .cfi_startproc
+ .cfi_def_cfa %rbp, 16
+ .cfi_offset %rbp, -16
+ .loc 0 14 6 is_stmt 1 # main.cpp:14:6
+ movl -20(%rbp), %eax
+ addl $-1, %eax
+ movl %eax, -20(%rbp)
+ jmp main.__part.3
+.LBB_END1_2:
+ .size main.__part.2, .LBB_END1_2-main.__part.2
+ .cfi_endproc
+ .section .text.main,"ax",@progbits,unique,6
+main.__part.3: # %if.end
+ .cfi_startproc
+ .cfi_def_cfa %rbp, 16
+ .cfi_offset %rbp, -16
+ .loc 0 15 10 # main.cpp:15:10
+ movl -20(%rbp), %eax
+ .loc 0 15 3 epilogue_begin is_stmt 0 # main.cpp:15:3
+ popq %rbp
+ .cfi_def_cfa %rsp, 8
+ retq
+.LBB_END1_3:
+ .size main.__part.3, .LBB_END1_3-main.__part.3
+ .cfi_endproc
+ .section .text.main,"ax",@progbits
+.Lfunc_end1:
+ .size main, .Lfunc_end1-main
+ # -- End function
+ .section .debug_abbrev,"",@progbits
+ .byte 1 # Abbreviation Code
+ .byte 17 # DW_TAG_compile_unit
+ .byte 1 # DW_CHILDREN_yes
+ .byte 37 # DW_AT_producer
+ .byte 37 # DW_FORM_strx1
+ .byte 19 # DW_AT_language
+ .byte 5 # DW_FORM_data2
+ .byte 3 # DW_AT_name
+ .byte 37 # DW_FORM_strx1
+ .byte 114 # DW_AT_str_offsets_base
+ .byte 23 # DW_FORM_sec_offset
+ .byte 16 # DW_AT_stmt_list
+ .byte 23 # DW_FORM_sec_offset
+ .byte 27 # DW_AT_comp_dir
+ .byte 37 # DW_FORM_strx1
+ .byte 17 # DW_AT_low_pc
+ .byte 1 # DW_FORM_addr
+ .byte 85 # DW_AT_ranges
+ .byte 35 # DW_FORM_rnglistx
+ .byte 115 # DW_AT_addr_base
+ .byte 23 # DW_FORM_sec_offset
+ .byte 116 # DW_AT_rnglists_base
+ .byte 23 # DW_FORM_sec_offset
+ .byte 0 # EOM(1)
+ .byte 0 # EOM(2)
+ .byte 2 # Abbreviation Code
+ .byte 46 # DW_TAG_subprogram
+ .byte 1 # DW_CHILDREN_yes
+ .byte 85 # DW_AT_ranges
+ .byte 35 # DW_FORM_rnglistx
+ .byte 64 # DW_AT_frame_base
+ .byte 24 # DW_FORM_exprloc
+ .byte 110 # DW_AT_linkage_name
+ .byte 37 # DW_FORM_strx1
+ .byte 3 # DW_AT_name
+ .byte 37 # DW_FORM_strx1
+ .byte 58 # DW_AT_decl_file
+ .byte 11 # DW_FORM_data1
+ .byte 59 # DW_AT_decl_line
+ .byte 11 # DW_FORM_data1
+ .byte 73 # DW_AT_type
+ .byte 19 # DW_FORM_ref4
+ .byte 63 # DW_AT_external
+ .byte 25 # DW_FORM_flag_present
+ .byte 0 # EOM(1)
+ .byte 0 # EOM(2)
+ .byte 3 # Abbreviation Code
+ .byte 5 # DW_TAG_formal_parameter
+ .byte 0 # DW_CHILDREN_no
+ .byte 2 # DW_AT_location
+ .byte 24 # DW_FORM_exprloc
+ .byte 3 # DW_AT_name
+ .byte 37 # DW_FORM_strx1
+ .byte 58 # DW_AT_decl_file
+ .byte 11 # DW_FORM_data1
+ .byte 59 # DW_AT_decl_line
+ .byte 11 # DW_FORM_data1
+ .byte 73 # DW_AT_type
+ .byte 19 # DW_FORM_ref4
+ .byte 0 # EOM(1)
+ .byte 0 # EOM(2)
+ .byte 4 # Abbreviation Code
+ .byte 52 # DW_TAG_variable
+ .byte 0 # DW_CHILDREN_no
+ .byte 2 # DW_AT_location
+ .byte 24 # DW_FORM_exprloc
+ .byte 3 # DW_AT_name
+ .byte 37 # DW_FORM_strx1
+ .byte 58 # DW_AT_decl_file
+ .byte 11 # DW_FORM_data1
+ .byte 59 # DW_AT_decl_line
+ .byte 11 # DW_FORM_data1
+ .byte 73 # DW_AT_type
+ .byte 19 # DW_FORM_ref4
+ .byte 0 # EOM(1)
+ .byte 0 # EOM(2)
+ .byte 5 # Abbreviation Code
+ .byte 46 # DW_TAG_subprogram
+ .byte 1 # DW_CHILDREN_yes
+ .byte 85 # DW_AT_ranges
+ .byte 35 # DW_FORM_rnglistx
+ .byte 64 # DW_AT_frame_base
+ .byte 24 # DW_FORM_exprloc
+ .byte 3 # DW_AT_name
+ .byte 37 # DW_FORM_strx1
+ .byte 58 # DW_AT_decl_file
+ .byte 11 # DW_FORM_data1
+ .byte 59 # DW_AT_decl_line
+ .byte 11 # DW_FORM_data1
+ .byte 73 # DW_AT_type
+ .byte 19 # DW_FORM_ref4
+ .byte 63 # DW_AT_external
+ .byte 25 # DW_FORM_flag_present
+ .byte 0 # EOM(1)
+ .byte 0 # EOM(2)
+ .byte 6 # Abbreviation Code
+ .byte 36 # DW_TAG_base_type
+ .byte 0 # DW_CHILDREN_no
+ .byte 3 # DW_AT_name
+ .byte 37 # DW_FORM_strx1
+ .byte 62 # DW_AT_encoding
+ .byte 11 # DW_FORM_data1
+ .byte 11 # DW_AT_byte_size
+ .byte 11 # DW_FORM_data1
+ .byte 0 # EOM(1)
+ .byte 0 # EOM(2)
+ .byte 7 # Abbreviation Code
+ .byte 15 # DW_TAG_pointer_type
+ .byte 0 # DW_CHILDREN_no
+ .byte 73 # DW_AT_type
+ .byte 19 # DW_FORM_ref4
+ .byte 0 # EOM(1)
+ .byte 0 # EOM(2)
+ .byte 0 # EOM(3)
+ .section .debug_info,"",@progbits
+.Lcu_begin0:
+ .long .Ldebug_info_end0-.Ldebug_info_start0 # Length of Unit
+.Ldebug_info_start0:
+ .short 5 # DWARF version number
+ .byte 1 # DWARF Unit Type
+ .byte 8 # Address Size (in bytes)
+ .long .debug_abbrev # Offset Into Abbrev. Section
+ .byte 1 # Abbrev [1] 0xc:0x82 DW_TAG_compile_unit
+ .byte 0 # DW_AT_producer
+ .short 33 # DW_AT_language
+ .byte 1 # DW_AT_name
+ .long .Lstr_offsets_base0 # DW_AT_str_offsets_base
+ .long .Lline_table_start0 # DW_AT_stmt_list
+ .byte 2 # DW_AT_comp_dir
+ .quad 0 # DW_AT_low_pc
+ .byte 2 # DW_AT_ranges
+ .long .Laddr_table_base0 # DW_AT_addr_base
+ .long .Lrnglists_table_base0 # DW_AT_rnglists_base
+ .byte 2 # Abbrev [2] 0x2b:0x23 DW_TAG_subprogram
+ .byte 0 # DW_AT_ranges
+ .byte 1 # DW_AT_frame_base
+ .byte 86
+ .byte 3 # DW_AT_linkage_name
+ .byte 4 # DW_AT_name
+ .byte 0 # DW_AT_decl_file
+ .byte 1 # DW_AT_decl_line
+ .long 123 # DW_AT_type
+ # DW_AT_external
+ .byte 3 # Abbrev [3] 0x37:0xb DW_TAG_formal_parameter
+ .byte 2 # DW_AT_location
+ .byte 145
+ .byte 124
+ .byte 7 # DW_AT_name
+ .byte 0 # DW_AT_decl_file
+ .byte 1 # DW_AT_decl_line
+ .long 123 # DW_AT_type
+ .byte 4 # Abbrev [4] 0x42:0xb DW_TAG_variable
+ .byte 2 # DW_AT_location
+ .byte 145
+ .byte 120
+ .byte 8 # DW_AT_name
+ .byte 0 # DW_AT_decl_file
+ .byte 2 # DW_AT_decl_line
+ .long 123 # DW_AT_type
+ .byte 0 # End Of Children Mark
+ .byte 5 # Abbrev [5] 0x4e:0x2d DW_TAG_subprogram
+ .byte 1 # DW_AT_ranges
+ .byte 1 # DW_AT_frame_base
+ .byte 86
+ .byte 6 # DW_AT_name
+ .byte 0 # DW_AT_decl_file
+ .byte 9 # DW_AT_decl_line
+ .long 123 # DW_AT_type
+ # DW_AT_external
+ .byte 3 # Abbrev [3] 0x59:0xb DW_TAG_formal_parameter
+ .byte 2 # DW_AT_location
+ .byte 145
+ .byte 120
+ .byte 7 # DW_AT_name
+ .byte 0 # DW_AT_decl_file
+ .byte 9 # DW_AT_decl_line
+ .long 123 # DW_AT_type
+ .byte 3 # Abbrev [3] 0x64:0xb DW_TAG_formal_parameter
+ .byte 2 # DW_AT_location
+ .byte 145
+ .byte 112
+ .byte 9 # DW_AT_name
+ .byte 0 # DW_AT_decl_file
+ .byte 9 # DW_AT_decl_line
+ .long 127 # DW_AT_type
+ .byte 4 # Abbrev [4] 0x6f:0xb DW_TAG_variable
+ .byte 2 # DW_AT_location
+ .byte 145
+ .byte 108
+ .byte 8 # DW_AT_name
+ .byte 0 # DW_AT_decl_file
+ .byte 10 # DW_AT_decl_line
+ .long 123 # DW_AT_type
+ .byte 0 # End Of Children Mark
+ .byte 6 # Abbrev [6] 0x7b:0x4 DW_TAG_base_type
+ .byte 5 # DW_AT_name
+ .byte 5 # DW_AT_encoding
+ .byte 4 # DW_AT_byte_size
+ .byte 7 # Abbrev [7] 0x7f:0x5 DW_TAG_pointer_type
+ .long 132 # DW_AT_type
+ .byte 7 # Abbrev [7] 0x84:0x5 DW_TAG_pointer_type
+ .long 137 # DW_AT_type
+ .byte 6 # Abbrev [6] 0x89:0x4 DW_TAG_base_type
+ .byte 10 # DW_AT_name
+ .byte 6 # DW_AT_encoding
+ .byte 1 # DW_AT_byte_size
+ .byte 0 # End Of Children Mark
+.Ldebug_info_end0:
+ .section .debug_rnglists,"",@progbits
+ .long .Ldebug_list_header_end0-.Ldebug_list_header_start0 # Length
+.Ldebug_list_header_start0:
+ .short 5 # Version
+ .byte 8 # Address size
+ .byte 0 # Segment selector size
+ .long 3 # Offset entry count
+.Lrnglists_table_base0:
+ .long .Ldebug_ranges0-.Lrnglists_table_base0
+ .long .Ldebug_ranges1-.Lrnglists_table_base0
+ .long .Ldebug_ranges2-.Lrnglists_table_base0
+.Ldebug_ranges0:
+ .byte 3 # DW_RLE_startx_length
+ .byte 0 # start index
+ .uleb128 .LBB_END0_1-_Z6helperi.__part.1 # length
+ .byte 3 # DW_RLE_startx_length
+ .byte 1 # start index
+ .uleb128 .LBB_END0_2-_Z6helperi.__part.2 # length
+ .byte 3 # DW_RLE_startx_length
+ .byte 2 # start index
+ .uleb128 .LBB_END0_3-_Z6helperi.__part.3 # length
+ .byte 3 # DW_RLE_startx_length
+ .byte 3 # start index
+ .uleb128 .Lfunc_end0-.Lfunc_begin0 # length
+ .byte 0 # DW_RLE_end_of_list
+.Ldebug_ranges1:
+ .byte 3 # DW_RLE_startx_length
+ .byte 4 # start index
+ .uleb128 .LBB_END1_1-main.__part.1 # length
+ .byte 3 # DW_RLE_startx_length
+ .byte 5 # start index
+ .uleb128 .LBB_END1_2-main.__part.2 # length
+ .byte 3 # DW_RLE_startx_length
+ .byte 6 # start index
+ .uleb128 .LBB_END1_3-main.__part.3 # length
+ .byte 3 # DW_RLE_startx_length
+ .byte 7 # start index
+ .uleb128 .Lfunc_end1-.Lfunc_begin1 # length
+ .byte 0 # DW_RLE_end_of_list
+.Ldebug_ranges2:
+ .byte 3 # DW_RLE_startx_length
+ .byte 0 # start index
+ .uleb128 .LBB_END0_1-_Z6helperi.__part.1 # length
+ .byte 3 # DW_RLE_startx_length
+ .byte 1 # start index
+ .uleb128 .LBB_END0_2-_Z6helperi.__part.2 # length
+ .byte 3 # DW_RLE_startx_length
+ .byte 2 # start index
+ .uleb128 .LBB_END0_3-_Z6helperi.__part.3 # length
+ .byte 3 # DW_RLE_startx_length
+ .byte 3 # start index
+ .uleb128 .Lfunc_end0-.Lfunc_begin0 # length
+ .byte 3 # DW_RLE_startx_length
+ .byte 4 # start index
+ .uleb128 .LBB_END1_1-main.__part.1 # length
+ .byte 3 # DW_RLE_startx_length
+ .byte 5 # start index
+ .uleb128 .LBB_END1_2-main.__part.2 # length
+ .byte 3 # DW_RLE_startx_length
+ .byte 6 # start index
+ .uleb128 .LBB_END1_3-main.__part.3 # length
+ .byte 3 # DW_RLE_startx_length
+ .byte 7 # start index
+ .uleb128 .Lfunc_end1-.Lfunc_begin1 # length
+ .byte 0 # DW_RLE_end_of_list
+.Ldebug_list_header_end0:
+ .section .debug_str_offsets,"",@progbits
+ .long 48 # Length of String Offsets Set
+ .short 5
+ .short 0
+.Lstr_offsets_base0:
+ .section .debug_str,"MS",@progbits,1
+.Linfo_string0:
+ .asciz "clang version 19.0.0git (git@github.com:ayermolo/llvm-project.git a1d8664d409cac2a923176a8e9a731385bde279e)" # string offset=0
+.Linfo_string1:
+ .asciz "main.cpp" # string offset=108
+.Linfo_string2:
+ .asciz "/repro2" # string offset=117
+.Linfo_string3:
+ .asciz "_Z6helperi" # string offset=162
+.Linfo_string4:
+ .asciz "helper" # string offset=173
+.Linfo_string5:
+ .asciz "int" # string offset=180
+.Linfo_string6:
+ .asciz "main" # string offset=184
+.Linfo_string7:
+ .asciz "argc" # string offset=189
+.Linfo_string8:
+ .asciz "x" # string offset=194
+.Linfo_string9:
+ .asciz "argv" # string offset=196
+.Linfo_string10:
+ .asciz "char" # string offset=201
+ .section .debug_str_offsets,"",@progbits
+ .long .Linfo_string0
+ .long .Linfo_string1
+ .long .Linfo_string2
+ .long .Linfo_string3
+ .long .Linfo_string4
+ .long .Linfo_string5
+ .long .Linfo_string6
+ .long .Linfo_string7
+ .long .Linfo_string8
+ .long .Linfo_string9
+ .long .Linfo_string10
+ .section .debug_addr,"",@progbits
+ .long .Ldebug_addr_end0-.Ldebug_addr_start0 # Length of contribution
+.Ldebug_addr_start0:
+ .short 5 # DWARF version number
+ .byte 8 # Address size
+ .byte 0 # Segment selector size
+.Laddr_table_base0:
+ .quad _Z6helperi.__part.1
+ .quad _Z6helperi.__part.2
+ .quad _Z6helperi.__part.3
+ .quad .Lfunc_begin0
+ .quad main.__part.1
+ .quad main.__part.2
+ .quad main.__part.3
+ .quad .Lfunc_begin1
+.Ldebug_addr_end0:
+ .ident "clang version 19.0.0git (git@github.com:ayermolo/llvm-project.git a1d8664d409cac2a923176a8e9a731385bde279e)"
+ .section ".note.GNU-stack","",@progbits
+ .addrsig
+ .section .debug_line,"",@progbits
+.Lline_table_start0:
diff --git a/bolt/test/X86/dwarf5-subprogram-single-gc-ranges.test b/bolt/test/X86/dwarf5-subprogram-single-gc-ranges.test
index 04b7203a5bea..9f8f895ed5f1 100644
--- a/bolt/test/X86/dwarf5-subprogram-single-gc-ranges.test
+++ b/bolt/test/X86/dwarf5-subprogram-single-gc-ranges.test
@@ -2,14 +2,12 @@
# RUN: llvm-mc -dwarf-version=5 -filetype=obj -triple x86_64-unknown-linux %p/Inputs/dwarf5-subprogram-single-gc-ranges-main.s -o %t1.o
# RUN: %clang %cflags %t1.o -o %t.exe -Wl,-q
-# RUN: llvm-bolt %t.exe -o %t.bolt --update-debug-sections &> %t1.txt
-# RUN: llvm-dwarfdump --show-form --verbose --debug-info %t.bolt >> %t1.txt
+# RUN: llvm-bolt %t.exe -o %t.bolt --update-debug-sections
+# RUN: llvm-dwarfdump --show-form --verbose --debug-info %t.bolt > %t1.txt
# RUN: cat %t1.txt | FileCheck --check-prefix=POSTCHECK %s
# This test checks BOLT correctly handles DW_TAG_subprogram with Ranges with single entry, when function was GCed.
-# POSTCHECK: BOLT-WARNING: [internal-dwarf-error]: subprogram got GCed by the linker, DW_AT_ranges is used
-
# POSTCHECK: DW_TAG_subprogram
# POSTCHECK-NEXT: DW_AT_frame_base
# POSTCHECK-NEXT: DW_AT_linkage_name