blob: 27720b6c9b42a80b1351603b69c8ecd29ed4f3f0 [file] [log] [blame]
Adrian Prantl3776c522017-09-11 23:05:20 +00001RUN: llvm-dwarfdump -v %p/Inputs/dwarfdump-objc.x86_64.o | FileCheck %s
Spyridoula Gravanic88d81f2017-07-26 00:52:31 +00002RUN: not llvm-dwarfdump -verify %p/Inputs/dwarfdump-objc.x86_64.o | FileCheck %s --check-prefix=VERIFY
Frederic Risse26d7932014-11-14 16:15:53 +00003
4Gather some DIE indexes to verify the accelerator table contents.
5CHECK: .debug_info contents
6CHECK: [[TESTINTERFACE:0x[0-9a-f]*]]:{{.*}}DW_TAG_structure_type
7CHECK-NOT: DW_TAG
8CHECK: DW_AT_name{{.*}}"TestInterface"
9CHECK: [[READONLY:0x[0-9a-f]*]]:{{.*}}DW_TAG_subprogram
10CHECK-NOT: DW_TAG
11CHECK: DW_AT_name{{.*}}"-[TestInterface ReadOnly]"
12CHECK: [[ASSIGN:0x[0-9a-f]*]]:{{.*}}DW_TAG_subprogram
13CHECK-NOT: DW_TAG
14CHECK: DW_AT_name{{.*}}"-[TestInterface Assign]"
15CHECK: [[SETASSIGN:0x[0-9a-f]*]]:{{.*}}DW_TAG_subprogram
16CHECK-NOT: DW_TAG
17CHECK: DW_AT_name{{.*}}"-[TestInterface setAssign:]"
18
19
20Check that the section header is printed correclty.
21CHECK: .apple_names contents:
Pavel Labath9c834d32018-01-29 11:33:17 +000022CHECK: Magic: 0x48415348
23CHECK: Version: 0x1
24CHECK: Hash function: 0x0
25CHECK: Bucket count: 21
26CHECK: Hashes count: 42
27CHECK: HeaderData length: 12
28CHECK: DIE offset base: 0
29CHECK: Number of atoms: 1
30
31CHECK: Atom 0 {
32CHECK-NEXT: Type: DW_ATOM_die_offset
33CHECK-NEXT: Form: DW_FORM_data4
Frederic Risse26d7932014-11-14 16:15:53 +000034
Frederic Risse26d7932014-11-14 16:15:53 +000035Check that the accelerators point to the right DIEs.
Pavel Labath9c834d32018-01-29 11:33:17 +000036CHECK: String:{{.*}}"-[TestInterface ReadOnly]"
37CHECK-NOT: String
38CHECK: Atom[0]: [[READONLY]]
Adrian Prantl57df85b2016-07-14 00:41:18 +000039
40Check that empty buckets are handled correctly.
Pavel Labath9c834d32018-01-29 11:33:17 +000041CHECK: Bucket 3
Adrian Prantl57df85b2016-07-14 00:41:18 +000042CHECK: EMPTY
Pavel Labath9c834d32018-01-29 11:33:17 +000043CHECK: Bucket 4
Adrian Prantl57df85b2016-07-14 00:41:18 +000044
45Check that the accelerators point to the right DIEs.
Pavel Labath9c834d32018-01-29 11:33:17 +000046CHECK: String:{{.*}}"-[TestInterface Assign]"
47CHECK-NOT: String
48CHECK: Atom[0]: [[ASSIGN]]
49CHECK: String:{{.*}}"-[TestInterface setAssign:]"
50CHECK-NOT: String
51CHECK: Atom[0]: [[SETASSIGN]]
Frederic Risse26d7932014-11-14 16:15:53 +000052
53Check that types are referenced correctly.
54CHECK: .apple_types contents:
Pavel Labath9c834d32018-01-29 11:33:17 +000055CHECK: String:{{.*}}"TestInterface"
56CHECK-NOT: String
57CHECK: Atom[0]: [[TESTINTERFACE]]
Frederic Risse26d7932014-11-14 16:15:53 +000058
Adrian Prantl57df85b2016-07-14 00:41:18 +000059Check that an empty accelerator section is handled correctly.
Frederic Risse26d7932014-11-14 16:15:53 +000060CHECK: .apple_namespaces contents:
61CHECK-NOT: Magic
62
63Check ObjC specific accelerators.
64CHECK: .apple_objc contents:
Pavel Labath9c834d32018-01-29 11:33:17 +000065CHECK: String{{.*}}"TestInterface"
66CHECK-NOT: String
67CHECK: Atom[0]: [[READONLY]]
68CHECK: Atom[0]: [[ASSIGN]]
69CHECK: Atom[0]: [[SETASSIGN]]
Spyridoula Gravani7eed7372017-06-29 20:13:05 +000070
71Verify the debug info in the apple_names accelerator table.
Spyridoula Gravanic88d81f2017-07-26 00:52:31 +000072VERIFY: Verifying .apple_names...
73VERIFY-NEXT: Verifying .apple_types...
74VERIFY-NEXT: Verifying .apple_namespaces...
Jonas Devlieghere11c697c2017-12-11 18:22:47 +000075VERIFY-NEXT: error: Section too small: cannot read buckets and hashes.
Spyridoula Gravanic88d81f2017-07-26 00:52:31 +000076VERIFY-NEXT: Verifying .apple_objc...
77VERIFY-NEXT: Errors detected.