brintos

brintos / llvm-project-archived public Read only

0
0
Text · 13.4 KiB · 8b5afb4 Raw
252 lines · plain
1## Check that BOLT correctly handles two CUs with DWARF-5 debug info (does not crash), when2## a function from one CU is forced to be inlined into another.3 4# REQUIRES: system-linux5 6# RUN: llvm-mc -dwarf-version=5 -filetype=obj -triple x86_64-unknown-linux %s -o %t-main.o7# RUN: llvm-mc -dwarf-version=5 -filetype=obj -triple x86_64-unknown-linux %p/Inputs/dwarf5_helper.s -o %thelper.o8# RUN: %clang %cflags -gdwarf-5 -Wl,-q %t-main.o %thelper.o -o %t.exe9# RUN: llvm-bolt %t.exe --update-debug-sections --force-inline=_Z3fooi \10# RUN:   -o %t.bolt | FileCheck %s11 12# CHECK-NOT: BOLT-ERROR13# CHECK-NOT: BOLT-WARNING14# CHECK: BOLT-INFO: inlined {{[0-9]+}} calls at {{[1-9][0-9]*}} call sites15 16# extern int foo(int);17# int main(){18#     foo(10);19#     return 0;20# }21        .file   "main.cpp"22        .text23        .globl  main                            # -- Begin function main24        .p2align        425        .type   main,@function26main:                                   # @main27.Lfunc_begin0:28        .file   0 "/home/gpastukhov/tmp2" "main.cpp" md5 0x5c930f5d3a068b09fd18ece59c58bdcf29        .loc    0 2 0                           # main.cpp:2:030        .cfi_startproc31# %bb.0:32        pushq   %rax33        .cfi_def_cfa_offset 1634.Ltmp0:35        .loc    0 3 5 prologue_end              # main.cpp:3:536        movl    $10, %edi37        callq   _Z3fooi38.Ltmp1:39        .loc    0 4 5                           # main.cpp:4:540        xorl    %eax, %eax41        .loc    0 4 5 epilogue_begin is_stmt 0  # main.cpp:4:542        popq    %rcx43        .cfi_def_cfa_offset 844        retq45.Ltmp2:46.Lfunc_end0:47        .size   main, .Lfunc_end0-main48        .cfi_endproc49                                        # -- End function50        .section        .debug_abbrev,"",@progbits51        .byte   1                               # Abbreviation Code52        .byte   17                              # DW_TAG_compile_unit53        .byte   1                               # DW_CHILDREN_yes54        .byte   37                              # DW_AT_producer55        .byte   37                              # DW_FORM_strx156        .byte   19                              # DW_AT_language57        .byte   5                               # DW_FORM_data258        .byte   3                               # DW_AT_name59        .byte   37                              # DW_FORM_strx160        .byte   114                             # DW_AT_str_offsets_base61        .byte   23                              # DW_FORM_sec_offset62        .byte   16                              # DW_AT_stmt_list63        .byte   23                              # DW_FORM_sec_offset64        .byte   27                              # DW_AT_comp_dir65        .byte   37                              # DW_FORM_strx166        .byte   17                              # DW_AT_low_pc67        .byte   27                              # DW_FORM_addrx68        .byte   18                              # DW_AT_high_pc69        .byte   6                               # DW_FORM_data470        .byte   115                             # DW_AT_addr_base71        .byte   23                              # DW_FORM_sec_offset72        .byte   0                               # EOM(1)73        .byte   0                               # EOM(2)74        .byte   2                               # Abbreviation Code75        .byte   46                              # DW_TAG_subprogram76        .byte   1                               # DW_CHILDREN_yes77        .byte   17                              # DW_AT_low_pc78        .byte   27                              # DW_FORM_addrx79        .byte   18                              # DW_AT_high_pc80        .byte   6                               # DW_FORM_data481        .byte   64                              # DW_AT_frame_base82        .byte   24                              # DW_FORM_exprloc83        .byte   122                             # DW_AT_call_all_calls84        .byte   25                              # DW_FORM_flag_present85        .byte   3                               # DW_AT_name86        .byte   37                              # DW_FORM_strx187        .byte   58                              # DW_AT_decl_file88        .byte   11                              # DW_FORM_data189        .byte   59                              # DW_AT_decl_line90        .byte   11                              # DW_FORM_data191        .byte   73                              # DW_AT_type92        .byte   19                              # DW_FORM_ref493        .byte   63                              # DW_AT_external94        .byte   25                              # DW_FORM_flag_present95        .byte   0                               # EOM(1)96        .byte   0                               # EOM(2)97        .byte   3                               # Abbreviation Code98        .byte   72                              # DW_TAG_call_site99        .byte   1                               # DW_CHILDREN_yes100        .byte   127                             # DW_AT_call_origin101        .byte   19                              # DW_FORM_ref4102        .byte   125                             # DW_AT_call_return_pc103        .byte   27                              # DW_FORM_addrx104        .byte   0                               # EOM(1)105        .byte   0                               # EOM(2)106        .byte   4                               # Abbreviation Code107        .byte   73                              # DW_TAG_call_site_parameter108        .byte   0                               # DW_CHILDREN_no109        .byte   2                               # DW_AT_location110        .byte   24                              # DW_FORM_exprloc111        .byte   126                             # DW_AT_call_value112        .byte   24                              # DW_FORM_exprloc113        .byte   0                               # EOM(1)114        .byte   0                               # EOM(2)115        .byte   5                               # Abbreviation Code116        .byte   46                              # DW_TAG_subprogram117        .byte   1                               # DW_CHILDREN_yes118        .byte   110                             # DW_AT_linkage_name119        .byte   37                              # DW_FORM_strx1120        .byte   3                               # DW_AT_name121        .byte   37                              # DW_FORM_strx1122        .byte   58                              # DW_AT_decl_file123        .byte   11                              # DW_FORM_data1124        .byte   59                              # DW_AT_decl_line125        .byte   11                              # DW_FORM_data1126        .byte   73                              # DW_AT_type127        .byte   19                              # DW_FORM_ref4128        .byte   60                              # DW_AT_declaration129        .byte   25                              # DW_FORM_flag_present130        .byte   63                              # DW_AT_external131        .byte   25                              # DW_FORM_flag_present132        .byte   0                               # EOM(1)133        .byte   0                               # EOM(2)134        .byte   6                               # Abbreviation Code135        .byte   5                               # DW_TAG_formal_parameter136        .byte   0                               # DW_CHILDREN_no137        .byte   73                              # DW_AT_type138        .byte   19                              # DW_FORM_ref4139        .byte   0                               # EOM(1)140        .byte   0                               # EOM(2)141        .byte   7                               # Abbreviation Code142        .byte   36                              # DW_TAG_base_type143        .byte   0                               # DW_CHILDREN_no144        .byte   3                               # DW_AT_name145        .byte   37                              # DW_FORM_strx1146        .byte   62                              # DW_AT_encoding147        .byte   11                              # DW_FORM_data1148        .byte   11                              # DW_AT_byte_size149        .byte   11                              # DW_FORM_data1150        .byte   0                               # EOM(1)151        .byte   0                               # EOM(2)152        .byte   0                               # EOM(3)153        .section        .debug_info,"",@progbits154.Lcu_begin0:155        .long   .Ldebug_info_end0-.Ldebug_info_start0 # Length of Unit156.Ldebug_info_start0:157        .short  5                               # DWARF version number158        .byte   1                               # DWARF Unit Type159        .byte   8                               # Address Size (in bytes)160        .long   .debug_abbrev                   # Offset Into Abbrev. Section161        .byte   1                               # Abbrev [1] 0xc:0x47 DW_TAG_compile_unit162        .byte   0                               # DW_AT_producer163        .short  33                              # DW_AT_language164        .byte   1                               # DW_AT_name165        .long   .Lstr_offsets_base0             # DW_AT_str_offsets_base166        .long   .Lline_table_start0             # DW_AT_stmt_list167        .byte   2                               # DW_AT_comp_dir168        .byte   0                               # DW_AT_low_pc169        .long   .Lfunc_end0-.Lfunc_begin0       # DW_AT_high_pc170        .long   .Laddr_table_base0              # DW_AT_addr_base171        .byte   2                               # Abbrev [2] 0x23:0x1c DW_TAG_subprogram172        .byte   0                               # DW_AT_low_pc173        .long   .Lfunc_end0-.Lfunc_begin0       # DW_AT_high_pc174        .byte   1                               # DW_AT_frame_base175        .byte   87176                                        # DW_AT_call_all_calls177        .byte   6                               # DW_AT_name178        .byte   0                               # DW_AT_decl_file179        .byte   2                               # DW_AT_decl_line180        .long   78                              # DW_AT_type181                                        # DW_AT_external182        .byte   3                               # Abbrev [3] 0x32:0xc DW_TAG_call_site183        .long   63                              # DW_AT_call_origin184        .byte   1                               # DW_AT_call_return_pc185        .byte   4                               # Abbrev [4] 0x38:0x5 DW_TAG_call_site_parameter186        .byte   1                               # DW_AT_location187        .byte   85188        .byte   1                               # DW_AT_call_value189        .byte   58190        .byte   0                               # End Of Children Mark191        .byte   0                               # End Of Children Mark192        .byte   5                               # Abbrev [5] 0x3f:0xf DW_TAG_subprogram193        .byte   3                               # DW_AT_linkage_name194        .byte   4                               # DW_AT_name195        .byte   0                               # DW_AT_decl_file196        .byte   1                               # DW_AT_decl_line197        .long   78                              # DW_AT_type198                                        # DW_AT_declaration199                                        # DW_AT_external200        .byte   6                               # Abbrev [6] 0x48:0x5 DW_TAG_formal_parameter201        .long   78                              # DW_AT_type202        .byte   0                               # End Of Children Mark203        .byte   7                               # Abbrev [7] 0x4e:0x4 DW_TAG_base_type204        .byte   5                               # DW_AT_name205        .byte   5                               # DW_AT_encoding206        .byte   4                               # DW_AT_byte_size207        .byte   0                               # End Of Children Mark208.Ldebug_info_end0:209        .section        .debug_str_offsets,"",@progbits210        .long   32                              # Length of String Offsets Set211        .short  5212        .short  0213.Lstr_offsets_base0:214        .section        .debug_str,"MS",@progbits,1215.Linfo_string0:216        .asciz  "clang version 20.1.8 (CentOS 20.1.8-1.el9)" # string offset=0217.Linfo_string1:218        .asciz  "main.cpp"                      # string offset=43219.Linfo_string2:220        .asciz  "/home/gpastukhov/tmp2"         # string offset=52221.Linfo_string3:222        .asciz  "_Z3fooi"                       # string offset=74223.Linfo_string4:224        .asciz  "foo"                           # string offset=82225.Linfo_string5:226        .asciz  "int"                           # string offset=86227.Linfo_string6:228        .asciz  "main"                          # string offset=90229        .section        .debug_str_offsets,"",@progbits230        .long   .Linfo_string0231        .long   .Linfo_string1232        .long   .Linfo_string2233        .long   .Linfo_string3234        .long   .Linfo_string4235        .long   .Linfo_string5236        .long   .Linfo_string6237        .section        .debug_addr,"",@progbits238        .long   .Ldebug_addr_end0-.Ldebug_addr_start0 # Length of contribution239.Ldebug_addr_start0:240        .short  5                               # DWARF version number241        .byte   8                               # Address size242        .byte   0                               # Segment selector size243.Laddr_table_base0:244        .quad   .Lfunc_begin0245        .quad   .Ltmp1246.Ldebug_addr_end0:247        .ident  "clang version 20.1.8 (CentOS 20.1.8-1.el9)"248        .section        ".note.GNU-stack","",@progbits249        .addrsig250        .section        .debug_line,"",@progbits251.Lline_table_start0:252