File: dwarfdump-accel.test

package info (click to toggle)
llvm-toolchain-16 1%3A16.0.6-15~deb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,634,792 kB
  • sloc: cpp: 6,179,261; ansic: 1,216,205; asm: 741,319; python: 196,614; objc: 75,325; f90: 49,640; lisp: 32,396; pascal: 12,286; sh: 9,394; perl: 7,442; ml: 5,494; awk: 3,523; makefile: 2,723; javascript: 1,206; xml: 886; fortran: 581; cs: 573
file content (77 lines) | stat: -rw-r--r-- 2,485 bytes parent folder | download | duplicates (19)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
RUN: llvm-dwarfdump -v %p/Inputs/dwarfdump-objc.x86_64.o | FileCheck %s
RUN: not llvm-dwarfdump -verify %p/Inputs/dwarfdump-objc.x86_64.o | FileCheck %s --check-prefix=VERIFY

Gather some DIE indexes to verify the accelerator table contents.
CHECK: .debug_info contents
CHECK: [[TESTINTERFACE:0x[0-9a-f]*]]:{{.*}}DW_TAG_structure_type
CHECK-NOT: DW_TAG
CHECK:     DW_AT_name{{.*}}"TestInterface"
CHECK: [[READONLY:0x[0-9a-f]*]]:{{.*}}DW_TAG_subprogram
CHECK-NOT: DW_TAG
CHECK:     DW_AT_name{{.*}}"-[TestInterface ReadOnly]"
CHECK: [[ASSIGN:0x[0-9a-f]*]]:{{.*}}DW_TAG_subprogram
CHECK-NOT: DW_TAG
CHECK:     DW_AT_name{{.*}}"-[TestInterface Assign]"
CHECK: [[SETASSIGN:0x[0-9a-f]*]]:{{.*}}DW_TAG_subprogram
CHECK-NOT: DW_TAG
CHECK:     DW_AT_name{{.*}}"-[TestInterface setAssign:]"


Check that the section header is printed correclty.
CHECK: .apple_names contents:
CHECK: Magic: 0x48415348
CHECK: Version: 0x1
CHECK: Hash function: 0x0
CHECK: Bucket count: 21
CHECK: Hashes count: 42
CHECK: HeaderData length: 12
CHECK: DIE offset base: 0
CHECK: Number of atoms: 1

CHECK: Atom 0 {
CHECK-NEXT: Type: DW_ATOM_die_offset
CHECK-NEXT: Form: DW_FORM_data4

Check that the accelerators point to the right DIEs.
CHECK:     String:{{.*}}"-[TestInterface ReadOnly]"
CHECK-NOT: String
CHECK:     Atom[0]: [[READONLY]]

Check that empty buckets are handled correctly.
CHECK: Bucket 3
CHECK:   EMPTY
CHECK: Bucket 4

Check that the accelerators point to the right DIEs.
CHECK:     String:{{.*}}"-[TestInterface Assign]"
CHECK-NOT: String
CHECK:     Atom[0]: [[ASSIGN]]
CHECK:     String:{{.*}}"-[TestInterface setAssign:]"
CHECK-NOT: String
CHECK:     Atom[0]: [[SETASSIGN]]

Check that types are referenced correctly.
CHECK: .apple_types contents:
CHECK:     String:{{.*}}"TestInterface"
CHECK-NOT: String
CHECK:     Atom[0]: [[TESTINTERFACE]]

Check that an empty accelerator section is handled correctly.
CHECK: .apple_namespaces contents:
CHECK-NOT: Magic

Check ObjC specific accelerators.
CHECK: .apple_objc contents:
CHECK:     String{{.*}}"TestInterface"
CHECK-NOT: String
CHECK:     Atom[0]: [[READONLY]]
CHECK:     Atom[0]: [[ASSIGN]]
CHECK:     Atom[0]: [[SETASSIGN]]

Verify the debug info in the apple_names accelerator table.
VERIFY: Verifying .apple_names...
VERIFY-NEXT: Verifying .apple_types...
VERIFY-NEXT: Verifying .apple_namespaces...
VERIFY-NEXT: error: Section too small: cannot read buckets and hashes.
VERIFY-NEXT: Verifying .apple_objc...
VERIFY-NEXT: Errors detected.