Skip to content

Commit f8f1082

Browse files
committed
[lldb][test] TestExprCompletion.py: add tests for completion of reserved identifiers (llvm#84890)
(cherry picked from commit 88bf640)
1 parent bd9c58f commit f8f1082

File tree

4 files changed

+19
-0
lines changed

4 files changed

+19
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
CXX_SOURCES := main.cpp other.cpp
2+
CXXFLAGS += -isystem $(SRCDIR)/sys
23

34
include Makefile.rules

lldb/test/API/commands/expression/completion/TestExprCompletion.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,11 @@ def test_expr_completion(self):
246246
"expr some_expr.Self(). FooNoArgs", "expr some_expr.Self(). FooNoArgsBar()"
247247
)
248248

249+
self.complete_from_to("expr myVec.__f", "expr myVec.__func()")
250+
self.complete_from_to("expr myVec._F", "expr myVec._Func()")
251+
self.complete_from_to("expr myVec.__m", "expr myVec.__mem")
252+
self.complete_from_to("expr myVec._M", "expr myVec._Mem")
253+
249254
def test_expr_completion_with_descriptions(self):
250255
self.build()
251256
self.main_source = "main.cpp"

lldb/test/API/commands/expression/completion/main.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#include <reserved.h>
2+
13
namespace LongNamespaceName { class NestedClass { long m; }; }
24

35
// Defined in other.cpp, we only have a forward declaration here.
@@ -31,5 +33,8 @@ int main()
3133
some_expr.FooNumbersBar1();
3234
Expr::StaticMemberMethodBar();
3335
ForwardDecl *fwd_decl_ptr = &fwd_decl;
36+
MyVec myVec;
37+
myVec.__func();
38+
myVec._Func();
3439
return 0; // Break here
3540
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
class MyVec {
2+
int __mem;
3+
int _Mem;
4+
5+
public:
6+
void __func() {}
7+
void _Func() {}
8+
};

0 commit comments

Comments
 (0)