1 | // Test that we can jump from a type unit in one dwo file into a type unit in a |
2 | // different dwo file. |
3 | |
4 | // REQUIRES: lld |
5 | |
6 | // RUN: %clang %s -target x86_64-pc-linux -fno-standalone-debug -g \ |
7 | // RUN: -fdebug-types-section -gsplit-dwarf -c -o %t1.o -DONE |
8 | // RUN: %clang %s -target x86_64-pc-linux -fno-standalone-debug -g \ |
9 | // RUN: -fdebug-types-section -gsplit-dwarf -c -o %t2.o -DTWO |
10 | // RUN: llvm-dwarfdump %t1.dwo -debug-types -debug-info | FileCheck --check-prefix=ONEUNIT %s |
11 | // RUN: llvm-dwarfdump %t2.dwo -debug-types -debug-info | FileCheck --check-prefix=ONEUNIT %s |
12 | // RUN: ld.lld %t1.o %t2.o -o %t |
13 | // RUN: %lldb %t -o "target var a b **b.a" -b | FileCheck %s |
14 | |
15 | // ONEUNIT-COUNT-1: DW_TAG_type_unit |
16 | |
17 | // CHECK: (const A) a = (a = 42) |
18 | // CHECK: (const B) b = { |
19 | // CHECK-NEXT: a = 0x{{.*}} |
20 | // CHECK-NEXT: } |
21 | // CHECK: (const A) **b.a = (a = 42) |
22 | |
23 | struct A; |
24 | |
25 | extern const A *a_ptr; |
26 | #ifdef ONE |
27 | struct A { |
28 | int a = 42; |
29 | }; |
30 | constexpr A a{}; |
31 | const A *a_ptr = &a; |
32 | #else |
33 | struct B { |
34 | const A **a; |
35 | }; |
36 | extern constexpr B b{.a: &a_ptr}; |
37 | #endif |
38 | |