diff options
author | Siva Chandra <sivachandra@google.com> | 2015-09-24 21:29:54 +0000 |
---|---|---|
committer | Siva Chandra <sivachandra@google.com> | 2015-09-24 21:29:54 +0000 |
commit | bd7f0dfaa22ca308905ef6fe1f07228602437553 (patch) | |
tree | 3f241487b5db9697d882e071164b829be0e7d7d4 /lldb/test/lang/cpp | |
parent | b02f5a5a1f9e4f2a6b29a9f162ce27183dcd63e9 (diff) | |
download | bcm5719-llvm-bd7f0dfaa22ca308905ef6fe1f07228602437553.tar.gz bcm5719-llvm-bd7f0dfaa22ca308905ef6fe1f07228602437553.zip |
[TestCppIncompleteTypes] Remove the dependence on std::string.
Reviewers: dblaikie, clayborg
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D13143
llvm-svn: 248541
Diffstat (limited to 'lldb/test/lang/cpp')
-rw-r--r-- | lldb/test/lang/cpp/incomplete-types/Makefile | 13 | ||||
-rw-r--r-- | lldb/test/lang/cpp/incomplete-types/TestCppIncompleteTypes.py | 12 | ||||
-rw-r--r-- | lldb/test/lang/cpp/incomplete-types/a.cpp | 10 | ||||
-rw-r--r-- | lldb/test/lang/cpp/incomplete-types/a.h | 11 | ||||
-rw-r--r-- | lldb/test/lang/cpp/incomplete-types/length.cpp | 6 | ||||
-rw-r--r-- | lldb/test/lang/cpp/incomplete-types/length.h | 4 | ||||
-rw-r--r-- | lldb/test/lang/cpp/incomplete-types/main.cpp | 15 |
7 files changed, 45 insertions, 26 deletions
diff --git a/lldb/test/lang/cpp/incomplete-types/Makefile b/lldb/test/lang/cpp/incomplete-types/Makefile index 3b670a64908..7d08d48a51d 100644 --- a/lldb/test/lang/cpp/incomplete-types/Makefile +++ b/lldb/test/lang/cpp/incomplete-types/Makefile @@ -1,6 +1,6 @@ LEVEL = ../../../make -CXX_SOURCES = main.cpp length.cpp +CXX_SOURCES = main.cpp length.cpp a.cpp CFLAGS_LIMIT = -c $(CXXFLAGS) CFLAGS_NO_LIMIT = -c $(CXXFLAGS) @@ -12,11 +12,11 @@ endif all: limit nolimit -limit: main.o length_limit.o - $(CXX) $(LDFLAGS) main.o length_limit.o -o limit +limit: main.o length_limit.o a.o + $(CXX) $(LDFLAGS) main.o length_limit.o a.o -o limit -nolimit: main.o length_nolimit.o - $(CXX) $(LDFLAGS) main.o length_nolimit.o -o nolimit +nolimit: main.o length_nolimit.o a.o + $(CXX) $(LDFLAGS) main.o length_nolimit.o a.o -o nolimit main.o: main.cpp $(CXX) $(CFLAGS_LIMIT) main.cpp -o main.o @@ -27,6 +27,9 @@ length_limit.o: length.cpp length_nolimit.o: length.cpp $(CXX) $(CFLAGS_NO_LIMIT) length.cpp -o length_nolimit.o +a.o: a.cpp + $(CXX) -c a.cpp -o a.o + clean: OBJECTS += limit nolimit length_limit.o length_nolimit.o include $(LEVEL)/Makefile.rules diff --git a/lldb/test/lang/cpp/incomplete-types/TestCppIncompleteTypes.py b/lldb/test/lang/cpp/incomplete-types/TestCppIncompleteTypes.py index 26eb5074731..090709242e8 100644 --- a/lldb/test/lang/cpp/incomplete-types/TestCppIncompleteTypes.py +++ b/lldb/test/lang/cpp/incomplete-types/TestCppIncompleteTypes.py @@ -16,9 +16,9 @@ class TestCppIncompleteTypes(TestBase): self.assertTrue(value_f.IsValid(), "'expr f' results in a valid SBValue object") self.assertFalse(value_f.GetError().Success(), "'expr f' results in an error, but LLDB does not crash") - value_s = frame.EvaluateExpression("s") - self.assertTrue(value_s.IsValid(), "'expr s' results in a valid SBValue object") - self.assertFalse(value_s.GetError().Success(), "'expr s' results in an error, but LLDB does not crash") + value_a = frame.EvaluateExpression("a") + self.assertTrue(value_a.IsValid(), "'expr a' results in a valid SBValue object") + self.assertFalse(value_a.GetError().Success(), "'expr a' results in an error, but LLDB does not crash") @dwarf_test @skipIfGcc @@ -30,9 +30,9 @@ class TestCppIncompleteTypes(TestBase): self.assertTrue(value_f.IsValid(), "'expr f' results in a valid SBValue object") self.assertTrue(value_f.GetError().Success(), "'expr f' is successful") - value_s = frame.EvaluateExpression("s") - self.assertTrue(value_s.IsValid(), "'expr s' results in a valid SBValue object") - self.assertTrue(value_s.GetError().Success(), "'expr s' is successful") + value_a = frame.EvaluateExpression("a") + self.assertTrue(value_a.IsValid(), "'expr a' results in a valid SBValue object") + self.assertTrue(value_a.GetError().Success(), "'expr a' is successful") def setUp(self): TestBase.setUp(self) diff --git a/lldb/test/lang/cpp/incomplete-types/a.cpp b/lldb/test/lang/cpp/incomplete-types/a.cpp new file mode 100644 index 00000000000..36b374be6f3 --- /dev/null +++ b/lldb/test/lang/cpp/incomplete-types/a.cpp @@ -0,0 +1,10 @@ + +#include "a.h" + +A::A () { } + +int +A::length () +{ + return 123; +} diff --git a/lldb/test/lang/cpp/incomplete-types/a.h b/lldb/test/lang/cpp/incomplete-types/a.h new file mode 100644 index 00000000000..13e9496e3fd --- /dev/null +++ b/lldb/test/lang/cpp/incomplete-types/a.h @@ -0,0 +1,11 @@ +#ifndef __A_H__ +#define __A_H__ + +class A +{ +public: + A(); + virtual int length(); +}; + +#endif diff --git a/lldb/test/lang/cpp/incomplete-types/length.cpp b/lldb/test/lang/cpp/incomplete-types/length.cpp index 3289ad9ee45..90a3b640f73 100644 --- a/lldb/test/lang/cpp/incomplete-types/length.cpp +++ b/lldb/test/lang/cpp/incomplete-types/length.cpp @@ -1,8 +1,8 @@ #include "length.h" -size_t -length (const std::string &str) +int +length (A &a) { - return str.length(); + return a.length(); } diff --git a/lldb/test/lang/cpp/incomplete-types/length.h b/lldb/test/lang/cpp/incomplete-types/length.h index 21019063086..96df4f02180 100644 --- a/lldb/test/lang/cpp/incomplete-types/length.h +++ b/lldb/test/lang/cpp/incomplete-types/length.h @@ -1,8 +1,8 @@ #ifndef __LENGTH_H__ #define __LENGTH_H__ -#include <string> +#include "a.h" -size_t length (const std::string &str); +int length (A &a); #endif diff --git a/lldb/test/lang/cpp/incomplete-types/main.cpp b/lldb/test/lang/cpp/incomplete-types/main.cpp index 79cc7139a6d..ad324c90581 100644 --- a/lldb/test/lang/cpp/incomplete-types/main.cpp +++ b/lldb/test/lang/cpp/incomplete-types/main.cpp @@ -3,21 +3,16 @@ class Foo { public: - Foo(std::string x) : s(x) {} - -private: - std::string s; + A a; }; -class MyString : public std::string { -public: - MyString(std::string x) : std::string(x) {} +class MyA : public A { }; int main() { - Foo f("qwerty"); - MyString s("qwerty"); + Foo f; + MyA a; - return length(s); // break here + return length(a); // break here } |