[Lldb-commits] [lldb] ee4dd14 - Revert "[lldb][test] TestDataFormatterLibcxxStringSimulator.py: add new padding layout (#108375)"
Michael Buch via lldb-commits
lldb-commits at lists.llvm.org
Thu Oct 3 07:01:24 PDT 2024
Author: Michael Buch
Date: 2024-10-03T14:59:47+01:00
New Revision: ee4dd147baff8f971f3ec5aad5a216ca9837a732
URL: https://github.com/llvm/llvm-project/commit/ee4dd147baff8f971f3ec5aad5a216ca9837a732
DIFF: https://github.com/llvm/llvm-project/commit/ee4dd147baff8f971f3ec5aad5a216ca9837a732.diff
LOG: Revert "[lldb][test] TestDataFormatterLibcxxStringSimulator.py: add new padding layout (#108375)"
This reverts commit d5f6e886ff0df8265d44ab0646afcb4a06e6475a.
Caused failure on Windows CI. Following test failed:
```
Config=aarch64-C:\Users\tcwg\llvm-worker\lldb-aarch64-windows\build\bin\clang.exe
======================================================================
FAIL: test_r5_c2_ALTERNATE_LAYOUT (TestDataFormatterLibcxxStringSimulator.LibcxxStringDataFormatterSimulatorTestCase.test_r5_c2_ALTERNATE_LAYOUT)
partial(func, *args, **keywords) - new function with partial application
----------------------------------------------------------------------
Traceback (most recent call last):
File "C:\Users\tcwg\llvm-worker\lldb-aarch64-windows\llvm-project\lldb\test\API\functionalities\data-formatter\data-formatter-stl\libcxx-simulators\string\TestDataFormatterLibcxxStringSimulator.py", line 23, in _run_test
self.expect_var_path("longstring", summary='"I am a very long string"')
File "C:\Users\tcwg\llvm-worker\lldb-aarch64-windows\llvm-project\lldb\packages\Python\lldbsuite\test\lldbtest.py", line 2552, in expect_var_path
value_check.check_value(self, eval_result, str(eval_result))
File "C:\Users\tcwg\llvm-worker\lldb-aarch64-windows\llvm-project\lldb\packages\Python\lldbsuite\test\lldbtest.py", line 321, in check_value
test_base.assertEqual(
AssertionError: '"I am a very long string"' != '""'
- "I am a very long string"
+ ""
: (std::__lldb::string) longstring = ""
Checking SBValue: (std::__lldb::string) longstring = ""
```
We may need to use `msvc::no_unique_address` around the simulators.
Added:
Modified:
lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx-simulators/string/TestDataFormatterLibcxxStringSimulator.py
lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx-simulators/string/main.cpp
Removed:
################################################################################
diff --git a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx-simulators/string/TestDataFormatterLibcxxStringSimulator.py b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx-simulators/string/TestDataFormatterLibcxxStringSimulator.py
index fff181440b6d7c..afe6374e55a355 100644
--- a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx-simulators/string/TestDataFormatterLibcxxStringSimulator.py
+++ b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx-simulators/string/TestDataFormatterLibcxxStringSimulator.py
@@ -27,7 +27,7 @@ def _run_test(self, defines):
for v in [None, "ALTERNATE_LAYOUT"]:
- for r in range(6):
+ for r in range(5):
for c in range(3):
name = "test_r%d_c%d" % (r, c)
defines = ["REVISION=%d" % r, "COMPRESSED_PAIR_REV=%d" % c]
diff --git a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx-simulators/string/main.cpp b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx-simulators/string/main.cpp
index 628d32c8d7a55e..f8fc13c10c4372 100644
--- a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx-simulators/string/main.cpp
+++ b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx-simulators/string/main.cpp
@@ -20,11 +20,7 @@
// Pre-D128285 layout.
#define PACKED_ANON_STRUCT
#endif
-#if REVISION <= 4
-// Pre-2a1ef74 layout.
-#define NON_STANDARD_PADDING
-#endif
-// REVISION == 5: current layout
+// REVISION == 4: current layout
#ifdef PACKED_ANON_STRUCT
#define BEGIN_PACKED_ANON_STRUCT struct __attribute__((packed)) {
@@ -38,7 +34,6 @@
namespace std {
namespace __lldb {
-#ifdef NON_STANDARD_PADDING
#if defined(ALTERNATE_LAYOUT) && defined(SUBCLASS_PADDING)
template <class _CharT, size_t = sizeof(_CharT)> struct __padding {
unsigned char __xx[sizeof(_CharT) - 1];
@@ -46,13 +41,6 @@ template <class _CharT, size_t = sizeof(_CharT)> struct __padding {
template <class _CharT> struct __padding<_CharT, 1> {};
#endif
-#else // !NON_STANDARD_PADDING
-template <size_t _PaddingSize> struct __padding {
- char __padding_[_PaddingSize];
-};
-
-template <> struct __padding<0> {};
-#endif
template <class _CharT, class _Traits, class _Allocator> class basic_string {
public:
@@ -89,12 +77,7 @@ template <class _CharT, class _Traits, class _Allocator> class basic_string {
};
#else // !SUBCLASS_PADDING
-#ifdef NON_STANDARD_PADDING
unsigned char __padding[sizeof(value_type) - 1];
-#else
- [[no_unique_address]] __padding<sizeof(value_type) - 1> __padding_;
-#endif
-
#ifdef BITMASKS
unsigned char __size_;
#else // !BITMASKS
@@ -146,26 +129,21 @@ template <class _CharT, class _Traits, class _Allocator> class basic_string {
union {
#ifdef BITMASKS
unsigned char __size_;
-#else // !BITMASKS
+#else
struct {
unsigned char __is_long_ : 1;
unsigned char __size_ : 7;
};
-#endif // BITMASKS
+#endif
value_type __lx;
};
-#else // !SHORT_UNION
+#else
BEGIN_PACKED_ANON_STRUCT
unsigned char __is_long_ : 1;
unsigned char __size_ : 7;
END_PACKED_ANON_STRUCT
-#ifdef NON_STANDARD_PADDING
- unsigned char __padding[sizeof(value_type) - 1];
-#else // !NON_STANDARD_PADDING
- [[no_unique_address]] __padding<sizeof(value_type) - 1> __padding_;
-#endif // NON_STANDARD_PADDING
-
-#endif // SHORT_UNION
+ char __padding_[sizeof(value_type) - 1];
+#endif
value_type __data_[__min_cap];
};
More information about the lldb-commits
mailing list