From cce4b8848b6f5b9d3f11a54ee04db705b717b6da Mon Sep 17 00:00:00 2001 From: Raphael Isemann Date: Thu, 26 Sep 2019 11:30:41 +0000 Subject: [lldb][modern-type-lookup] Add test for using the ClangModulesDeclVendor llvm-svn: 372965 --- .../modern-type-lookup/objc-modules/Makefile | 4 ++++ .../objc-modules/TestObjModulesModernTypeLookup.py | 26 ++++++++++++++++++++++ .../modern-type-lookup/objc-modules/main.m | 6 +++++ 3 files changed, 36 insertions(+) create mode 100644 lldb/packages/Python/lldbsuite/test/functionalities/modern-type-lookup/objc-modules/Makefile create mode 100644 lldb/packages/Python/lldbsuite/test/functionalities/modern-type-lookup/objc-modules/TestObjModulesModernTypeLookup.py create mode 100644 lldb/packages/Python/lldbsuite/test/functionalities/modern-type-lookup/objc-modules/main.m (limited to 'lldb/packages/Python/lldbsuite') diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/modern-type-lookup/objc-modules/Makefile b/lldb/packages/Python/lldbsuite/test/functionalities/modern-type-lookup/objc-modules/Makefile new file mode 100644 index 00000000000..afecbf96948 --- /dev/null +++ b/lldb/packages/Python/lldbsuite/test/functionalities/modern-type-lookup/objc-modules/Makefile @@ -0,0 +1,4 @@ +OBJC_SOURCES := main.m +LD_EXTRAS := -lobjc -framework Foundation + +include Makefile.rules diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/modern-type-lookup/objc-modules/TestObjModulesModernTypeLookup.py b/lldb/packages/Python/lldbsuite/test/functionalities/modern-type-lookup/objc-modules/TestObjModulesModernTypeLookup.py new file mode 100644 index 00000000000..3983263bd65 --- /dev/null +++ b/lldb/packages/Python/lldbsuite/test/functionalities/modern-type-lookup/objc-modules/TestObjModulesModernTypeLookup.py @@ -0,0 +1,26 @@ +import lldb +from lldbsuite.test.decorators import * +from lldbsuite.test.lldbtest import * +from lldbsuite.test import lldbutil + +class TestObjcModulesModernTypeLookup(TestBase): + mydir = TestBase.compute_mydir(__file__) + + @skipUnlessDarwin + # gmodules causes this to crash as we seem to get a NSURL type from the debug information. + @skipIf(debug_info="gmodules") + def test(self): + self.build() + # Activate modern-type-lookup. + # FIXME: This has to happen before we create any target otherwise we crash... + self.runCmd("settings set target.experimental.use-modern-type-lookup true") + (target, process, thread, main_breakpoint) = lldbutil.run_to_source_breakpoint(self, + "break here", lldb.SBFileSpec("main.m")) + self.expect("expr @import Foundation") + self.expect( + "p *[NSURL URLWithString:@\"http://lldb.llvm.org\"]", + VARIABLES_DISPLAYED_CORRECTLY, + substrs=[ + "NSURL", + "isa", + "_urlString"]) diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/modern-type-lookup/objc-modules/main.m b/lldb/packages/Python/lldbsuite/test/functionalities/modern-type-lookup/objc-modules/main.m new file mode 100644 index 00000000000..9eb93f0e8c5 --- /dev/null +++ b/lldb/packages/Python/lldbsuite/test/functionalities/modern-type-lookup/objc-modules/main.m @@ -0,0 +1,6 @@ +#import + +int main() { + NSLog(@"Hello World"); + return 0; // break here +} -- cgit v1.2.3