diff options
| author | Enrico Granata <egranata@apple.com> | 2015-10-02 01:23:11 +0000 |
|---|---|---|
| committer | Enrico Granata <egranata@apple.com> | 2015-10-02 01:23:11 +0000 |
| commit | 72d8a722410dfd775dc8bc13477c26aac244837b (patch) | |
| tree | 5ce8181031298fac0d45a0aae05626564523602e /lldb/test/functionalities | |
| parent | 7e9fd56b267c5bf001888dc010b729d7553bcaa4 (diff) | |
| download | bcm5719-llvm-72d8a722410dfd775dc8bc13477c26aac244837b.tar.gz bcm5719-llvm-72d8a722410dfd775dc8bc13477c26aac244837b.zip | |
Teach 'type lookup' to pull types from clang modules; also add a test case
llvm-svn: 249117
Diffstat (limited to 'lldb/test/functionalities')
| -rw-r--r-- | lldb/test/functionalities/type_lookup/Makefile | 9 | ||||
| -rw-r--r-- | lldb/test/functionalities/type_lookup/TestTypeLookup.py | 46 | ||||
| -rw-r--r-- | lldb/test/functionalities/type_lookup/main.m | 16 |
3 files changed, 71 insertions, 0 deletions
diff --git a/lldb/test/functionalities/type_lookup/Makefile b/lldb/test/functionalities/type_lookup/Makefile new file mode 100644 index 00000000000..31e57fe28a5 --- /dev/null +++ b/lldb/test/functionalities/type_lookup/Makefile @@ -0,0 +1,9 @@ +LEVEL = ../../make + +OBJC_SOURCES := main.m + +CFLAGS_EXTRAS += -w + +include $(LEVEL)/Makefile.rules + +LDFLAGS += -framework Foundation diff --git a/lldb/test/functionalities/type_lookup/TestTypeLookup.py b/lldb/test/functionalities/type_lookup/TestTypeLookup.py new file mode 100644 index 00000000000..2a75656b9ab --- /dev/null +++ b/lldb/test/functionalities/type_lookup/TestTypeLookup.py @@ -0,0 +1,46 @@ +""" +Test type lookup command. +""" + +import os, time +import unittest2 +import lldb +from lldbtest import * +import datetime +import lldbutil + +class TypeLookupTestCase(TestBase): + + mydir = TestBase.compute_mydir(__file__) + + def setUp(self): + # Call super's setUp(). + TestBase.setUp(self) + # Find the line number to break at. + self.line = line_number('main.m', '// break here') + + @skipUnlessDarwin + def test_type_lookup(self): + """Test type lookup command.""" + self.build() + 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.runCmd("run", RUN_SUCCEEDED) + + # The stop reason of the thread should be breakpoint. + self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT, + substrs = ['stopped', + 'stop reason = breakpoint']) + + self.expect('type lookup NoSuchType', substrs=['@interface'], matching=False) + self.expect('type lookup NSURL', substrs=['NSURL']) + self.expect('type lookup NSArray', substrs=['NSArray']) + self.expect('type lookup NSObject', substrs=['NSObject', 'isa']) + +if __name__ == '__main__': + import atexit + lldb.SBDebugger.Initialize() + atexit.register(lambda: lldb.SBDebugger.Terminate()) + unittest2.main() diff --git a/lldb/test/functionalities/type_lookup/main.m b/lldb/test/functionalities/type_lookup/main.m new file mode 100644 index 00000000000..058a0c00e92 --- /dev/null +++ b/lldb/test/functionalities/type_lookup/main.m @@ -0,0 +1,16 @@ +//===-- main.m ------------------------------------------------*- ObjC -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#import <Foundation/Foundation.h> + +int main (int argc, const char * argv[]) +{ + return 0; // break here +} + |

