brintos

brintos / llvm-project-archived public Read only

0
0
Text · 8.3 KiB · 6cdc345 Raw
197 lines · plain
1# REQUIRES: system-linux2 3# RUN: llvm-mc -dwarf-version=5 -filetype=obj -triple x86_64-unknown-linux %s -o %t1.o4# RUN: %clang %cflags -dwarf-5 %t1.o -o %t.exe -Wl,-q5# RUN: llvm-bolt %t.exe -o %t.bolt --update-debug-sections --always-convert-to-ranges6# RUN: llvm-dwarfdump --show-form --verbose --debug-info %t.exe | FileCheck --check-prefix=PRECHECK %s7# RUN: llvm-dwarfdump --show-form --verbose --debug-addr %t.bolt > %t.txt8# RUN: llvm-dwarfdump --show-form --verbose --debug-info %t.bolt >> %t.txt9# RUN: cat %t.txt | FileCheck --check-prefix=POSTCHECK %s10 11## This tests checks that DW_AT_low_pc/DW_AT_high_pc is converted to DW_AT_low_pc/DW_AT_ranges.12## Checks that DW_AT_rnglists_base is inserted, and that correct address is used.13 14# PRECHECK: version = 0x000515# PRECHECK: DW_AT_low_pc16# PRECHECK-SAME: DW_FORM_addrx17# PRECHECK-SAME: (00000000)18# PRECHECK-NEXT: DW_AT_high_pc [DW_FORM_data4]	(0x0000000f)19# PRECHECK-NEXT: DW_AT_addr_base [DW_FORM_sec_offset]	(0x00000008)20 21# POSTCHECK: Addrs: [22# POSTCHECK-NEXT: 0x[[#%.16x,ADDR:]]23# POSTCHECK: version = 0x000524# POSTCHECK: DW_AT_low_pc25# POSTCHECK-SAME: DW_FORM_addrx26# POSTCHECK-SAME: (00000001)27# POSTCHECK-SAME: address = 0x000000000000000028# POSTCHECK-NEXT: DW_AT_ranges29# POSTCHECK-SAME: DW_FORM_rnglistx30# POSTCHECK-SAME: (0x0)31# POSTCHECK-SAME: rangelist = 0x0000001432# POSTCHECK-NEXT: [33# POSTCHECK-SAME: 0x[[#ADDR]]34# POSTCHECK-SAME: 0x[[#ADDR + 15]]35# POSTCHECK-NEXT: DW_AT_addr_base [DW_FORM_sec_offset]  (0x00000008)36# POSTCHECK-NEXT: DW_AT_rnglists_base [DW_FORM_sec_offset]  (0x0000000c)37 38# int main() {39#    return 0;40# }41 42	.text43	.file	"main.cpp"44	.globl	main                            # -- Begin function main45	.p2align	4, 0x9046	.type	main,@function47main:                                   # @main48.Lfunc_begin0:49	.file	0 "." "main.cpp" md5 0xbb12fec8d002b1f0e06f7dee4604c6cc50	.loc	0 1 0                           # main.cpp:1:051	.cfi_startproc52# %bb.0:                                # %entry53	pushq	%rbp54	.cfi_def_cfa_offset 1655	.cfi_offset %rbp, -1656	movq	%rsp, %rbp57	.cfi_def_cfa_register %rbp58	movl	$0, -4(%rbp)59.Ltmp0:60	.loc	0 2 3 prologue_end              # main.cpp:2:361	xorl	%eax, %eax62	popq	%rbp63	.cfi_def_cfa %rsp, 864	retq65.Ltmp1:66.Lfunc_end0:67	.size	main, .Lfunc_end0-main68	.cfi_endproc69                                        # -- End function70	.section	.debug_abbrev,"",@progbits71	.byte	1                               # Abbreviation Code72	.byte	17                              # DW_TAG_compile_unit73	.byte	1                               # DW_CHILDREN_yes74	.byte	37                              # DW_AT_producer75	.byte	37                              # DW_FORM_strx176	.byte	19                              # DW_AT_language77	.byte	5                               # DW_FORM_data278	.byte	3                               # DW_AT_name79	.byte	37                              # DW_FORM_strx180	.byte	114                             # DW_AT_str_offsets_base81	.byte	23                              # DW_FORM_sec_offset82	.byte	16                              # DW_AT_stmt_list83	.byte	23                              # DW_FORM_sec_offset84	.byte	27                              # DW_AT_comp_dir85	.byte	37                              # DW_FORM_strx186	.byte	17                              # DW_AT_low_pc87	.byte	27                              # DW_FORM_addrx88	.byte	18                              # DW_AT_high_pc89	.byte	6                               # DW_FORM_data490	.byte	115                             # DW_AT_addr_base91	.byte	23                              # DW_FORM_sec_offset92	.byte	0                               # EOM(1)93	.byte	0                               # EOM(2)94	.byte	2                               # Abbreviation Code95	.byte	46                              # DW_TAG_subprogram96	.byte	0                               # DW_CHILDREN_no97	.byte	17                              # DW_AT_low_pc98	.byte	27                              # DW_FORM_addrx99	.byte	18                              # DW_AT_high_pc100	.byte	6                               # DW_FORM_data4101	.byte	64                              # DW_AT_frame_base102	.byte	24                              # DW_FORM_exprloc103	.byte	3                               # DW_AT_name104	.byte	37                              # DW_FORM_strx1105	.byte	58                              # DW_AT_decl_file106	.byte	11                              # DW_FORM_data1107	.byte	59                              # DW_AT_decl_line108	.byte	11                              # DW_FORM_data1109	.byte	73                              # DW_AT_type110	.byte	19                              # DW_FORM_ref4111	.byte	63                              # DW_AT_external112	.byte	25                              # DW_FORM_flag_present113	.byte	0                               # EOM(1)114	.byte	0                               # EOM(2)115	.byte	3                               # Abbreviation Code116	.byte	36                              # DW_TAG_base_type117	.byte	0                               # DW_CHILDREN_no118	.byte	3                               # DW_AT_name119	.byte	37                              # DW_FORM_strx1120	.byte	62                              # DW_AT_encoding121	.byte	11                              # DW_FORM_data1122	.byte	11                              # DW_AT_byte_size123	.byte	11                              # DW_FORM_data1124	.byte	0                               # EOM(1)125	.byte	0                               # EOM(2)126	.byte	0                               # EOM(3)127	.section	.debug_info,"",@progbits128.Lcu_begin0:129	.long	.Ldebug_info_end0-.Ldebug_info_start0 # Length of Unit130.Ldebug_info_start0:131	.short	5                               # DWARF version number132	.byte	1                               # DWARF Unit Type133	.byte	8                               # Address Size (in bytes)134	.long	.debug_abbrev                   # Offset Into Abbrev. Section135	.byte	1                               # Abbrev [1] 0xc:0x2b DW_TAG_compile_unit136	.byte	0                               # DW_AT_producer137	.short	33                              # DW_AT_language138	.byte	1                               # DW_AT_name139	.long	.Lstr_offsets_base0             # DW_AT_str_offsets_base140	.long	.Lline_table_start0             # DW_AT_stmt_list141	.byte	2                               # DW_AT_comp_dir142	.byte	0                               # DW_AT_low_pc143	.long	.Lfunc_end0-.Lfunc_begin0       # DW_AT_high_pc144	.long	.Laddr_table_base0              # DW_AT_addr_base145	.byte	2                               # Abbrev [2] 0x23:0xf DW_TAG_subprogram146	.byte	0                               # DW_AT_low_pc147	.long	.Lfunc_end0-.Lfunc_begin0       # DW_AT_high_pc148	.byte	1                               # DW_AT_frame_base149	.byte	86150	.byte	3                               # DW_AT_name151	.byte	0                               # DW_AT_decl_file152	.byte	1                               # DW_AT_decl_line153	.long	50                              # DW_AT_type154                                        # DW_AT_external155	.byte	3                               # Abbrev [3] 0x32:0x4 DW_TAG_base_type156	.byte	4                               # DW_AT_name157	.byte	5                               # DW_AT_encoding158	.byte	4                               # DW_AT_byte_size159	.byte	0                               # End Of Children Mark160.Ldebug_info_end0:161	.section	.debug_str_offsets,"",@progbits162	.long	24                              # Length of String Offsets Set163	.short	5164	.short	0165.Lstr_offsets_base0:166	.section	.debug_str,"MS",@progbits,1167.Linfo_string0:168	.asciz	"clang version 15.0.0" # string offset=0169.Linfo_string1:170	.asciz	"main.cpp"                      # string offset=134171.Linfo_string2:172	.asciz	"." # string offset=143173.Linfo_string3:174	.asciz	"main"                          # string offset=180175.Linfo_string4:176	.asciz	"int"                           # string offset=185177	.section	.debug_str_offsets,"",@progbits178	.long	.Linfo_string0179	.long	.Linfo_string1180	.long	.Linfo_string2181	.long	.Linfo_string3182	.long	.Linfo_string4183	.section	.debug_addr,"",@progbits184	.long	.Ldebug_addr_end0-.Ldebug_addr_start0 # Length of contribution185.Ldebug_addr_start0:186	.short	5                               # DWARF version number187	.byte	8                               # Address size188	.byte	0                               # Segment selector size189.Laddr_table_base0:190	.quad	.Lfunc_begin0191.Ldebug_addr_end0:192	.ident	"clang version 15.0.0"193	.section	".note.GNU-stack","",@progbits194	.addrsig195	.section	.debug_line,"",@progbits196.Lline_table_start0:197