xref: /llvm-project/bolt/test/X86/shared-abbrev.s (revision 87fb0ea27eebceaa1aa1ab0b6ede9689265178e0)
1# RUN: rm -rf %t
2# RUN: mkdir %t
3# RUN: llvm-mc -filetype=obj -triple=x86_64 -dwarf-version=4 %s -o %t/shared-abbrev.o
4# RUN: %clang %cflags %t/shared-abbrev.o -o %t/shared-abbrev.exe
5# RUN: llvm-bolt %t/shared-abbrev.exe -o %t/shared-abbrev.exe.bolt --update-debug-sections
6# RUN: llvm-dwarfdump --debug-info %t/shared-abbrev.exe.bolt | FileCheck %s
7
8# CHECK: 0x00000000:
9# CHECK-SAME: abbr_offset = 0x0000
10# CHECK-EMPTY:
11# CHECK-NEXT: 		DW_TAG_compile_unit
12# CHECK-NEXT: 		DW_AT_stmt_list
13# CHECK-NEXT: 		DW_AT_low_pc
14# CHECK-NEXT: 		DW_AT_ranges
15# CHECK: 0x0000001c:
16# CHECK-SAME: abbr_offset = 0x0000
17# CHECK-EMPTY:
18# CHECK:		DW_TAG_compile_unit
19# CHECK-NEXT: 		DW_AT_stmt_list
20# CHECK-NEXT: 		DW_AT_low_pc
21# CHECK-NEXT: 		DW_AT_ranges
22# CHECK: 0x00000038:
23# CHECK-SAME: abbr_offset = 0x0000
24# CHECK-EMPTY:
25# CHECK-NEXT: 		DW_TAG_compile_unit
26# CHECK-NEXT: 		DW_AT_stmt_list
27# CHECK-NEXT: 		DW_AT_low_pc
28# CHECK-NEXT: 		DW_AT_ranges
29
30	.text
31	.file	"main.cpp"
32	.globl	main                            # -- Begin function main
33	.p2align	4, 0x90
34	.type	main,@function
35main:                                   # @main
36.Lfunc_begin0:
37	.file	1 "test" "main.cpp"
38	.loc	1 1 0                           # main.cpp:1:0
39	.cfi_startproc
40	.cfi_def_cfa %rsp, 8
41	retq
42.Ltmp1:
43.Lfunc_end0:
44	.size	main, .Lfunc_end0-main
45	.cfi_endproc
46                                        # -- End function
47  .section	.debug_abbrev,"",@progbits
48  .byte	1                               # Abbreviation Code
49  .byte	17                              # DW_TAG_compile_unit
50  .byte	0                               # DW_CHILDREN_no
51  .byte	16                              # DW_AT_stmt_list
52  .byte	23                              # DW_FORM_sec_offset
53  .byte	17                              # DW_AT_low_pc
54  .byte	1                               # DW_FORM_addr
55  .byte	18                              # DW_AT_high_pc
56  .byte	7                               # DW_FORM_data8
57  .byte	0                               # EOM(1)
58  .byte	0                               # EOM(2)
59  .byte 2                               # Abbreviation Code
60  .byte 17                              # DW_TAG_compile_unit
61  .byte 0                               # DW_CHILDREN_no
62  .byte 16                              # DW_AT_stmt_list
63  .byte 23                              # DW_FORM_sec_offset
64  .byte 17                              # DW_AT_low_pc
65  .byte 1                               # DW_FORM_addr
66  .byte 85                              # DW_AT_ranges
67  .byte 23                              # DW_FORM_sec_offset
68  .byte 0                               # EOM(1)
69  .byte 0                               # EOM(2)
70  .byte	0                               # EOM(3)
71  .section	.debug_info,"",@progbits
72.Lcu_begin0:
73	.long	.Ldebug_info_end0-.Ldebug_info_start0 # Length of Unit
74.Ldebug_info_start0:
75	.short  4                               # DWARF version number
76  .long .debug_abbrev                   # Offset Into Abbrev. Section
77  .byte 8                               # Address Size (in bytes)
78  .byte 2                               # Abbrev [2] DW_TAG_compile_unit
79  .long .Lline_table_start0             # DW_AT_stmt_list
80  .quad 0                               # DW_AT_low_pc
81  .long .Ldebug_ranges0                 # DW_AT_ranges --- end manual --
82.Ldebug_info_end0:
83
84   # Second CU table.
85   .long   .Ldebug_info_end1-.Ldebug_info_start1 # Length of Unit
86.Ldebug_info_start1:
87  .short	4                               # DWARF version number
88	.long	.debug_abbrev                   # Offset Into Abbrev. Section
89	.byte	8                               # Address Size (in bytes)
90	.byte	1                               # Abbrev [1] DW_TAG_compile_unit
91	.long	.Lline_table_start0             # DW_AT_stmt_list
92	.quad	.Lfunc_begin0                   # DW_AT_low_pc
93	.quad	.Lfunc_end0-.Lfunc_begin0       # DW_AT_high_pc
94  .byte 0                               # End Of Children Mark
95.Ldebug_info_end1:
96
97   # Third CU table.
98   .long   .Ldebug_info_end2-.Ldebug_info_start2 # Length of Unit
99.Ldebug_info_start2:
100	.short  4                               # DWARF version number
101  .long .debug_abbrev                   # Offset Into Abbrev. Section
102  .byte 8                               # Address Size (in bytes)
103  .byte 2                               # Abbrev [2] DW_TAG_compile_unit
104  .long .Lline_table_start0             # DW_AT_stmt_list
105  .quad 0                               # DW_AT_low_pc
106  .long .Ldebug_ranges0                 # DW_AT_ranges --- end manual --
107.Ldebug_info_end2:
108  .section  .debug_ranges,"",@progbits
109.Ldebug_ranges0:
110  .quad .Lfunc_begin0
111  .quad .Lfunc_end0
112  .quad .Lfunc_begin0
113  .quad .Lfunc_end0
114  .quad 0
115  .quad 0
116  .section	".note.GNU-stack","",@progbits
117  .addrsig
118  .section	.debug_line,"",@progbits
119.Lline_table_start0:
120