[obj2yaml] - Fix a comment. NFC.
[llvm-complete.git] / test / MC / MachO / gen-dwarf.s
blob0813856d625f6f033c0d0e402b725bbcd2364686
1 // RUN: llvm-mc -g -triple i386-apple-darwin10 %s -filetype=obj -o %t
2 // RUN: llvm-dwarfdump -all %t | FileCheck %s
4 .globl _bar
5 _bar:
6 movl $0, %eax
7 L1: leave
8 ret
9 _foo:
10 _baz:
11 nop
12 .data
13 _x: .long 1
15 // CHECK: file format Mach-O 32-bit i386
17 // CHECK: .debug_abbrev contents:
18 // CHECK: Abbrev table for offset: 0x00000000
19 // CHECK: [1] DW_TAG_compile_unit DW_CHILDREN_yes
20 // CHECK: DW_AT_stmt_list DW_FORM_sec_offset
21 // CHECK: DW_AT_low_pc DW_FORM_addr
22 // CHECK: DW_AT_high_pc DW_FORM_addr
23 // CHECK: DW_AT_name DW_FORM_string
24 // CHECK: DW_AT_comp_dir DW_FORM_string
25 // CHECK: DW_AT_producer DW_FORM_string
26 // CHECK: DW_AT_language DW_FORM_data2
28 // CHECK: [2] DW_TAG_label DW_CHILDREN_yes
29 // CHECK: DW_AT_name DW_FORM_string
30 // CHECK: DW_AT_decl_file DW_FORM_data4
31 // CHECK: DW_AT_decl_line DW_FORM_data4
32 // CHECK: DW_AT_low_pc DW_FORM_addr
33 // CHECK: DW_AT_prototyped DW_FORM_flag
35 // CHECK: [3] DW_TAG_unspecified_parameters DW_CHILDREN_no
38 // CHECK: .debug_info contents:
40 // We don't check the leading addresses these are at.
41 // CHECK: DW_TAG_compile_unit
42 // CHECK: DW_AT_stmt_list (0x00000000)
43 // CHECK: DW_AT_low_pc (0x0000000000000000)
44 // CHECK: DW_AT_high_pc (0x0000000000000008)
45 // We don't check the file name as it is a temp directory
46 // CHECK: DW_AT_name
47 // We don't check the DW_AT_comp_dir which is the current working directory
48 // CHECK: DW_AT_producer ("llvm-mc (based on {{.*}})")
49 // CHECK: DW_AT_language (DW_LANG_Mips_Assembler)
51 // CHECK: DW_TAG_label
52 // CHECK: DW_AT_name ("bar")
53 // CHECK: DW_AT_decl_file ([[FILE:".*gen-dwarf.s"]])
54 // CHECK: DW_AT_decl_line (5)
55 // CHECK: DW_AT_low_pc (0x0000000000000000)
56 // CHECK: DW_AT_prototyped (0x00)
58 // CHECK: DW_TAG_unspecified_parameters
60 // CHECK: NULL
62 // CHECK: DW_TAG_label
63 // CHECK: DW_AT_name ("foo")
64 // CHECK: DW_AT_decl_file ([[FILE]])
65 // CHECK: DW_AT_decl_line (9)
66 // CHECK: DW_AT_low_pc (0x0000000000000007)
67 // CHECK: DW_AT_prototyped (0x00)
69 // CHECK: DW_TAG_unspecified_parameters
71 // CHECK: NULL
73 // CHECK: DW_TAG_label
74 // CHECK: DW_AT_name ("baz")
75 // CHECK: DW_AT_decl_file ([[FILE]])
76 // CHECK: DW_AT_decl_line (10)
77 // CHECK: DW_AT_low_pc (0x0000000000000007)
78 // CHECK: DW_AT_prototyped (0x00)
80 // CHECK: DW_TAG_unspecified_parameters
82 // CHECK: NULL
84 // CHECK: NULL
86 // CHECK: .debug_aranges contents:
87 // CHECK: Address Range Header: length = 0x0000001c, version = 0x0002, cu_offset = 0x00000000, addr_size = 0x04, seg_size = 0x00
89 // CHECK: .debug_line contents:
90 // CHECK: Line table prologue:
91 // We don't check the total_length as it includes lengths of temp paths
92 // CHECK: version: 4
93 // We don't check the prologue_length as it too includes lengths of temp paths
94 // CHECK: min_inst_length: 1
95 // CHECK: default_is_stmt: 1
96 // CHECK: line_base: -5
97 // CHECK: line_range: 14
98 // CHECK: opcode_base: 13
99 // CHECK: standard_opcode_lengths[DW_LNS_copy] = 0
100 // CHECK: standard_opcode_lengths[DW_LNS_advance_pc] = 1
101 // CHECK: standard_opcode_lengths[DW_LNS_advance_line] = 1
102 // CHECK: standard_opcode_lengths[DW_LNS_set_file] = 1
103 // CHECK: standard_opcode_lengths[DW_LNS_set_column] = 1
104 // CHECK: standard_opcode_lengths[DW_LNS_negate_stmt] = 0
105 // CHECK: standard_opcode_lengths[DW_LNS_set_basic_block] = 0
106 // CHECK: standard_opcode_lengths[DW_LNS_const_add_pc] = 0
107 // CHECK: standard_opcode_lengths[DW_LNS_fixed_advance_pc] = 1
108 // CHECK: standard_opcode_lengths[DW_LNS_set_prologue_end] = 0
109 // CHECK: standard_opcode_lengths[DW_LNS_set_epilogue_begin] = 0
110 // CHECK: standard_opcode_lengths[DW_LNS_set_isa] = 1
111 // We don't check include_directories as it has a temp path
112 // CHECK: file_names[ 1]:
113 // CHECK-NEXT: name: "gen-dwarf.s"
114 // CHECK-NEXT: dir_index: 1
116 // CHECK: Address Line Column File ISA Discriminator Flags
117 // CHECK: ------------------ ------ ------ ------ --- ------------- -------------
118 // CHECK: 0x0000000000000000 6 0 1 0 0 is_stmt
119 // CHECK: 0x0000000000000005 7 0 1 0 0 is_stmt
120 // CHECK: 0x0000000000000006 8 0 1 0 0 is_stmt
121 // CHECK: 0x0000000000000007 11 0 1 0 0 is_stmt
122 // CHECK: 0x0000000000000008 11 0 1 0 0 is_stmt end_sequence