summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test/lang/cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/lang/cpp')
-rw-r--r--lldb/packages/Python/lldbsuite/test/lang/cpp/class_types/main.cpp2
-rw-r--r--lldb/packages/Python/lldbsuite/test/lang/cpp/namespace/main.cpp3
-rw-r--r--lldb/packages/Python/lldbsuite/test/lang/cpp/namespace/ns.cpp18
-rw-r--r--lldb/packages/Python/lldbsuite/test/lang/cpp/namespace/ns.h36
-rw-r--r--lldb/packages/Python/lldbsuite/test/lang/cpp/namespace/ns2.cpp34
-rw-r--r--lldb/packages/Python/lldbsuite/test/lang/cpp/namespace/ns3.cpp14
6 files changed, 53 insertions, 54 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/lang/cpp/class_types/main.cpp b/lldb/packages/Python/lldbsuite/test/lang/cpp/class_types/main.cpp
index 251e66c3c9f..2d02cbe0f05 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/cpp/class_types/main.cpp
+++ b/lldb/packages/Python/lldbsuite/test/lang/cpp/class_types/main.cpp
@@ -90,7 +90,7 @@ public:
B(ai, bi),
m_c_int(ci)
{
- printf("Within C::ctor() m_c_int=%d\n", m_c_int); // Set break point at this line.
+ std::printf("Within C::ctor() m_c_int=%d\n", m_c_int); // Set break point at this line.
}
//virtual
diff --git a/lldb/packages/Python/lldbsuite/test/lang/cpp/namespace/main.cpp b/lldb/packages/Python/lldbsuite/test/lang/cpp/namespace/main.cpp
index 560ec40f473..9f5eb06cccd 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/cpp/namespace/main.cpp
+++ b/lldb/packages/Python/lldbsuite/test/lang/cpp/namespace/main.cpp
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
#include <cstdarg>
+#include <cstdlib>
#include "ns.h"
namespace {
@@ -23,7 +24,7 @@ namespace {
variadic_sum (int arg_count...)
{
int sum = 0;
- va_list args;
+ std::va_list args;
va_start(args, arg_count);
for (int i = 0; i < arg_count; i++)
diff --git a/lldb/packages/Python/lldbsuite/test/lang/cpp/namespace/ns.cpp b/lldb/packages/Python/lldbsuite/test/lang/cpp/namespace/ns.cpp
index 9e5637d02b4..bb7731cf87b 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/cpp/namespace/ns.cpp
+++ b/lldb/packages/Python/lldbsuite/test/lang/cpp/namespace/ns.cpp
@@ -11,22 +11,22 @@
int foo()
{
- printf("global foo()\n");
- return 42;
+ std::printf("global foo()\n");
+ return 42;
}
int func()
{
- printf("global func()\n");
- return 1;
+ std::printf("global func()\n");
+ return 1;
}
int func(int a)
{
- printf("global func(int)\n");
- return a + 1;
+ std::printf("global func(int)\n");
+ return a + 1;
}
void test_lookup_at_global_scope()
{
- // BP_global_scope
- printf("at global scope: foo() = %d\n", foo()); // eval foo(), exp: 42
- printf("at global scope: func() = %d\n", func()); // eval func(), exp: 1
+ // BP_global_scope
+ std::printf("at global scope: foo() = %d\n", foo()); // eval foo(), exp: 42
+ std::printf("at global scope: func() = %d\n", func()); // eval func(), exp: 1
}
diff --git a/lldb/packages/Python/lldbsuite/test/lang/cpp/namespace/ns.h b/lldb/packages/Python/lldbsuite/test/lang/cpp/namespace/ns.h
index a07b600efa3..a0f9be88216 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/cpp/namespace/ns.h
+++ b/lldb/packages/Python/lldbsuite/test/lang/cpp/namespace/ns.h
@@ -7,7 +7,7 @@
//
//===----------------------------------------------------------------------===//
-#include <stdio.h>
+#include <cstdio>
void test_lookup_at_global_scope();
void test_lookup_at_file_scope();
@@ -15,22 +15,20 @@ void test_lookup_before_using_directive();
void test_lookup_after_using_directive();
int func(int a);
namespace A {
- int foo();
- int func(int a);
- inline int func()
- {
- printf("A::func()\n");
- return 3;
- }
- inline int func2()
- {
- printf("A::func2()\n");
- return 3;
- }
- void test_lookup_at_ns_scope();
- namespace B {
- int func();
- void test_lookup_at_nested_ns_scope();
- void test_lookup_at_nested_ns_scope_after_using();
- }
+int foo();
+int func(int a);
+inline int func() {
+ std::printf("A::func()\n");
+ return 3;
+}
+inline int func2() {
+ std::printf("A::func2()\n");
+ return 3;
}
+void test_lookup_at_ns_scope();
+namespace B {
+int func();
+void test_lookup_at_nested_ns_scope();
+void test_lookup_at_nested_ns_scope_after_using();
+} // namespace B
+} // namespace A
diff --git a/lldb/packages/Python/lldbsuite/test/lang/cpp/namespace/ns2.cpp b/lldb/packages/Python/lldbsuite/test/lang/cpp/namespace/ns2.cpp
index 04046ad9b7f..0051d478395 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/cpp/namespace/ns2.cpp
+++ b/lldb/packages/Python/lldbsuite/test/lang/cpp/namespace/ns2.cpp
@@ -11,26 +11,26 @@
static int func()
{
- printf("static m2.cpp func()\n");
- return 2;
+ std::printf("static m2.cpp func()\n");
+ return 2;
}
void test_lookup_at_file_scope()
{
- // BP_file_scope
- printf("at file scope: func() = %d\n", func()); // eval func(), exp: 2
- printf("at file scope: func(10) = %d\n", func(10)); // eval func(10), exp: 11
+ // BP_file_scope
+ std::printf("at file scope: func() = %d\n", func()); // eval func(), exp: 2
+ std::printf("at file scope: func(10) = %d\n", func(10)); // eval func(10), exp: 11
}
namespace A {
namespace B {
int func()
{
- printf("A::B::func()\n");
- return 4;
+ std::printf("A::B::func()\n");
+ return 4;
}
void test_lookup_at_nested_ns_scope()
{
// BP_nested_ns_scope
- printf("at nested ns scope: func() = %d\n", func()); // eval func(), exp: 4
+ std::printf("at nested ns scope: func() = %d\n", func()); // eval func(), exp: 4
//printf("func(10) = %d\n", func(10)); // eval func(10), exp: 13
// NOTE: Under the rules of C++, this test would normally get an error
@@ -42,24 +42,24 @@ namespace A {
{
// BP_nested_ns_scope_after_using
using A::func;
- printf("at nested ns scope after using: func() = %d\n", func()); // eval func(), exp: 3
+ std::printf("at nested ns scope after using: func() = %d\n", func()); // eval func(), exp: 3
}
}
}
int A::foo()
{
- printf("A::foo()\n");
- return 42;
+ std::printf("A::foo()\n");
+ return 42;
}
int A::func(int a)
{
- printf("A::func(int)\n");
- return a + 3;
+ std::printf("A::func(int)\n");
+ return a + 3;
}
void A::test_lookup_at_ns_scope()
{
- // BP_ns_scope
- printf("at nested ns scope: func() = %d\n", func()); // eval func(), exp: 3
- printf("at nested ns scope: func(10) = %d\n", func(10)); // eval func(10), exp: 13
- printf("at nested ns scope: foo() = %d\n", foo()); // eval foo(), exp: 42
+ // BP_ns_scope
+ std::printf("at nested ns scope: func() = %d\n", func()); // eval func(), exp: 3
+ std::printf("at nested ns scope: func(10) = %d\n", func(10)); // eval func(10), exp: 13
+ std::printf("at nested ns scope: foo() = %d\n", foo()); // eval foo(), exp: 42
}
diff --git a/lldb/packages/Python/lldbsuite/test/lang/cpp/namespace/ns3.cpp b/lldb/packages/Python/lldbsuite/test/lang/cpp/namespace/ns3.cpp
index 10b0df78422..205e1931f3e 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/cpp/namespace/ns3.cpp
+++ b/lldb/packages/Python/lldbsuite/test/lang/cpp/namespace/ns3.cpp
@@ -13,15 +13,15 @@ extern int func();
// Note: the following function must be before the using.
void test_lookup_before_using_directive()
{
- // BP_before_using_directive
- printf("before using directive: func() = %d\n", func()); // eval func(), exp: 1
+ // BP_before_using_directive
+ std::printf("before using directive: func() = %d\n", func()); // eval func(), exp: 1
}
using namespace A;
void test_lookup_after_using_directive()
{
- // BP_after_using_directive
- //printf("func() = %d\n", func()); // eval func(), exp: error, amiguous
- printf("after using directive: func2() = %d\n", func2()); // eval func2(), exp: 3
- printf("after using directive: ::func() = %d\n", ::func()); // eval ::func(), exp: 1
- printf("after using directive: B::func() = %d\n", B::func()); // eval B::func(), exp: 4
+ // BP_after_using_directive
+ //printf("func() = %d\n", func()); // eval func(), exp: error, amiguous
+ std::printf("after using directive: func2() = %d\n", func2()); // eval func2(), exp: 3
+ std::printf("after using directive: ::func() = %d\n", ::func()); // eval ::func(), exp: 1
+ std::printf("after using directive: B::func() = %d\n", B::func()); // eval B::func(), exp: 4
}
OpenPOWER on IntegriCloud