From 1a1324a303f856bb6cfd0a2bca00736c2b5bc187 Mon Sep 17 00:00:00 2001 From: zr33 Date: Mon, 18 Jul 2022 14:20:22 -0700 Subject: [PATCH] [BOLT][DWARF] Fix incorrect DW_AT_type offset for unittest Some unit tests has incorrect DW_AT_type offset since they are manual crafted, fix them to the correct offset. Reviewed By: Amir, ayermolo Differential Revision: https://reviews.llvm.org/D129828 --- .../dwarf4-split-dwarf-no-address-helper.s | 4 ++-- .../dwarf5-loclist-offset-form-helper.s | 18 ++++++++--------- .../Inputs/dwarf5-loclist-offset-form-main.s | 20 +++++++++---------- bolt/test/X86/high_pc_udata.s | 2 +- 4 files changed, 22 insertions(+), 22 deletions(-) diff --git a/bolt/test/X86/Inputs/dwarf4-split-dwarf-no-address-helper.s b/bolt/test/X86/Inputs/dwarf4-split-dwarf-no-address-helper.s index 9e0f37a1566f7..9c5f676a5ce1c 100644 --- a/bolt/test/X86/Inputs/dwarf4-split-dwarf-no-address-helper.s +++ b/bolt/test/X86/Inputs/dwarf4-split-dwarf-no-address-helper.s @@ -111,7 +111,7 @@ _Z6helperi: # @_Z6helperi .byte 1 # DW_AT_name .byte 1 # DW_AT_decl_file .byte 1 # DW_AT_decl_line - .long 53 # DW_AT_type + .long 48 # DW_AT_type # DW_AT_external .byte 3 # Abbrev [3] 0x29:0xb DW_TAG_formal_parameter .byte 2 # DW_AT_location @@ -120,7 +120,7 @@ _Z6helperi: # @_Z6helperi .byte 3 # DW_AT_name .byte 1 # DW_AT_decl_file .byte 1 # DW_AT_decl_line - .long 53 # DW_AT_type + .long 48 # DW_AT_type .byte 0 # End Of Children Mark .byte 4 # Abbrev [4] 0x35:0x4 DW_TAG_base_type .byte 2 # DW_AT_name diff --git a/bolt/test/X86/Inputs/dwarf5-loclist-offset-form-helper.s b/bolt/test/X86/Inputs/dwarf5-loclist-offset-form-helper.s index 5f4b74a04a61c..d3f481e7573ea 100644 --- a/bolt/test/X86/Inputs/dwarf5-loclist-offset-form-helper.s +++ b/bolt/test/X86/Inputs/dwarf5-loclist-offset-form-helper.s @@ -289,7 +289,7 @@ fooVar: .long .Laddr_table_base0 # DW_AT_addr_base .byte 2 # Abbrev [2] 0x27:0xb DW_TAG_variable .byte 3 # DW_AT_name - .long 50 # DW_AT_type + .long 46 # DW_AT_type # DW_AT_external .byte 0 # DW_AT_decl_file .byte 1 # DW_AT_decl_line @@ -306,11 +306,11 @@ fooVar: .byte 1 # DW_AT_frame_base .byte 87 # DW_AT_call_all_calls - .long 74 # DW_AT_abstract_origin + .long 70 # DW_AT_abstract_origin .byte 5 # Abbrev [5] 0x42:0x7 DW_TAG_formal_parameter .byte 1 # DW_AT_location .byte 85 - .long 79 # DW_AT_abstract_origin + .long 75 # DW_AT_abstract_origin .byte 0 # End Of Children Mark .byte 6 # Abbrev [6] 0x4a:0xe DW_TAG_subprogram .byte 5 # DW_AT_linkage_name @@ -323,10 +323,10 @@ fooVar: .byte 7 # DW_AT_name .byte 0 # DW_AT_decl_file .byte 2 # DW_AT_decl_line - .long 88 # DW_AT_type + .long 84 # DW_AT_type .byte 0 # End Of Children Mark .byte 8 # Abbrev [8] 0x58:0x5 DW_TAG_pointer_type - .long 50 # DW_AT_type + .long 46 # DW_AT_type .byte 9 # Abbrev [9] 0x5d:0x31 DW_TAG_subprogram .byte 2 # DW_AT_low_pc .long .Lfunc_end1-.Lfunc_begin1 # DW_AT_high_pc @@ -337,7 +337,7 @@ fooVar: .byte 9 # DW_AT_name .byte 0 # DW_AT_decl_file .byte 6 # DW_AT_decl_line - .long 50 # DW_AT_type + .long 46 # DW_AT_type # DW_AT_external .byte 10 # Abbrev [10] 0x6d:0xa DW_TAG_formal_parameter .byte 1 # DW_AT_location @@ -345,15 +345,15 @@ fooVar: .byte 10 # DW_AT_name .byte 0 # DW_AT_decl_file .byte 6 # DW_AT_decl_line - .long 50 # DW_AT_type + .long 46 # DW_AT_type .byte 11 # Abbrev [11] 0x77:0x9 DW_TAG_variable .long .Ldebug_loc0 # DW_AT_location .byte 7 # DW_AT_name .byte 0 # DW_AT_decl_file .byte 7 # DW_AT_decl_line - .long 50 # DW_AT_type + .long 46 # DW_AT_type .byte 12 # Abbrev [12] 0x80:0xd DW_TAG_inlined_subroutine - .long 74 # DW_AT_abstract_origin + .long 70 # DW_AT_abstract_origin .byte 2 # DW_AT_low_pc .long .Ltmp1-.Lfunc_begin1 # DW_AT_high_pc .byte 0 # DW_AT_call_file diff --git a/bolt/test/X86/Inputs/dwarf5-loclist-offset-form-main.s b/bolt/test/X86/Inputs/dwarf5-loclist-offset-form-main.s index 43e934fe6d9b8..7f002d371d27b 100644 --- a/bolt/test/X86/Inputs/dwarf5-loclist-offset-form-main.s +++ b/bolt/test/X86/Inputs/dwarf5-loclist-offset-form-main.s @@ -267,14 +267,14 @@ main: # @main .byte 7 # DW_AT_name .byte 0 # DW_AT_decl_file .byte 1 # DW_AT_decl_line - .long 130 # DW_AT_type + .long 132 # DW_AT_type .byte 3 # Abbrev [3] 0x3d:0xa DW_TAG_formal_parameter .byte 1 # DW_AT_location .byte 84 .byte 8 # DW_AT_name .byte 0 # DW_AT_decl_file .byte 1 # DW_AT_decl_line - .long 130 # DW_AT_type + .long 132 # DW_AT_type .byte 0 # End Of Children Mark .byte 4 # Abbrev [4] 0x48:0x36 DW_TAG_subprogram .byte 1 # DW_AT_low_pc @@ -285,7 +285,7 @@ main: # @main .byte 5 # DW_AT_name .byte 0 # DW_AT_decl_file .byte 7 # DW_AT_decl_line - .long 126 # DW_AT_type + .long 128 # DW_AT_type # DW_AT_external .byte 3 # Abbrev [3] 0x57:0xa DW_TAG_formal_parameter .byte 1 # DW_AT_location @@ -293,37 +293,37 @@ main: # @main .byte 9 # DW_AT_name .byte 0 # DW_AT_decl_file .byte 7 # DW_AT_decl_line - .long 126 # DW_AT_type + .long 128 # DW_AT_type .byte 3 # Abbrev [3] 0x61:0xa DW_TAG_formal_parameter .byte 1 # DW_AT_location .byte 84 .byte 10 # DW_AT_name .byte 0 # DW_AT_decl_file .byte 7 # DW_AT_decl_line - .long 135 # DW_AT_type + .long 137 # DW_AT_type .byte 5 # Abbrev [5] 0x6b:0x9 DW_TAG_variable .long .Ldebug_loc0 # DW_AT_location .byte 7 # DW_AT_name .byte 0 # DW_AT_decl_file .byte 8 # DW_AT_decl_line - .long 126 # DW_AT_type + .long 128 # DW_AT_type .byte 5 # Abbrev [5] 0x74:0x9 DW_TAG_variable .long .Ldebug_loc1 # DW_AT_location .byte 8 # DW_AT_name .byte 0 # DW_AT_decl_file .byte 9 # DW_AT_decl_line - .long 126 # DW_AT_type + .long 128 # DW_AT_type .byte 0 # End Of Children Mark .byte 6 # Abbrev [6] 0x7e:0x4 DW_TAG_base_type .byte 6 # DW_AT_name .byte 5 # DW_AT_encoding .byte 4 # DW_AT_byte_size .byte 7 # Abbrev [7] 0x82:0x5 DW_TAG_pointer_type - .long 126 # DW_AT_type + .long 128 # DW_AT_type .byte 7 # Abbrev [7] 0x87:0x5 DW_TAG_pointer_type - .long 140 # DW_AT_type + .long 142 # DW_AT_type .byte 7 # Abbrev [7] 0x8c:0x5 DW_TAG_pointer_type - .long 145 # DW_AT_type + .long 147 # DW_AT_type .byte 6 # Abbrev [6] 0x91:0x4 DW_TAG_base_type .byte 11 # DW_AT_name .byte 6 # DW_AT_encoding diff --git a/bolt/test/X86/high_pc_udata.s b/bolt/test/X86/high_pc_udata.s index 998058df0b059..c3a62842b8756 100644 --- a/bolt/test/X86/high_pc_udata.s +++ b/bolt/test/X86/high_pc_udata.s @@ -124,7 +124,7 @@ main: # @main .long .Linfo_string3 # DW_AT_name .byte 1 # DW_AT_decl_file .byte 1 # DW_AT_decl_line - .long 67 # DW_AT_type + .long 64 # DW_AT_type # DW_AT_external .byte 3 # Abbrev [3] 0x43:0x7 DW_TAG_base_type .long .Linfo_string4 # DW_AT_name