Revert r354244 "[DAGCombiner] Eliminate dead stores to stack."
[llvm-complete.git] / test / tools / llvm-dwarfdump / X86 / verify_debug_info.s
blobe3eae9b986f5fa5e2aeefe6041f4cefd114e1dfd
1 # RUN: llvm-mc %s -filetype obj -triple x86_64-apple-darwin -o - \
2 # RUN: | not llvm-dwarfdump -v -verify - \
3 # RUN: | FileCheck %s
5 # CHECK: error: DIE has invalid DW_AT_stmt_list encoding:{{[[:space:]]}}
6 # CHECK-NEXT: 0x0000000c: DW_TAG_compile_unit [1] *
7 # CHECK-NEXT: DW_AT_producer [DW_FORM_strp] ( .debug_str[0x00000000] = "clang version 5.0.0 (trunk 308185) (llvm/trunk 308186)")
8 # CHECK-NEXT: DW_AT_language [DW_FORM_data2] (DW_LANG_C99)
9 # CHECK-NEXT: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000037] = "basic.c")
10 # CHECK-NEXT: DW_AT_stmt_list [DW_FORM_block4]
11 # CHECK-NEXT: DW_AT_comp_dir [DW_FORM_strp] ( .debug_str[0x0000003f] = "/Users/sgravani/Development/tests")
12 # CHECK-NEXT: DW_AT_low_pc [DW_FORM_addr] (0x0000000000000000)
13 # CHECK-NEXT: DW_AT_high_pc [DW_FORM_data4] (0x00000016){{[[:space:]]}}
14 # CHECK-NEXT: error: DIE has DW_AT_type with incompatible tag DW_TAG_null{{[[:space:]]}}
15 # CHECK-NEXT: 0x0000002b: DW_TAG_subprogram [2] *
16 # CHECK-NEXT: DW_AT_low_pc [DW_FORM_addr] (0x0000000000000000)
17 # CHECK-NEXT: DW_AT_high_pc [DW_FORM_data4] (0x00000016)
18 # CHECK-NEXT: DW_AT_frame_base [DW_FORM_exprloc] (DW_OP_reg6)
19 # CHECK-NEXT: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000061] = "main")
20 # CHECK-NEXT: DW_AT_decl_file [DW_FORM_data1] (0x01)
21 # CHECK-NEXT: DW_AT_decl_line [DW_FORM_data1] (1)
22 # CHECK-NEXT: DW_AT_prototyped [DW_FORM_flag_present] (true)
23 # CHECK-NEXT: DW_AT_type [DW_FORM_ref4] (cu + 0x0052 => {0x00000052} "")
24 # CHECK-NEXT: DW_AT_external [DW_FORM_flag_present] (true){{[[:space:]]}}
25 # CHECK-NEXT: error: DIE with tag DW_TAG_variable is missing type attribute:{{[[:space:]]}}
26 # CHECK-NEXT: 0x00000044: DW_TAG_variable [3]
27 # CHECK-NEXT: DW_AT_location [DW_FORM_exprloc] (DW_OP_fbreg -8)
28 # CHECK-NEXT: DW_AT_name [DW_FORM_strp] ( .debug_str[0x0000006a] = "a")
29 # CHECK-NEXT: DW_AT_decl_file [DW_FORM_data1] (0x01)
30 # CHECK-NEXT: DW_AT_decl_line [DW_FORM_data1] (2)
31 # CHECK-NEXT: DW_AT_use_location [DW_FORM_ref4] (cu + 0x0053 => {0x00000053}){{[[:space:]]}}
32 # CHECK-NEXT: error: Compilation unit root DIE is not a unit DIE: DW_TAG_null.
33 # CHECK-NEXT: error: Compilation unit type (DW_UT_compile) and root DIE (DW_TAG_null) do not match.
34 # CHECK-NEXT: error: Units[2] - start offset: 0x00000068
35 # CHECK-NEXT: note: The length for this unit is too large for the .debug_info provided.
36 # CHECK-NEXT: note: The unit type encoding is not valid.
39 .section __TEXT,__text,regular,pure_instructions
40 .globl _main ## -- Begin function main
41 .p2align 4, 0x90
42 _main: ## @main
43 Lfunc_begin0:
44 .file 1 "basic.c"
45 .loc 1 1 0 ## basic.c:1:0
46 .cfi_startproc
47 ## %bb.0: ## %entry
48 pushq %rbp
49 .cfi_def_cfa_offset 16
50 .cfi_offset %rbp, -16
51 movq %rsp, %rbp
52 .cfi_def_cfa_register %rbp
53 xorl %eax, %eax
54 movl $0, -4(%rbp)
55 Ltmp0:
56 .loc 1 2 7 prologue_end ## basic.c:2:7
57 movl $1, -8(%rbp)
58 .loc 1 3 3 ## basic.c:3:3
59 popq %rbp
60 retq
61 Ltmp1:
62 Lfunc_end0:
63 .cfi_endproc
64 ## -- End function
65 .section __DWARF,__debug_str,regular,debug
66 Linfo_string:
67 .asciz "clang version 5.0.0 (trunk 308185) (llvm/trunk 308186)" ## string offset=0
68 .asciz "basic.c" ## string offset=55
69 .asciz "/Users/sgravani/Development/tests" ## string offset=63
70 .asciz "main" ## string offset=97
71 .asciz "int" ## string offset=102
72 .asciz "a" ## string offset=106
73 .section __DWARF,__debug_abbrev,regular,debug
74 Lsection_abbrev:
75 .byte 1 ## Abbreviation Code
76 .byte 17 ## DW_TAG_compile_unit
77 .byte 1 ## DW_CHILDREN_yes
78 .byte 37 ## DW_AT_producer
79 .byte 14 ## DW_FORM_strp
80 .byte 19 ## DW_AT_language
81 .byte 5 ## DW_FORM_data2
82 .byte 3 ## DW_AT_name
83 .byte 14 ## DW_FORM_strp
84 .byte 16 ## DW_AT_stmt_list
85 .byte 4 ## DW_FORM_sec_offset -- error: DIE has invalid DW_AT_stmt_list encoding:
86 .byte 27 ## DW_AT_comp_dir
87 .byte 14 ## DW_FORM_strp
88 .byte 17 ## DW_AT_low_pc
89 .byte 1 ## DW_FORM_addr
90 .byte 18 ## DW_AT_high_pc
91 .byte 6 ## DW_FORM_data4
92 .byte 0 ## EOM(1)
93 .byte 0 ## EOM(2)
94 .byte 2 ## Abbreviation Code
95 .byte 46 ## DW_TAG_subprogram
96 .byte 1 ## DW_CHILDREN_yes
97 .byte 17 ## DW_AT_low_pc
98 .byte 1 ## DW_FORM_addr
99 .byte 18 ## DW_AT_high_pc
100 .byte 6 ## DW_FORM_data4
101 .byte 64 ## DW_AT_frame_base
102 .byte 24 ## DW_FORM_exprloc
103 .byte 3 ## DW_AT_name
104 .byte 14 ## DW_FORM_strp
105 .byte 58 ## DW_AT_decl_file
106 .byte 11 ## DW_FORM_data1
107 .byte 59 ## DW_AT_decl_line
108 .byte 11 ## DW_FORM_data1
109 .byte 39 ## DW_AT_prototyped
110 .byte 25 ## DW_FORM_flag_present
111 .byte 73 ## DW_AT_type
112 .byte 19 ## DW_FORM_ref4
113 .byte 63 ## DW_AT_external
114 .byte 25 ## DW_FORM_flag_present
115 .byte 0 ## EOM(1)
116 .byte 0 ## EOM(2)
117 .byte 3 ## Abbreviation Code
118 .byte 52 ## DW_TAG_variable
119 .byte 0 ## DW_CHILDREN_no
120 .byte 2 ## DW_AT_location
121 .byte 24 ## DW_FORM_exprloc
122 .byte 3 ## DW_AT_name
123 .byte 14 ## DW_FORM_strp
124 .byte 58 ## DW_AT_decl_file
125 .byte 11 ## DW_FORM_data1
126 .byte 59 ## DW_AT_decl_line
127 .byte 11 ## DW_FORM_data1
128 .byte 74 ## DW_AT_type
129 .byte 19 ## DW_FORM_ref4
130 .byte 0 ## EOM(1)
131 .byte 0 ## EOM(2)
132 .byte 4 ## Abbreviation Code
133 .byte 36 ## DW_TAG_base_type
134 .byte 0 ## DW_CHILDREN_no
135 .byte 3 ## DW_AT_name
136 .byte 14 ## DW_FORM_strp
137 .byte 62 ## DW_AT_encoding
138 .byte 11 ## DW_FORM_data1
139 .byte 11 ## DW_AT_byte_size
140 .byte 11 ## DW_FORM_data1
141 .byte 0 ## EOM(1)
142 .byte 0 ## EOM(2)
143 .byte 0 ## EOM(3)
144 .section __DWARF,__debug_info,regular,debug
145 Lsection_info:
146 Lcu_begin0:
147 .long 87 ## Length of Unit
148 .short 5 ## DWARF version number
149 .byte 1 ## DWARF Unit Type
150 .byte 8 ## Address Size (in bytes)
151 Lset0 = Lsection_abbrev-Lsection_abbrev ## Offset Into Abbrev. Section
152 .long Lset0
153 .byte 1 ## Abbrev [1] 0xc:0x4f DW_TAG_compile_unit
154 .long 0 ## DW_AT_producer
155 .short 12 ## DW_AT_language
156 .long 55 ## DW_AT_name
157 Lset1 = Lline_table_start0-Lsection_line ## DW_AT_stmt_list
158 .long Lset1
159 .long 63 ## DW_AT_comp_dir
160 .quad Lfunc_begin0 ## DW_AT_low_pc
161 Lset2 = Lfunc_end0-Lfunc_begin0 ## DW_AT_high_pc
162 .long Lset2
163 .byte 2 ## Abbrev [2] 0x2b:0x28 DW_TAG_subprogram
164 .quad Lfunc_begin0 ## DW_AT_low_pc
165 Lset3 = Lfunc_end0-Lfunc_begin0 ## DW_AT_high_pc
166 .long Lset3
167 .byte 1 ## DW_AT_frame_base
168 .byte 86
169 .long 97 ## DW_AT_name
170 .byte 1 ## DW_AT_decl_file
171 .byte 1 ## DW_AT_decl_line
172 ## DW_AT_prototyped
173 .long 82 ## DW_AT_type
174 ## DW_AT_external
175 .byte 3 ## Abbrev [3] 0x44:0xe DW_TAG_variable
176 .byte 2 ## DW_AT_location
177 .byte 145
178 .byte 120
179 .long 106 ## DW_AT_name
180 .byte 1 ## DW_AT_decl_file
181 .byte 2 ## DW_AT_decl_line
182 .long 83 ## DW_AT_type
183 .byte 0 ## End Of Children Mark
184 .byte 4 ## Abbrev [4] 0x53:0x7 DW_TAG_base_type
185 .long 102 ## DW_AT_name
186 .byte 5 ## DW_AT_encoding
187 .byte 4 ## DW_AT_byte_size
188 .byte 0 ## End Of Children Mark
189 Lcu_begin1:
190 .long 9 ## Length of Unit
191 .short 5 ## DWARF version number
192 .byte 1 ## DWARF Unit Type
193 .byte 4 ## Address Size (in bytes)
194 .long 0 ## Abbrev offset
195 .byte 0
196 Ltu_begin0:
197 .long 26 ## Length of Unit -- Error: The length for this unit is too large for the .debug_info provided.
198 .short 5 ## DWARF version number
199 .byte 0 ## DWARF Unit Type
200 .byte 4 ## Address Size (in bytes)
201 .long 0
202 .quad 0
203 .long 0
204 .byte 0
206 .subsections_via_symbols
207 .section __DWARF,__debug_line,regular,debug
208 Lsection_line:
209 Lline_table_start0: