1 # REQUIRES: system-linux
3 # RUN: llvm-mc -dwarf-version=4 -filetype=obj -triple x86_64-unknown-linux %p/Inputs/dwarf4-gdb-index-types-main.s -o %tmaingdb.o
4 # RUN: llvm-mc -dwarf-version=4 -filetype=obj -triple x86_64-unknown-linux %p/Inputs/dwarf4-gdb-index-types-helper.s -o %thelpergdb.o
5 # RUN: %clang %cflags %tmaingdb.o %thelpergdb.o -o %tgdb.exe -Wl,-q
6 # RUN: llvm-objcopy %tgdb.exe --add-section=.gdb_index=%p/Inputs/dwarf4-gdb-index-types-v8.gdb-index
7 # RUN: llvm-bolt %tgdb.exe -o %tgdb.bolt --update-debug-sections
8 # RUN: llvm-dwarfdump --gdb-index %tgdb.bolt | FileCheck --check-prefix=POSTCHECK %s
10 # Tests that BOLT correctly handles gdb-index generated by GDB.
12 # POSTCHECK: Version = 8
13 # POSTCHECK: CU list offset = 0x18, has 2 entries
14 # POSTCHECK-NEXT: 0: Offset = 0x0, Length = 0x6e
15 # POSTCHECK-NEXT: 1: Offset = 0x6e, Length = 0x72
16 # POSTCHECK: Types CU list offset = 0x38, has 2 entries
17 # POSTCHECK-NEXT: 0: offset = 0x00000000, type_offset = 0x0000001e, type_signature = 0x418503b8111e9a7b
18 # POSTCHECK-NEXT: 1: offset = 0x00000044, type_offset = 0x0000001e, type_signature = 0x00f6cca4e3a15118
19 # POSTCHECK: Address area offset = 0x68, has 2 entries
20 # POSTCHECK-NEXT: Low/High address = [0x[[#%.4x,ADDR:]],
21 # POSTCHECK-SAME: 0x[[#ADDR + 0xf]]) (Size: 0xf), CU id = 0
22 # POSTCHECK-NEXT: Low/High address = [0x[[#%.4x,ADDR1:]],
23 # POSTCHECK-SAME: 0x[[#ADDR1 + 0xd]]) (Size: 0xd), CU id = 1
24 # POSTCHECK: Symbol table offset = 0x90, size = 1024, filled slots
25 # POSTCHECK-NEXT: 2: Name offset = 0x28, CU vector offset = 0x0
26 # POSTCHECK-NEXT: String name: S, CU vector index: 0
27 # POSTCHECK-NEXT: 71: Name offset = 0x2a, CU vector offset = 0x8
28 # POSTCHECK-NEXT: String name: S2, CU vector index: 1
29 # POSTCHECK-NEXT: 489: Name offset = 0x2d, CU vector offset = 0x10
30 # POSTCHECK-NEXT: String name: main, CU vector index: 2
31 # POSTCHECK-NEXT: 661: Name offset = 0x32, CU vector offset = 0x18
32 # POSTCHECK-NEXT: String name: foo, CU vector index: 3
33 # POSTCHECK-NEXT: 732: Name offset = 0x36, CU vector offset = 0x20
34 # POSTCHECK-NEXT: String name: unsigned int, CU vector index: 4
35 # POSTCHECK-NEXT: 754: Name offset = 0x43, CU vector offset = 0x0
36 # POSTCHECK-NEXT: String name: int, CU vector index: 0
37 # POSTCHECK: Constant pool offset = 0x2090, has 5 CU vectors
38 # POSTCHECK-NEXT: 0(0x0): 0x90000000
39 # POSTCHECK-NEXT: 1(0x8): 0x90000001
40 # POSTCHECK-NEXT: 2(0x10): 0x30000000
41 # POSTCHECK-NEXT: 3(0x18): 0x30000001
42 # POSTCHECK-NEXT: 4(0x20): 0x90000002