Adrian Prantl | 3776c52 | 2017-09-11 23:05:20 +0000 | [diff] [blame] | 1 | RUN: llvm-dwarfdump -v %p/Inputs/dwarfdump-objc.x86_64.o | FileCheck %s |
Spyridoula Gravani | c88d81f | 2017-07-26 00:52:31 +0000 | [diff] [blame] | 2 | RUN: not llvm-dwarfdump -verify %p/Inputs/dwarfdump-objc.x86_64.o | FileCheck %s --check-prefix=VERIFY |
Frederic Riss | e26d793 | 2014-11-14 16:15:53 +0000 | [diff] [blame] | 3 | |
| 4 | Gather some DIE indexes to verify the accelerator table contents. |
| 5 | CHECK: .debug_info contents |
| 6 | CHECK: [[TESTINTERFACE:0x[0-9a-f]*]]:{{.*}}DW_TAG_structure_type |
| 7 | CHECK-NOT: DW_TAG |
| 8 | CHECK: DW_AT_name{{.*}}"TestInterface" |
| 9 | CHECK: [[READONLY:0x[0-9a-f]*]]:{{.*}}DW_TAG_subprogram |
| 10 | CHECK-NOT: DW_TAG |
| 11 | CHECK: DW_AT_name{{.*}}"-[TestInterface ReadOnly]" |
| 12 | CHECK: [[ASSIGN:0x[0-9a-f]*]]:{{.*}}DW_TAG_subprogram |
| 13 | CHECK-NOT: DW_TAG |
| 14 | CHECK: DW_AT_name{{.*}}"-[TestInterface Assign]" |
| 15 | CHECK: [[SETASSIGN:0x[0-9a-f]*]]:{{.*}}DW_TAG_subprogram |
| 16 | CHECK-NOT: DW_TAG |
| 17 | CHECK: DW_AT_name{{.*}}"-[TestInterface setAssign:]" |
| 18 | |
| 19 | |
| 20 | Check that the section header is printed correclty. |
| 21 | CHECK: .apple_names contents: |
Pavel Labath | 9c834d3 | 2018-01-29 11:33:17 +0000 | [diff] [blame] | 22 | CHECK: Magic: 0x48415348 |
| 23 | CHECK: Version: 0x1 |
| 24 | CHECK: Hash function: 0x0 |
| 25 | CHECK: Bucket count: 21 |
| 26 | CHECK: Hashes count: 42 |
| 27 | CHECK: HeaderData length: 12 |
| 28 | CHECK: DIE offset base: 0 |
| 29 | CHECK: Number of atoms: 1 |
| 30 | |
| 31 | CHECK: Atom 0 { |
| 32 | CHECK-NEXT: Type: DW_ATOM_die_offset |
| 33 | CHECK-NEXT: Form: DW_FORM_data4 |
Frederic Riss | e26d793 | 2014-11-14 16:15:53 +0000 | [diff] [blame] | 34 | |
Frederic Riss | e26d793 | 2014-11-14 16:15:53 +0000 | [diff] [blame] | 35 | Check that the accelerators point to the right DIEs. |
Pavel Labath | 9c834d3 | 2018-01-29 11:33:17 +0000 | [diff] [blame] | 36 | CHECK: String:{{.*}}"-[TestInterface ReadOnly]" |
| 37 | CHECK-NOT: String |
| 38 | CHECK: Atom[0]: [[READONLY]] |
Adrian Prantl | 57df85b | 2016-07-14 00:41:18 +0000 | [diff] [blame] | 39 | |
| 40 | Check that empty buckets are handled correctly. |
Pavel Labath | 9c834d3 | 2018-01-29 11:33:17 +0000 | [diff] [blame] | 41 | CHECK: Bucket 3 |
Adrian Prantl | 57df85b | 2016-07-14 00:41:18 +0000 | [diff] [blame] | 42 | CHECK: EMPTY |
Pavel Labath | 9c834d3 | 2018-01-29 11:33:17 +0000 | [diff] [blame] | 43 | CHECK: Bucket 4 |
Adrian Prantl | 57df85b | 2016-07-14 00:41:18 +0000 | [diff] [blame] | 44 | |
| 45 | Check that the accelerators point to the right DIEs. |
Pavel Labath | 9c834d3 | 2018-01-29 11:33:17 +0000 | [diff] [blame] | 46 | CHECK: String:{{.*}}"-[TestInterface Assign]" |
| 47 | CHECK-NOT: String |
| 48 | CHECK: Atom[0]: [[ASSIGN]] |
| 49 | CHECK: String:{{.*}}"-[TestInterface setAssign:]" |
| 50 | CHECK-NOT: String |
| 51 | CHECK: Atom[0]: [[SETASSIGN]] |
Frederic Riss | e26d793 | 2014-11-14 16:15:53 +0000 | [diff] [blame] | 52 | |
| 53 | Check that types are referenced correctly. |
| 54 | CHECK: .apple_types contents: |
Pavel Labath | 9c834d3 | 2018-01-29 11:33:17 +0000 | [diff] [blame] | 55 | CHECK: String:{{.*}}"TestInterface" |
| 56 | CHECK-NOT: String |
| 57 | CHECK: Atom[0]: [[TESTINTERFACE]] |
Frederic Riss | e26d793 | 2014-11-14 16:15:53 +0000 | [diff] [blame] | 58 | |
Adrian Prantl | 57df85b | 2016-07-14 00:41:18 +0000 | [diff] [blame] | 59 | Check that an empty accelerator section is handled correctly. |
Frederic Riss | e26d793 | 2014-11-14 16:15:53 +0000 | [diff] [blame] | 60 | CHECK: .apple_namespaces contents: |
| 61 | CHECK-NOT: Magic |
| 62 | |
| 63 | Check ObjC specific accelerators. |
| 64 | CHECK: .apple_objc contents: |
Pavel Labath | 9c834d3 | 2018-01-29 11:33:17 +0000 | [diff] [blame] | 65 | CHECK: String{{.*}}"TestInterface" |
| 66 | CHECK-NOT: String |
| 67 | CHECK: Atom[0]: [[READONLY]] |
| 68 | CHECK: Atom[0]: [[ASSIGN]] |
| 69 | CHECK: Atom[0]: [[SETASSIGN]] |
Spyridoula Gravani | 7eed737 | 2017-06-29 20:13:05 +0000 | [diff] [blame] | 70 | |
| 71 | Verify the debug info in the apple_names accelerator table. |
Spyridoula Gravani | c88d81f | 2017-07-26 00:52:31 +0000 | [diff] [blame] | 72 | VERIFY: Verifying .apple_names... |
| 73 | VERIFY-NEXT: Verifying .apple_types... |
| 74 | VERIFY-NEXT: Verifying .apple_namespaces... |
Jonas Devlieghere | 11c697c | 2017-12-11 18:22:47 +0000 | [diff] [blame] | 75 | VERIFY-NEXT: error: Section too small: cannot read buckets and hashes. |
Spyridoula Gravani | c88d81f | 2017-07-26 00:52:31 +0000 | [diff] [blame] | 76 | VERIFY-NEXT: Verifying .apple_objc... |
| 77 | VERIFY-NEXT: Errors detected. |