2 # RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t1.o
3 # RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %p/Inputs/gdb-index.s -o %t2.o
4 # RUN: ld.lld --gdb-index -e main %t1.o %t2.o -o %t
5 # RUN: llvm-dwarfdump -debug-dump=gdb_index %t | FileCheck %s
6 # RUN: llvm-objdump -d %t | FileCheck %s --check-prefix=DISASM
8 # DISASM: Disassembly of section .text:
10 # DISASM-CHECK: 201000: 90 nop
11 # DISASM-CHECK: 201001: cc int3
12 # DISASM-CHECK: 201002: cc int3
13 # DISASM-CHECK: 201003: cc int3
15 # DISASM-CHECK: 201004: 90 nop
16 # DISASM-CHECK: 201005: 90 nop
18 # CHECK: .gnu_index contents:
19 # CHECK-NEXT: Version = 7
20 # CHECK: CU list offset = 0x18, has 2 entries:
21 # CHECK-NEXT: 0: Offset = 0x0, Length = 0x34
22 # CHECK-NEXT: 1: Offset = 0x34, Length = 0x34
23 # CHECK: Address area offset = 0x38, has 2 entries:
24 # CHECK-NEXT: Low/High address = [0x201000, 0x201001) (Size: 0x1), CU id = 0
25 # CHECK-NEXT: Low/High address = [0x201004, 0x201006) (Size: 0x2), CU id = 1
26 # CHECK: Symbol table offset = 0x60, size = 1024, filled slots:
27 # CHECK-NEXT: 489: Name offset = 0x1d, CU vector offset = 0x0
28 # CHECK-NEXT: String name: main, CU vector index: 0
29 # CHECK-NEXT: 754: Name offset = 0x22, CU vector offset = 0x8
30 # CHECK-NEXT: String name: int, CU vector index: 1
31 # CHECK-NEXT: 956: Name offset = 0x26, CU vector offset = 0x14
32 # CHECK-NEXT: String name: main2, CU vector index: 2
33 # CHECK: Constant pool offset = 0x2060, has 3 CU vectors:
34 # CHECK-NEXT: 0(0x0): 0x30000000
35 # CHECK-NEXT: 1(0x8): 0x90000000 0x90000001
36 # CHECK-NEXT: 2(0x14): 0x30000001
38 ## The following section contents are created by this using gcc 7.1.0:
39 ## echo 'int main() { return 0; }' | gcc -gsplit-dwarf -xc++ -S -o- -
49 .section .debug_info,"",@progbits
56 .quad .Letext0-.Ltext0
70 .section .debug_abbrev,"",@progbits
94 .section .debug_gnu_pubnames,"",@progbits
104 .section .debug_gnu_pubtypes,"",@progbits