diff options
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test')
-rw-r--r-- | lldb/packages/Python/lldbsuite/test/functionalities/type_lookup/Makefile | 2 | ||||
-rw-r--r-- | lldb/packages/Python/lldbsuite/test/functionalities/type_lookup/TestTypeLookup.py | 6 | ||||
-rw-r--r-- | lldb/packages/Python/lldbsuite/test/functionalities/type_lookup/main.mm (renamed from lldb/packages/Python/lldbsuite/test/functionalities/type_lookup/main.m) | 22 |
3 files changed, 26 insertions, 4 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/type_lookup/Makefile b/lldb/packages/Python/lldbsuite/test/functionalities/type_lookup/Makefile index 31e57fe28a5..7fb4d7a5ab1 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/type_lookup/Makefile +++ b/lldb/packages/Python/lldbsuite/test/functionalities/type_lookup/Makefile @@ -1,6 +1,6 @@ LEVEL = ../../make -OBJC_SOURCES := main.m +OBJCXX_SOURCES := main.mm CFLAGS_EXTRAS += -w diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/type_lookup/TestTypeLookup.py b/lldb/packages/Python/lldbsuite/test/functionalities/type_lookup/TestTypeLookup.py index dc4f125e372..62f7766604c 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/type_lookup/TestTypeLookup.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/type_lookup/TestTypeLookup.py @@ -22,7 +22,7 @@ class TypeLookupTestCase(TestBase): # Call super's setUp(). TestBase.setUp(self) # Find the line number to break at. - self.line = line_number('main.m', '// break here') + self.line = line_number('main.mm', '// break here') @skipUnlessDarwin @skipIf(archs=['i386']) @@ -32,7 +32,7 @@ class TypeLookupTestCase(TestBase): self.runCmd("file a.out", CURRENT_EXECUTABLE_SET) lldbutil.run_break_set_by_file_and_line( - self, "main.m", self.line, num_expected_locations=1, loc_exact=True) + self, "main.mm", self.line, num_expected_locations=1, loc_exact=True) self.runCmd("run", RUN_SUCCEEDED) @@ -50,3 +50,5 @@ class TypeLookupTestCase(TestBase): self.expect('type lookup NSObject', substrs=['NSObject', 'isa']) self.expect('type lookup PleaseDontBeARealTypeThatExists', substrs=[ "no type was found matching 'PleaseDontBeARealTypeThatExists'"]) + self.expect('type lookup MyCPPClass', substrs=['setF', 'float getF']) + self.expect('type lookup MyClass', substrs=['setF', 'float getF']) diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/type_lookup/main.m b/lldb/packages/Python/lldbsuite/test/functionalities/type_lookup/main.mm index 058a0c00e92..d522e0b16d7 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/type_lookup/main.m +++ b/lldb/packages/Python/lldbsuite/test/functionalities/type_lookup/main.mm @@ -1,4 +1,4 @@ -//===-- main.m ------------------------------------------------*- ObjC -*-===// +//===-- main.mm -----------------------------------------------*- ObjC -*-===// // // The LLVM Compiler Infrastructure // @@ -9,8 +9,28 @@ #import <Foundation/Foundation.h> +class MyCPPClass { +public: + MyCPPClass(float f) : f(f) {} + + float setF(float f) { + float oldf = this->f; + this->f = f; + return oldf; + } + + float getF() { + return f; + } +private: + float f; +}; + +typedef MyCPPClass MyClass; + int main (int argc, const char * argv[]) { + MyClass my_cpp(3.1415); return 0; // break here } |