brintos

brintos / llvm-project-archived public Read only

0
0
Text · 6.3 KiB · dc86db0 Raw
148 lines · plain
1# This tests a bug where we would incorrectly parse the size of an array if that2# size happened to match an existing DIE offset. This happened because we3# misinterpreted that value as a reference to a DIE specifying the VLA size even4# though the form was a data form (as it should be).5 6# REQUIRES: lld7 8# RUN: llvm-mc -triple x86_64-pc-linux %s -filetype=obj > %t.o9# RUN: ld.lld %t.o -o %t10# RUN: lldb-test symbols %t | FileCheck %s11 12# CHECK: Variable{0x0000001e}, name = "X"13# CHECK-SAME: type = {0000000000000033} 0x{{[0-9A-F]*}} (char[56])14 15 16# Generated from "char X[47];"17# The array size was modified by hand.18 19	.text20	.file	"-"21	.file	1 "/tmp" "<stdin>"22	.type	X,@object               # @X23	.comm	X,63,1624	.section	.debug_str,"MS",@progbits,125.Linfo_string0:26	.asciz	"clang version 8.0.0 (trunk 349604) (llvm/trunk 349608)" # string offset=027.Linfo_string1:28	.asciz	"-"                     # string offset=5529.Linfo_string2:30	.asciz	"/tmp"                  # string offset=5731.Linfo_string3:32	.asciz	"X"                     # string offset=6233.Linfo_string4:34	.asciz	"char"                  # string offset=6435.Linfo_string5:36	.asciz	"__ARRAY_SIZE_TYPE__"   # string offset=6937	.section	.debug_abbrev,"",@progbits38	.byte	1                       # Abbreviation Code39	.byte	17                      # DW_TAG_compile_unit40	.byte	1                       # DW_CHILDREN_yes41	.byte	37                      # DW_AT_producer42	.byte	14                      # DW_FORM_strp43	.byte	19                      # DW_AT_language44	.byte	5                       # DW_FORM_data245	.byte	3                       # DW_AT_name46	.byte	14                      # DW_FORM_strp47	.byte	16                      # DW_AT_stmt_list48	.byte	23                      # DW_FORM_sec_offset49	.byte	27                      # DW_AT_comp_dir50	.byte	14                      # DW_FORM_strp51	.byte	0                       # EOM(1)52	.byte	0                       # EOM(2)53	.byte	2                       # Abbreviation Code54	.byte	52                      # DW_TAG_variable55	.byte	0                       # DW_CHILDREN_no56	.byte	3                       # DW_AT_name57	.byte	14                      # DW_FORM_strp58	.byte	73                      # DW_AT_type59	.byte	19                      # DW_FORM_ref460	.byte	63                      # DW_AT_external61	.byte	25                      # DW_FORM_flag_present62	.byte	58                      # DW_AT_decl_file63	.byte	11                      # DW_FORM_data164	.byte	59                      # DW_AT_decl_line65	.byte	11                      # DW_FORM_data166	.byte	2                       # DW_AT_location67	.byte	24                      # DW_FORM_exprloc68	.byte	0                       # EOM(1)69	.byte	0                       # EOM(2)70	.byte	3                       # Abbreviation Code71	.byte	1                       # DW_TAG_array_type72	.byte	1                       # DW_CHILDREN_yes73	.byte	73                      # DW_AT_type74	.byte	19                      # DW_FORM_ref475	.byte	0                       # EOM(1)76	.byte	0                       # EOM(2)77	.byte	4                       # Abbreviation Code78	.byte	33                      # DW_TAG_subrange_type79	.byte	0                       # DW_CHILDREN_no80	.byte	73                      # DW_AT_type81	.byte	19                      # DW_FORM_ref482	.byte	55                      # DW_AT_count83	.byte	11                      # DW_FORM_data184	.byte	0                       # EOM(1)85	.byte	0                       # EOM(2)86	.byte	5                       # Abbreviation Code87	.byte	36                      # DW_TAG_base_type88	.byte	0                       # DW_CHILDREN_no89	.byte	3                       # DW_AT_name90	.byte	14                      # DW_FORM_strp91	.byte	62                      # DW_AT_encoding92	.byte	11                      # DW_FORM_data193	.byte	11                      # DW_AT_byte_size94	.byte	11                      # DW_FORM_data195	.byte	0                       # EOM(1)96	.byte	0                       # EOM(2)97	.byte	6                       # Abbreviation Code98	.byte	36                      # DW_TAG_base_type99	.byte	0                       # DW_CHILDREN_no100	.byte	3                       # DW_AT_name101	.byte	14                      # DW_FORM_strp102	.byte	11                      # DW_AT_byte_size103	.byte	11                      # DW_FORM_data1104	.byte	62                      # DW_AT_encoding105	.byte	11                      # DW_FORM_data1106	.byte	0                       # EOM(1)107	.byte	0                       # EOM(2)108	.byte	0                       # EOM(3)109	.section	.debug_info,"",@progbits110.Lcu_begin0:111	.long	.Ldebug_info_end0-.Ldebug_info_start0 # Length of Unit112.Ldebug_info_start0:113	.short	4                       # DWARF version number114	.long	.debug_abbrev           # Offset Into Abbrev. Section115	.byte	8                       # Address Size (in bytes)116	.byte	1                       # Abbrev [1] 0xb:0x43 DW_TAG_compile_unit117	.long	.Linfo_string0          # DW_AT_producer118	.short	12                      # DW_AT_language119	.long	.Linfo_string1          # DW_AT_name120	.long	0                       # DW_AT_stmt_list121	.long	.Linfo_string2          # DW_AT_comp_dir122	.byte	2                       # Abbrev [2] 0x1e:0x15 DW_TAG_variable123	.long	.Linfo_string3          # DW_AT_name124	.long	51                      # DW_AT_type125                                        # DW_AT_external126	.byte	1                       # DW_AT_decl_file127	.byte	1                       # DW_AT_decl_line128	.byte	9                       # DW_AT_location129	.byte	3130	.quad	X131	.byte	3                       # Abbrev [3] 0x33:0xc DW_TAG_array_type132	.long	63                      # DW_AT_type133.Ldie:134	.byte	4                       # Abbrev [4] 0x38:0x6 DW_TAG_subrange_type135	.long	70                      # DW_AT_type136	.byte	.Ldie-.Lcu_begin0       # DW_AT_count - should match the offset of an existing die137	.byte	0                       # End Of Children Mark138	.byte	5                       # Abbrev [5] 0x3f:0x7 DW_TAG_base_type139	.long	.Linfo_string4          # DW_AT_name140	.byte	6                       # DW_AT_encoding141	.byte	1                       # DW_AT_byte_size142	.byte	6                       # Abbrev [6] 0x46:0x7 DW_TAG_base_type143	.long	.Linfo_string5          # DW_AT_name144	.byte	8                       # DW_AT_byte_size145	.byte	7                       # DW_AT_encoding146	.byte	0                       # End Of Children Mark147.Ldebug_info_end0:148