summaryrefslogtreecommitdiffstats
path: root/lldb/test/lang
diff options
context:
space:
mode:
authorPaul Herman <paulherman@google.com>2015-09-16 18:48:30 +0000
committerPaul Herman <paulherman@google.com>2015-09-16 18:48:30 +0000
commitea188fc318a0df1e4bb5a8857d26fad456d0b1ee (patch)
treec1ae88dc714d4b8e85a71be406033ebd1d396e5b /lldb/test/lang
parent459a64aed70f5e74f80bf081c9ebc827274fbd1e (diff)
downloadbcm5719-llvm-ea188fc318a0df1e4bb5a8857d26fad456d0b1ee.tar.gz
bcm5719-llvm-ea188fc318a0df1e4bb5a8857d26fad456d0b1ee.zip
Add using directives to the clang::DeclContext and fix decls for variables inside namespaces
Summary: Supports the parsing of the "using namespace XXX" and "using XXX::XXX" directives. Added ambiguity errors when it two decls with the same name are encountered (see comments in TestCppNsImport). Fixes using directives being duplicated for anonymous namespaces. Fixes GetDeclForUID for specification DIEs. Reviewers: sivachandra, chaoren, clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D12897 llvm-svn: 247836
Diffstat (limited to 'lldb/test/lang')
-rw-r--r--lldb/test/lang/cpp/nsimport/TestCppNsImport.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/lldb/test/lang/cpp/nsimport/TestCppNsImport.py b/lldb/test/lang/cpp/nsimport/TestCppNsImport.py
index 986f9d53253..01622bfa3ec 100644
--- a/lldb/test/lang/cpp/nsimport/TestCppNsImport.py
+++ b/lldb/test/lang/cpp/nsimport/TestCppNsImport.py
@@ -80,18 +80,21 @@ class TestCppNsImport(TestBase):
test_result = frame.EvaluateExpression("fun_var")
self.assertTrue(test_result.IsValid() and test_result.GetValueAsSigned() == 9, "fun_var = 9")
+ test_result = frame.EvaluateExpression("Fun::fun_var")
+ self.assertTrue(test_result.IsValid() and test_result.GetValueAsSigned() == 0, "Fun::fun_var = 0")
+
test_result = frame.EvaluateExpression("not_imported")
self.assertTrue(test_result.IsValid() and test_result.GetValueAsSigned() == 35, "not_imported = 35")
- # Disabled the "imported" test since it isn't valid. It should actually test for ambiguity
- #test_result = frame.EvaluateExpression("imported")
- #self.assertTrue(test_result.IsValid() and test_result.GetValueAsSigned() == 99, "imported = 99")
-
- test_result = frame.EvaluateExpression("::imported")
- self.assertTrue(test_result.IsValid() and test_result.GetValueAsSigned() == 89, "::imported = 89")
+ # Currently there is no way to distinguish between "::imported" and "imported" in ClangExpressionDeclMap so this fails
+ #test_result = frame.EvaluateExpression("::imported")
+ #self.assertTrue(test_result.IsValid() and test_result.GetValueAsSigned() == 89, "::imported = 89")
test_result = frame.EvaluateExpression("Imported::imported")
self.assertTrue(test_result.IsValid() and test_result.GetValueAsSigned() == 99, "Imported::imported = 99")
+
+ test_result = frame.EvaluateExpression("imported")
+ self.assertTrue(test_result.IsValid() and test_result.GetError().Fail(), "imported is ambiguous")
test_result = frame.EvaluateExpression("single")
self.assertTrue(test_result.IsValid() and test_result.GetValueAsSigned() == 3, "single = 3")
OpenPOWER on IntegriCloud