[Lldb-commits] [lldb] r181741 - Add expression tests for a function in an anonymous namespace.

Matt Kopec Matt.Kopec at intel.com
Mon May 13 15:00:33 PDT 2013


Author: mkopec
Date: Mon May 13 17:00:32 2013
New Revision: 181741

URL: http://llvm.org/viewvc/llvm-project?rev=181741&view=rev
Log:
Add expression tests for a function in an anonymous namespace.

Modified:
    lldb/trunk/test/lang/cpp/namespace/TestNamespace.py
    lldb/trunk/test/lang/cpp/namespace/main.cpp

Modified: lldb/trunk/test/lang/cpp/namespace/TestNamespace.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/cpp/namespace/TestNamespace.py?rev=181741&r1=181740&r2=181741&view=diff
==============================================================================
--- lldb/trunk/test/lang/cpp/namespace/TestNamespace.py (original)
+++ lldb/trunk/test/lang/cpp/namespace/TestNamespace.py Mon May 13 17:00:32 2013
@@ -106,6 +106,16 @@ class NamespaceTestCase(TestBase):
         self.expect("expression -- A::B::j", VARIABLES_DISPLAYED_CORRECTLY,
             patterns = [' = 4$'])
 
+        # expression command with function in anonymous namespace
+        self.expect("expression -- myanonfunc(3)",
+            patterns = [' = 6'])
+
+        # global namespace qualification with function in anonymous namespace
+        self.expect("expression -- ::myanonfunc(4)",
+            patterns = [' = 8'])
+
+        self.expect("p myanonfunc",
+            patterns = ['\(anonymous namespace\)::myanonfunc\(int\)'])
 
 if __name__ == '__main__':
     import atexit

Modified: lldb/trunk/test/lang/cpp/namespace/main.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/cpp/namespace/main.cpp?rev=181741&r1=181740&r2=181741&view=diff
==============================================================================
--- lldb/trunk/test/lang/cpp/namespace/main.cpp (original)
+++ lldb/trunk/test/lang/cpp/namespace/main.cpp Mon May 13 17:00:32 2013
@@ -10,6 +10,11 @@
 namespace {
     typedef unsigned int my_uint_t;
     int i; // Find the line number for anonymous namespace variable i.
+
+    int myanonfunc (int a)
+    {
+        return a + a;
+    }
 }
 
 namespace A {
@@ -62,6 +67,7 @@ int Foo::myfunc(int a)
     j = 4;
     printf("::i=%d\n", ::i);
     printf("A::B::j=%d\n", A::B::j);
+    myanonfunc(3);
     return myfunc2(3) + j + i + a + 2 + anon_uint + a_uint + b_uint + y_uint; // Set break point at this line.
 }
 





More information about the lldb-commits mailing list