Skip to content

Commit 1cc0ccc

Browse files
committed
tests: add methods/functions with existing basename
1 parent 64b2f5d commit 1cc0ccc

File tree

1 file changed

+52
-11
lines changed

1 file changed

+52
-11
lines changed

lldb/test/Shell/SymbolFile/NativePDB/find-functions.cpp

Lines changed: 52 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@
4747
// RUN: | FileCheck %s --check-prefix=FIND-STATIC-METHOD
4848

4949
// RUN: lldb-test symbols --find=function --name=Struct::overloaded_method --function-flags=full %t.exe \
50-
// RUN: | FileCheck %s --check-prefix=FIND-OVERLOAD
50+
// RUN: | FileCheck %s --check-prefix=FIND-OVERLOAD-FULL
5151
// RUN: lldb-test symbols --find=function --name=Struct::overloaded_method --function-flags=method %t.exe \
5252
// RUN: | FileCheck %s --check-prefix=FIND-OVERLOAD-METHOD
5353
// RUN: lldb-test symbols --find=function --name=Struct::overloaded_method --function-flags=base %t.exe \
54-
// RUN: | FileCheck %s --check-prefix=FIND-OVERLOAD
54+
// RUN: | FileCheck %s --check-prefix=FIND-OVERLOAD-BASE
5555

5656
struct Struct {
5757
int simple_method() {
@@ -79,7 +79,28 @@ struct Struct {
7979
}
8080
};
8181

82+
class Class {
83+
public:
84+
bool overloaded_method() {
85+
return false;
86+
}
87+
bool overloaded_method(int i) {
88+
return i > 0;
89+
}
90+
static int overloaded_method(bool b) {
91+
return b ? 1 : 2;
92+
}
93+
};
94+
95+
char overloaded_method() {
96+
return 0;
97+
}
98+
char overloaded_method(int i) {
99+
return 0;
100+
}
101+
82102
Struct s;
103+
Class c;
83104

84105
static int static_fn() {
85106
return 42;
@@ -91,7 +112,9 @@ int varargs_fn(int x, int y, ...) {
91112

92113
int main(int argc, char **argv) {
93114
return static_fn() + varargs_fn(argc, argc) + s.simple_method() +
94-
Struct::static_method() + s.virtual_method() + s.overloaded_method();
115+
Struct::static_method() + s.virtual_method() + s.overloaded_method() +
116+
Class::overloaded_method(false) + c.overloaded_method(1) + c.overloaded_method()
117+
+ overloaded_method() + overloaded_method(1);
95118
}
96119

97120
// FIND-MAIN: Function: id = {{.*}}, name = "main"
@@ -114,11 +137,29 @@ int main(int argc, char **argv) {
114137
// FIND-STATIC-METHOD: Function: id = {{.*}}, name = "{{.*}}Struct::static_method{{.*}}"
115138
// FIND-STATIC-METHOD-NEXT: FuncType: id = {{.*}}, compiler_type = "int (void)"
116139

117-
// FIND-OVERLOAD: Function: id = {{.*}}, name = "{{.*}}Struct::overloaded_method{{.*}}"
118-
// FIND-OVERLOAD: FuncType: id = {{.*}}, compiler_type = "int (void)"
119-
// FIND-OVERLOAD: FuncType: id = {{.*}}, compiler_type = "int (char)"
120-
// FIND-OVERLOAD: FuncType: id = {{.*}}, compiler_type = "int (char, int, ...)"
121-
122-
// FIND-OVERLOAD-METHOD: Function: id = {{.*}}, name = "{{.*}}Struct::overloaded_method{{.*}}"
123-
// FIND-OVERLOAD-METHOD: FuncType: id = {{.*}}, compiler_type = "int (void)"
124-
// FIND-OVERLOAD-METHOD: FuncType: id = {{.*}}, compiler_type = "int (char)"
140+
// FIND-OVERLOAD-FULL-NOT: "Class::overloaded_method"
141+
// FIND-OVERLOAD-FULL-NOT: "overloaded_method"
142+
// FIND-OVERLOAD-FULL: Function: id = {{.*}}, name = "{{.*}}Struct::overloaded_method{{.*}}"
143+
// FIND-OVERLOAD-FULL: FuncType: id = {{.*}}, compiler_type = "int (void)"
144+
// FIND-OVERLOAD-FULL: FuncType: id = {{.*}}, compiler_type = "int (char)"
145+
// FIND-OVERLOAD-FULL: FuncType: id = {{.*}}, compiler_type = "int (char, int, ...)"
146+
147+
// FIND-OVERLOAD-BASE-DAG: Function: id = {{.*}}, name = "{{.*}}Struct::overloaded_method{{.*}}"
148+
// FIND-OVERLOAD-BASE-DAG: FuncType: id = {{.*}}, compiler_type = "int (void)"
149+
// FIND-OVERLOAD-BASE-DAG: FuncType: id = {{.*}}, compiler_type = "int (char)"
150+
// FIND-OVERLOAD-BASE-DAG: FuncType: id = {{.*}}, compiler_type = "int (char, int, ...)"
151+
// FIND-OVERLOAD-BASE-DAG: Function: id = {{.*}}, name = "Class::overloaded_method"
152+
// FIND-OVERLOAD-BASE-DAG: FuncType: id = {{.*}}, compiler_type = "_Bool (void)"
153+
// FIND-OVERLOAD-BASE-DAG: FuncType: id = {{.*}}, compiler_type = "_Bool (int)"
154+
// FIND-OVERLOAD-BASE-DAG: FuncType: id = {{.*}}, compiler_type = "int (_Bool)"
155+
// FIND-OVERLOAD-BASE-DAG: Function: id = {{.*}}, name = "overloaded_method"
156+
// FIND-OVERLOAD-BASE-DAG: FuncType: id = {{.*}}, compiler_type = "char (void)"
157+
// FIND-OVERLOAD-BASE-DAG: FuncType: id = {{.*}}, compiler_type = "char (int)"
158+
159+
// FIND-OVERLOAD-METHOD-NOT: "overloaded_method"
160+
// FIND-OVERLOAD-METHOD-DAG: Function: id = {{.*}}, name = "{{.*}}Struct::overloaded_method{{.*}}"
161+
// FIND-OVERLOAD-METHOD-DAG: FuncType: id = {{.*}}, compiler_type = "int (void)"
162+
// FIND-OVERLOAD-METHOD-DAG: FuncType: id = {{.*}}, compiler_type = "int (char)"
163+
// FIND-OVERLOAD-METHOD-DAG: Function: id = {{.*}}, name = "Class::overloaded_method"
164+
// FIND-OVERLOAD-METHOD-DAG: FuncType: id = {{.*}}, compiler_type = "_Bool (void)"
165+
// FIND-OVERLOAD-METHOD-DAG: FuncType: id = {{.*}}, compiler_type = "_Bool (int)"

0 commit comments

Comments
 (0)