1 # RUN: llvm-mc %s -filetype obj -triple x86_64-pc-linux -o %t.o
2 # RUN: llvm-dwarfdump %t.o | FileCheck %s
3 # RUN: not llvm-dwarfdump -verify %t.o
5 # CHECK: DW_AT_location (DW_OP_addr 0x{{[0-9a-f]+}}, DW_OP_convert <invalid base_type ref: 0x{{[0-9a-f]+}}>, DW_OP_convert (0x{{[0-9a-f]+}}) "DW_ATE_signed_32")
10 .type global,@object # @global
18 .section .debug_str,"MS",@progbits,1
20 .asciz "clang version 9.0.0 (trunk 354265) (llvm/trunk 354264)" # string offset=0
22 .asciz "dbg.g.c" # string offset=55
24 .asciz "/tmp" # string offset=63
26 .asciz "global" # string offset=68
28 .asciz "int" # string offset=75
30 .asciz "DW_ATE_signed_32" # string offset=79
32 .asciz "DW_ATE_signed_8" # string offset=96
33 .section .debug_abbrev,"",@progbits
34 .byte 1 # Abbreviation Code
35 .byte 17 # DW_TAG_compile_unit
36 .byte 1 # DW_CHILDREN_yes
37 .byte 37 # DW_AT_producer
38 .byte 14 # DW_FORM_strp
39 .byte 19 # DW_AT_language
40 .byte 5 # DW_FORM_data2
42 .byte 14 # DW_FORM_strp
43 .byte 16 # DW_AT_stmt_list
44 .byte 23 # DW_FORM_sec_offset
45 .byte 27 # DW_AT_comp_dir
46 .byte 14 # DW_FORM_strp
49 .byte 2 # Abbreviation Code
50 .byte 36 # DW_TAG_base_type
51 .byte 0 # DW_CHILDREN_no
53 .byte 14 # DW_FORM_strp
54 .byte 62 # DW_AT_encoding
55 .byte 11 # DW_FORM_data1
56 .byte 11 # DW_AT_byte_size
57 .byte 11 # DW_FORM_data1
60 .byte 3 # Abbreviation Code
61 .byte 52 # DW_TAG_variable
62 .byte 0 # DW_CHILDREN_no
64 .byte 14 # DW_FORM_strp
66 .byte 19 # DW_FORM_ref4
67 .byte 63 # DW_AT_external
68 .byte 25 # DW_FORM_flag_present
69 .byte 58 # DW_AT_decl_file
70 .byte 11 # DW_FORM_data1
71 .byte 59 # DW_AT_decl_line
72 .byte 11 # DW_FORM_data1
73 .byte 2 # DW_AT_location
74 .byte 24 # DW_FORM_exprloc
78 .section .debug_info,"",@progbits
80 .long .Ldebug_info_end0-.Ldebug_info_start0 # Length of Unit
82 .short 4 # DWARF version number
83 .long .debug_abbrev # Offset Into Abbrev. Section
84 .byte 8 # Address Size (in bytes)
85 .byte 1 # Abbrev [1] 0xb:0x48 DW_TAG_compile_unit
86 .long .Linfo_string0 # DW_AT_producer
87 .short 12 # DW_AT_language
88 .long .Linfo_string1 # DW_AT_name
89 .long .Lline_table_start0 # DW_AT_stmt_list
90 .long .Linfo_string2 # DW_AT_comp_dir
91 .byte 2 # Abbrev [2] 0x1e:0x7 DW_TAG_base_type
92 .long .Linfo_string6 # DW_AT_name
93 .byte 5 # DW_AT_encoding
94 .byte 1 # DW_AT_byte_size
95 .byte 2 # Abbrev [2] 0x25:0x7 DW_TAG_base_type
96 .long .Linfo_string5 # DW_AT_name
97 .byte 5 # DW_AT_encoding
98 .byte 4 # DW_AT_byte_size
99 .byte 3 # Abbrev [3] 0x2c:0x1f DW_TAG_variable
100 .long .Linfo_string3 # DW_AT_name
101 .long 75 # DW_AT_type
103 .byte 1 # DW_AT_decl_file
104 .byte 1 # DW_AT_decl_line
105 .byte 19 # DW_AT_location
109 .asciz "\235\200\200" ### This offset is off by one to test the invalid base_type ref printout
111 .asciz "\245\200\200"
112 .byte 2 # Abbrev [2] 0x4b:0x7 DW_TAG_base_type
113 .long .Linfo_string4 # DW_AT_name
114 .byte 5 # DW_AT_encoding
115 .byte 4 # DW_AT_byte_size
116 .byte 0 # End Of Children Mark
118 .section .debug_macinfo,"",@progbits
119 .byte 0 # End Of Macro List Mark
121 .ident "clang version 9.0.0 (trunk 354265) (llvm/trunk 354264)"
122 .section ".note.GNU-stack","",@progbits
123 .section .debug_line,"",@progbits