]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/ELF/gdb-index.s
Vendor import of lld trunk r308421:
[FreeBSD/FreeBSD.git] / test / ELF / gdb-index.s
1 # REQUIRES: x86
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
7
8 # DISASM:       Disassembly of section .text:
9 # DISASM:       main:
10 # DISASM-CHECK:   201000: 90 nop
11 # DISASM-CHECK:   201001: cc int3
12 # DISASM-CHECK:   201002: cc int3
13 # DISASM-CHECK:   201003: cc int3
14 # DISASM:       main2:
15 # DISASM-CHECK:   201004: 90 nop
16 # DISASM-CHECK:   201005: 90 nop
17
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
37
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- -
40
41 .text
42 .Ltext0:
43 .globl main
44 .type main, @function
45 main:
46  nop
47 .Letext0:
48
49 .section .debug_info,"",@progbits
50 .long 0x30
51 .value 0x4
52 .long 0
53 .byte 0x8
54 .uleb128 0x1
55 .quad .Ltext0
56 .quad .Letext0-.Ltext0
57 .long 0
58 .long 0
59 .long 0
60 .long 0
61 .byte 0x63
62 .byte 0x88
63 .byte 0xb4
64 .byte 0x61
65 .byte 0xaa
66 .byte 0xb6
67 .byte 0xb0
68 .byte 0x67
69
70 .section .debug_abbrev,"",@progbits
71 .uleb128 0x1
72 .uleb128 0x11
73 .byte 0
74 .uleb128 0x11
75 .uleb128 0x1
76 .uleb128 0x12
77 .uleb128 0x7
78 .uleb128 0x10
79 .uleb128 0x17
80 .uleb128 0x2130
81 .uleb128 0xe
82 .uleb128 0x1b
83 .uleb128 0xe
84 .uleb128 0x2134
85 .uleb128 0x19
86 .uleb128 0x2133
87 .uleb128 0x17
88 .uleb128 0x2131
89 .uleb128 0x7
90 .byte 0
91 .byte 0
92 .byte 0
93
94 .section .debug_gnu_pubnames,"",@progbits
95 .long 0x18
96 .value 0x2
97 .long 0
98 .long 0x33
99 .long 0x18
100 .byte 0x30
101 .string "main"
102 .long 0
103
104 .section .debug_gnu_pubtypes,"",@progbits
105 .long 0x17
106 .value 0x2
107 .long 0
108 .long 0x33
109 .long 0x2b
110 .byte 0x90
111 .string "int"
112 .long 0