[llvm-dwp] Deduplicate type units
[oota-llvm.git] / test / tools / llvm-dwp / X86 / type_dedup.test
1 RUN: llvm-dwp %p/../Inputs/type_dedup/a.dwo %p/../Inputs/type_dedup/b.dwo -o %t
2 RUN: llvm-dwarfdump %t | FileCheck %s
3
4 a.cpp:
5   struct common { };
6   common a1;
7   struct adistinct { };
8   adistinct a2;
9
10 b.cpp:
11   struct common { };
12   common b1;
13   struct bdistinct { };
14   bdistinct b2;
15
16 CHECK-LABEL: .debug_types.dwo contents:
17 CHECK: [[COMMONUOFF:0x[0-9a-f]*]]:
18 CHECK-LABEL: Type Unit: length = 0x00000020 version = 0x0004 abbr_offset =
19 CHECK:         0x0000 addr_size = 0x08 type_signature = [[COMMONSIG:0x[0-9a-f]*]] type_offset = 0x[[COMMONOFF:.*]] (next unit at [[AUOFF:.*]])
20 CHECK:                DW_TAG_type_unit
21 CHECK: [[COMMONOFF]]:   DW_TAG_structure_type
22 CHECK:                    DW_AT_name {{.*}} "common"
23 CHECK: [[AUOFF]]:
24 CHECK-LABEL: Type Unit: length = 0x00000020 version = 0x0004 abbr_offset =
25 CHECK:         0x0000 addr_size = 0x08 type_signature = [[ASIG:0x[0-9a-f]*]] type_offset = 0x[[AOFF:.*]] (next unit at [[BUOFF:.*]])
26 CHECK:             DW_TAG_type_unit
27 CHECK: 0x00000042:   DW_TAG_structure_type
28 CHECK:                 DW_AT_name {{.*}} "adistinct"
29 CHECK: [[BUOFF]]:
30 CHECK-LABEL: Type Unit: length = 0x00000020 version = 0x0004 abbr_offset =
31 CHECK:         0x{{.*}} addr_size = 0x08 type_signature = [[BSIG:0x[0-9a-f]*]] type_offset = 0x[[BOFF:.*]] (next unit at [[XUOFF:.*]])
32 CHECK:             DW_TAG_type_unit
33 CHECK: 0x00000066:   DW_TAG_structure_type
34 CHECK:                 DW_AT_name {{.*}} "bdistinct"
35 CHECK-NOT: Type Unit