Add expression tests for a function in an anonymous namespace.

llvm-svn: 181741
This commit is contained in:
Matt Kopec 2013-05-13 22:00:32 +00:00
parent f13dbe4799
commit 201284a8d3
2 changed files with 16 additions and 0 deletions

View File

@ -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

View File

@ -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.
}