Skip to content

Commit ee4dd14

Browse files
committed
Revert "[lldb][test] TestDataFormatterLibcxxStringSimulator.py: add new padding layout (llvm#108375)"
This reverts commit d5f6e88. 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.
1 parent 34d0c99 commit ee4dd14

File tree

2 files changed

+7
-29
lines changed

2 files changed

+7
-29
lines changed

lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx-simulators/string/TestDataFormatterLibcxxStringSimulator.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def _run_test(self, defines):
2727

2828

2929
for v in [None, "ALTERNATE_LAYOUT"]:
30-
for r in range(6):
30+
for r in range(5):
3131
for c in range(3):
3232
name = "test_r%d_c%d" % (r, c)
3333
defines = ["REVISION=%d" % r, "COMPRESSED_PAIR_REV=%d" % c]

lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx-simulators/string/main.cpp

+6-28
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,7 @@
2020
// Pre-D128285 layout.
2121
#define PACKED_ANON_STRUCT
2222
#endif
23-
#if REVISION <= 4
24-
// Pre-2a1ef74 layout.
25-
#define NON_STANDARD_PADDING
26-
#endif
27-
// REVISION == 5: current layout
23+
// REVISION == 4: current layout
2824

2925
#ifdef PACKED_ANON_STRUCT
3026
#define BEGIN_PACKED_ANON_STRUCT struct __attribute__((packed)) {
@@ -38,21 +34,13 @@
3834
namespace std {
3935
namespace __lldb {
4036

41-
#ifdef NON_STANDARD_PADDING
4237
#if defined(ALTERNATE_LAYOUT) && defined(SUBCLASS_PADDING)
4338
template <class _CharT, size_t = sizeof(_CharT)> struct __padding {
4439
unsigned char __xx[sizeof(_CharT) - 1];
4540
};
4641

4742
template <class _CharT> struct __padding<_CharT, 1> {};
4843
#endif
49-
#else // !NON_STANDARD_PADDING
50-
template <size_t _PaddingSize> struct __padding {
51-
char __padding_[_PaddingSize];
52-
};
53-
54-
template <> struct __padding<0> {};
55-
#endif
5644

5745
template <class _CharT, class _Traits, class _Allocator> class basic_string {
5846
public:
@@ -89,12 +77,7 @@ template <class _CharT, class _Traits, class _Allocator> class basic_string {
8977
};
9078
#else // !SUBCLASS_PADDING
9179

92-
#ifdef NON_STANDARD_PADDING
9380
unsigned char __padding[sizeof(value_type) - 1];
94-
#else
95-
[[no_unique_address]] __padding<sizeof(value_type) - 1> __padding_;
96-
#endif
97-
9881
#ifdef BITMASKS
9982
unsigned char __size_;
10083
#else // !BITMASKS
@@ -146,26 +129,21 @@ template <class _CharT, class _Traits, class _Allocator> class basic_string {
146129
union {
147130
#ifdef BITMASKS
148131
unsigned char __size_;
149-
#else // !BITMASKS
132+
#else
150133
struct {
151134
unsigned char __is_long_ : 1;
152135
unsigned char __size_ : 7;
153136
};
154-
#endif // BITMASKS
137+
#endif
155138
value_type __lx;
156139
};
157-
#else // !SHORT_UNION
140+
#else
158141
BEGIN_PACKED_ANON_STRUCT
159142
unsigned char __is_long_ : 1;
160143
unsigned char __size_ : 7;
161144
END_PACKED_ANON_STRUCT
162-
#ifdef NON_STANDARD_PADDING
163-
unsigned char __padding[sizeof(value_type) - 1];
164-
#else // !NON_STANDARD_PADDING
165-
[[no_unique_address]] __padding<sizeof(value_type) - 1> __padding_;
166-
#endif // NON_STANDARD_PADDING
167-
168-
#endif // SHORT_UNION
145+
char __padding_[sizeof(value_type) - 1];
146+
#endif
169147
value_type __data_[__min_cap];
170148
};
171149

0 commit comments

Comments
 (0)