Skip to content

Commit 554e080

Browse files
committed
Add tests for .dwo files.
1 parent 4cdeaec commit 554e080

File tree

1 file changed

+54
-17
lines changed

1 file changed

+54
-17
lines changed

lldb/test/Shell/SymbolFile/DWARF/x86/dwp-foreign-type-units.cpp

Lines changed: 54 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -23,21 +23,53 @@
2323
// RUN: -fdebug-types-section -gpubnames -c %s -o %t.foo.o
2424
// RUN: ld.lld %t.main.o %t.foo.o -o %t
2525

26-
// First we check when we make the .dwp file with %t.main.dwo first so it will
26+
// Check when have no .dwp file that we can find the types in both .dwo files.
27+
// RUN: rm -f %t.dwp
28+
// RUN: %lldb \
29+
// RUN: -o "type lookup IntegerType" \
30+
// RUN: -o "type lookup FloatType" \
31+
// RUN: -o "type lookup CustomType" \
32+
// RUN: -b %t | FileCheck %s --check-prefix=NODWP
33+
// NODWP: (lldb) type lookup IntegerType
34+
// NODWP-NEXT: int
35+
// NODWP-NEXT: unsigned int
36+
// NODWP: (lldb) type lookup FloatType
37+
// NODWP-NEXT: double
38+
// NODWP-NEXT: float
39+
// NODWP: (lldb) type lookup CustomType
40+
// NODWP-NEXT: struct CustomType {
41+
// NODWP-NEXT: typedef int IntegerType;
42+
// NODWP-NEXT: typedef double FloatType;
43+
// NODWP-NEXT: CustomType::IntegerType x;
44+
// NODWP-NEXT: CustomType::FloatType y;
45+
// NODWP-NEXT: }
46+
// NODWP-NEXT: struct CustomType {
47+
// NODWP-NEXT: typedef unsigned int IntegerType;
48+
// NODWP-NEXT: typedef float FloatType;
49+
// NODWP-NEXT: CustomType::IntegerType x;
50+
// NODWP-NEXT: CustomType::FloatType y;
51+
// NODWP-NEXT: }
52+
53+
// Check when we make the .dwp file with %t.main.dwo first so it will
2754
// pick the type unit from %t.main.dwo. Verify we find only the types from
2855
// %t.main.dwo's type unit.
2956
// RUN: llvm-dwp %t.main.dwo %t.foo.dwo -o %t.dwp
3057
// RUN: %lldb \
3158
// RUN: -o "type lookup IntegerType" \
3259
// RUN: -o "type lookup FloatType" \
33-
// RUN: -o "type lookup IntegerType" \
34-
// RUN: -b %t | FileCheck %s
35-
// CHECK: (lldb) type lookup IntegerType
36-
// CHECK-NEXT: int
37-
// CHECK-NEXT: (lldb) type lookup FloatType
38-
// CHECK-NEXT: double
39-
// CHECK-NEXT: (lldb) type lookup IntegerType
40-
// CHECK-NEXT: int
60+
// RUN: -o "type lookup CustomType" \
61+
// RUN: -b %t | FileCheck %s --check-prefix=DWPMAIN
62+
// DWPMAIN: (lldb) type lookup IntegerType
63+
// DWPMAIN-NEXT: int
64+
// DWPMAIN: (lldb) type lookup FloatType
65+
// DWPMAIN-NEXT: double
66+
// DWPMAIN: (lldb) type lookup CustomType
67+
// DWPMAIN-NEXT: struct CustomType {
68+
// DWPMAIN-NEXT: typedef int IntegerType;
69+
// DWPMAIN-NEXT: typedef double FloatType;
70+
// DWPMAIN-NEXT: CustomType::IntegerType x;
71+
// DWPMAIN-NEXT: CustomType::FloatType y;
72+
// DWPMAIN-NEXT: }
4173

4274
// Next we check when we make the .dwp file with %t.foo.dwo first so it will
4375
// pick the type unit from %t.main.dwo. Verify we find only the types from
@@ -46,15 +78,20 @@
4678
// RUN: %lldb \
4779
// RUN: -o "type lookup IntegerType" \
4880
// RUN: -o "type lookup FloatType" \
49-
// RUN: -o "type lookup IntegerType" \
50-
// RUN: -b %t | FileCheck %s --check-prefix=VARIANT
81+
// RUN: -o "type lookup CustomType" \
82+
// RUN: -b %t | FileCheck %s --check-prefix=DWPFOO
5183

52-
// VARIANT: (lldb) type lookup IntegerType
53-
// VARIANT-NEXT: unsigned int
54-
// VARIANT-NEXT: (lldb) type lookup FloatType
55-
// VARIANT-NEXT: float
56-
// VARIANT-NEXT: (lldb) type lookup IntegerType
57-
// VARIANT-NEXT: unsigned int
84+
// DWPFOO: (lldb) type lookup IntegerType
85+
// DWPFOO-NEXT: unsigned int
86+
// DWPFOO: (lldb) type lookup FloatType
87+
// DWPFOO-NEXT: float
88+
// DWPFOO: (lldb) type lookup CustomType
89+
// DWPFOO-NEXT: struct CustomType {
90+
// DWPFOO-NEXT: typedef unsigned int IntegerType;
91+
// DWPFOO-NEXT: typedef float FloatType;
92+
// DWPFOO-NEXT: CustomType::IntegerType x;
93+
// DWPFOO-NEXT: CustomType::FloatType y;
94+
// DWPFOO-NEXT: }
5895

5996

6097
// We need to do this so we end with a type unit in each .dwo file and that has

0 commit comments

Comments
 (0)