diff --git a/lldb/test/API/lang/cpp/gmodules/templates/Makefile b/lldb/test/API/lang/cpp/gmodules/templates/Makefile new file mode 100644 --- /dev/null +++ b/lldb/test/API/lang/cpp/gmodules/templates/Makefile @@ -0,0 +1,4 @@ +PCH_CXX_SOURCES = a.h b.h +CXX_SOURCES := main.cpp + +include Makefile.rules diff --git a/lldb/test/API/lang/cpp/gmodules/templates/TestGModules.py b/lldb/test/API/lang/cpp/gmodules/templates/TestGModules.py --- a/lldb/test/API/lang/cpp/gmodules/templates/TestGModules.py +++ b/lldb/test/API/lang/cpp/gmodules/templates/TestGModules.py @@ -1,6 +1,22 @@ -import lldbsuite.test.lldbinline as lldbinline +""" +Test that the type Module which contains a field that is a +template instantiation can be fully resolved. +""" + +import lldb from lldbsuite.test.decorators import * +from lldbsuite.test.lldbtest import * +from lldbsuite.test import lldbutil + +class TestGModules(TestBase): + + @add_test_categories(["gmodules"]) + @expectedFailureAll + def test_gmodules(self): + self.build() + lldbutil.run_to_source_breakpoint(self, "Break here", lldb.SBFileSpec("main.cpp")) + + name = lldbutil.frame().FindVariable('m') \ + .GetChildAtIndex(0).GetChildAtIndex(0).GetChildAtIndex(0).GetName() -lldbinline.MakeInlineTest(__file__, globals(), [ - expectedFailureAll(oslist=["linux"], bugnumber="llvm.org/pr36107", - debug_info="gmodules")]) + self.assertEqual(name, 'buffer', 'find template specializations in imported modules') diff --git a/lldb/test/API/lang/cpp/gmodules/templates/main.cpp b/lldb/test/API/lang/cpp/gmodules/templates/main.cpp --- a/lldb/test/API/lang/cpp/gmodules/templates/main.cpp +++ b/lldb/test/API/lang/cpp/gmodules/templates/main.cpp @@ -1,9 +1,9 @@ #include "b.h" +#include int main(int argc, const char * argv[]) { Module m; - // Test that the type Module which contains a field that is a - // template instantiation can be fully resolved. - return 0; //% self.assertTrue(self.frame().FindVariable('m').GetChildAtIndex(0).GetChildAtIndex(0).GetChildAtIndex(0).GetName() == 'buffer', 'find template specializations in imported modules') + std::puts("Break here"); + return 0; }