xref: /llvm-project/bolt/test/X86/dwarf4-gdb-index-types-lld-generated.test (revision 11791ae7b0b05b8bd8d806331ff51da618912cf8)
1# REQUIRES: system-linux
2
3# RUN: llvm-mc -dwarf-version=4 -filetype=obj -triple x86_64-unknown-linux %p/Inputs/dwarf4-gdb-index-types-main.s -o %tmain.o
4# RUN: llvm-mc -dwarf-version=4 -filetype=obj -triple x86_64-unknown-linux %p/Inputs/dwarf4-gdb-index-types-helper.s -o %thelper.o
5# RUN: %clang %cflags %tmain.o %thelper.o -o %t.exe -Wl,-q -Wl,--gdb-index -nostdlib
6# RUN: llvm-bolt %t.exe -o %t.bolt --update-debug-sections
7# RUN: llvm-dwarfdump --gdb-index %t.bolt | FileCheck --check-prefix=POSTCHECK %s
8
9## Tests that BOLT correctly handles gdb-index generated by LLD.
10
11# POSTCHECK:          Version = 7
12# POSTCHECK:          CU list offset = 0x18, has 2 entries
13# POSTCHECK-NEXT:         0: Offset = 0x0, Length = 0x6e
14# POSTCHECK-NEXT:         1: Offset = 0x6e, Length = 0x72
15# POSTCHECK:          Types CU list offset = 0x38, has 0 entries
16# POSTCHECK:          Address area offset = 0x38, has 2 entries
17# POSTCHECK-NEXT:         Low/High address = [0x[[#%.4x,ADDR:]],
18# POSTCHECK-SAME:           0x[[#ADDR + 0xf]]) (Size: 0xf), CU id = 0
19# POSTCHECK-NEXT:         Low/High address = [0x[[#%.4x,ADDR1:]],
20# POSTCHECK-SAME:           0x[[#ADDR1 + 0xd]]) (Size: 0xd), CU id = 1
21# POSTCHECK:          Symbol table offset = 0x60, size = 1024, filled slots
22# POSTCHECK-NEXT:         2: Name offset = 0x38, CU vector offset = 0x0
23# POSTCHECK-NEXT:             String name: S, CU vector index: 0
24# POSTCHECK-NEXT:         71: Name offset = 0x3a, CU vector offset = 0x8
25# POSTCHECK-NEXT:             String name: S2, CU vector index: 1
26# POSTCHECK-NEXT:         489: Name offset = 0x4a, CU vector offset = 0x1c
27# POSTCHECK-NEXT:             String name: main, CU vector index: 3
28# POSTCHECK-NEXT:         661: Name offset = 0x53, CU vector offset = 0x30
29# POSTCHECK-NEXT:             String name: foo, CU vector index: 5
30# POSTCHECK-NEXT:         732: Name offset = 0x3d, CU vector offset = 0x10
31# POSTCHECK-NEXT:             String name: unsigned int, CU vector index: 2
32# POSTCHECK-NEXT:         754: Name offset = 0x4f, CU vector offset = 0x24
33# POSTCHECK-NEXT:             String name: int, CU vector index: 4
34# POSTCHECK:          Constant pool offset = 0x2060, has 6 CU vectors
35# POSTCHECK-NEXT:         0(0x0): 0x90000000
36# POSTCHECK-NEXT:         1(0x8): 0x90000001
37# POSTCHECK-NEXT:         2(0x10): 0x10000000 0x10000001
38# POSTCHECK-NEXT:         3(0x1c): 0x30000000
39# POSTCHECK-NEXT:         4(0x24): 0x90000000 0x90000001
40# POSTCHECK-NEXT:         5(0x30): 0x30000001
41