From a74e3cb9ce1d0720d753ea19cc2e9b9d59e7a21b Mon Sep 17 00:00:00 2001 From: Michael Buch Date: Wed, 9 Jul 2025 13:24:32 +0100 Subject: [PATCH] [lldb][test] Move std::ranges::ref_view from libcxx to generic directory This just moves the test from `libcxx` to `generic`. There are currently no `std::ranges::ref_view` formatters for libstdc++ so I didn't add a test-case for it. Split out from https://github.com/llvm/llvm-project/pull/146740 --- .../{libcxx => generic}/ranges/ref_view/Makefile | 2 -- .../ref_view/TestDataFormatterStdRangesRefView.py} | 14 +++++++++----- .../{libcxx => generic}/ranges/ref_view/main.cpp | 0 3 files changed, 9 insertions(+), 7 deletions(-) rename lldb/test/API/functionalities/data-formatter/data-formatter-stl/{libcxx => generic}/ranges/ref_view/Makefile (82%) rename lldb/test/API/functionalities/data-formatter/data-formatter-stl/{libcxx/ranges/ref_view/TestDataFormatterLibcxxRangesRefView.py => generic/ranges/ref_view/TestDataFormatterStdRangesRefView.py} (92%) rename lldb/test/API/functionalities/data-formatter/data-formatter-stl/{libcxx => generic}/ranges/ref_view/main.cpp (100%) diff --git a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/ranges/ref_view/Makefile b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/ranges/ref_view/Makefile similarity index 82% rename from lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/ranges/ref_view/Makefile rename to lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/ranges/ref_view/Makefile index 3c4f9b45f41de..4f79c0a900c3a 100644 --- a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/ranges/ref_view/Makefile +++ b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/ranges/ref_view/Makefile @@ -1,5 +1,3 @@ -USE_LIBCPP := 1 - CXX_SOURCES := main.cpp CXXFLAGS_EXTRAS := -std=c++20 diff --git a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/ranges/ref_view/TestDataFormatterLibcxxRangesRefView.py b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/ranges/ref_view/TestDataFormatterStdRangesRefView.py similarity index 92% rename from lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/ranges/ref_view/TestDataFormatterLibcxxRangesRefView.py rename to lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/ranges/ref_view/TestDataFormatterStdRangesRefView.py index 9b5194be91e78..f135da70c7b47 100644 --- a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/ranges/ref_view/TestDataFormatterLibcxxRangesRefView.py +++ b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/ranges/ref_view/TestDataFormatterStdRangesRefView.py @@ -8,7 +8,7 @@ from lldbsuite.test import lldbutil -class LibcxxRangesRefViewDataFormatterTestCase(TestBase): +class StdRangesRefViewDataFormatterTestCase(TestBase): def check_string_vec_children(self): return [ ValueCheck(name="[0]", summary='"First"'), @@ -27,10 +27,7 @@ def check_string_vec_ref_view(self): def check_foo(self): return ValueCheck(name="vec", children=self.check_string_vec_children()) - @add_test_categories(["libc++"]) - @skipIf(compiler=no_match("clang")) - @skipIf(compiler="clang", compiler_version=["<", "16.0"]) - def test_with_run_command(self): + def do_test(self): """Test that std::ranges::ref_view is formatted correctly when printed.""" self.build() (self.target, process, thread, bkpt) = lldbutil.run_to_source_breakpoint( @@ -69,3 +66,10 @@ def test_with_run_command(self): ) ], ) + + @skipIf(compiler=no_match("clang")) + @skipIf(compiler="clang", compiler_version=["<", "16.0"]) + @add_test_categories(["libc++"]) + def test_libcxx(self): + self.build(dictionary={"USE_LIBCPP": 1}) + self.do_test() diff --git a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/ranges/ref_view/main.cpp b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/ranges/ref_view/main.cpp similarity index 100% rename from lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/ranges/ref_view/main.cpp rename to lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/ranges/ref_view/main.cpp