Skip to content

Commit ad05d0f

Browse files
committed
fixup! adjust simulator tests
1 parent 94c0bdd commit ad05d0f

File tree

5 files changed

+31
-9
lines changed

5 files changed

+31
-9
lines changed

lldb/packages/Python/lldbsuite/test/make/libcxx-simulators-common/compressed_pair.h

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
// 0 -> Post-c88580c layout
99
// 1 -> Post-27c83382d83dc layout
1010
// 2 -> Post-769c42f4a552a layout
11-
// 3 -> padding-less no_unique_address-based layout (introduced in 27c83382d83dc)
11+
// 3 -> Post-f5e687d7bf49c layout
12+
// 4 -> padding-less no_unique_address-based layout (introduced in
13+
// 27c83382d83dc)
1214

1315
namespace std {
1416
namespace __lldb {
@@ -42,7 +44,7 @@ template <class _ToPad> class __compressed_pair_padding {
4244
? 0
4345
: sizeof(_ToPad) - __datasizeof_v<_ToPad>];
4446
};
45-
#elif COMPRESSED_PAIR_REV > 1 && COMPRESSED_PAIR_REV < 3
47+
#elif COMPRESSED_PAIR_REV > 1 && COMPRESSED_PAIR_REV < 4
4648
template <class _ToPad>
4749
inline const bool __is_reference_or_unpadded_object =
4850
(std::is_empty<_ToPad>::value && !__lldb_is_final<_ToPad>::value) ||
@@ -125,6 +127,27 @@ class __compressed_pair : private __compressed_pair_elem<_T1, 0>,
125127
_LLDB_NO_UNIQUE_ADDRESS T3 Initializer3; \
126128
_LLDB_NO_UNIQUE_ADDRESS __compressed_pair_padding<T3> __padding3_;
127129
#elif COMPRESSED_PAIR_REV == 3
130+
#define _LLDB_COMPRESSED_PAIR(T1, Initializer1, T2, Initializer2) \
131+
struct { \
132+
[[__gnu__::__aligned__( \
133+
alignof(T2))]] _LLDB_NO_UNIQUE_ADDRESS T1 Initializer1; \
134+
_LLDB_NO_UNIQUE_ADDRESS __compressed_pair_padding<T1> __padding1_; \
135+
_LLDB_NO_UNIQUE_ADDRESS T2 Initializer2; \
136+
_LLDB_NO_UNIQUE_ADDRESS __compressed_pair_padding<T2> __padding2_; \
137+
}
138+
139+
#define _LLDB_COMPRESSED_TRIPLE(T1, Initializer1, T2, Initializer2, T3, \
140+
Initializer3) \
141+
struct { \
142+
[[using __gnu__: __aligned__(alignof(T2)), \
143+
__aligned__(alignof(T3))]] _LLDB_NO_UNIQUE_ADDRESS T1 Initializer1; \
144+
_LLDB_NO_UNIQUE_ADDRESS __compressed_pair_padding<T1> __padding1_; \
145+
_LLDB_NO_UNIQUE_ADDRESS T2 Initializer2; \
146+
_LLDB_NO_UNIQUE_ADDRESS __compressed_pair_padding<T2> __padding2_; \
147+
_LLDB_NO_UNIQUE_ADDRESS T3 Initializer3; \
148+
_LLDB_NO_UNIQUE_ADDRESS __compressed_pair_padding<T3> __padding3_; \
149+
}
150+
#elif COMPRESSED_PAIR_REV == 4
128151
#define _LLDB_COMPRESSED_PAIR(T1, Name1, T2, Name2) \
129152
_LLDB_NO_UNIQUE_ADDRESS T1 Name1; \
130153
_LLDB_NO_UNIQUE_ADDRESS T2 Name2

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def _run_test(self, defines):
2828

2929
for v in [None, "ALTERNATE_LAYOUT"]:
3030
for r in range(6):
31-
for c in range(4):
31+
for c in range(5):
3232
name = "test_r%d_c%d" % (r, c)
3333
defines = ["REVISION=%d" % r, "COMPRESSED_PAIR_REV=%d" % c]
3434
if v:

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -209,22 +209,22 @@ template <class _CharT, class _Traits, class _Allocator> class basic_string {
209209
__long &getLongRep() {
210210
#if COMPRESSED_PAIR_REV == 0
211211
return __r_.first().__l;
212-
#elif COMPRESSED_PAIR_REV <= 3
212+
#else
213213
return __rep_.__l;
214214
#endif
215215
}
216216

217217
__short &getShortRep() {
218218
#if COMPRESSED_PAIR_REV == 0
219219
return __r_.first().__s;
220-
#elif COMPRESSED_PAIR_REV <= 3
220+
#else
221221
return __rep_.__s;
222222
#endif
223223
}
224224

225225
#if COMPRESSED_PAIR_REV == 0
226226
std::__lldb::__compressed_pair<__rep, allocator_type> __r_;
227-
#elif COMPRESSED_PAIR_REV <= 3
227+
#else
228228
_LLDB_COMPRESSED_PAIR(__rep, __rep_, allocator_type, __alloc_);
229229
#endif
230230

lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx-simulators/unique_ptr/TestDataFormatterLibcxxUniquePtrSimulator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def _run_test(self, defines):
2626
)
2727

2828

29-
for r in range(4):
29+
for r in range(5):
3030
name = "test_r%d" % r
3131
defines = ["COMPRESSED_PAIR_REV=%d" % r]
3232

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ template <class _Tp, class _Dp = default_delete<_Tp>> class unique_ptr {
2020
std::__lldb::__compressed_pair<pointer, deleter_type> __ptr_;
2121
explicit unique_ptr(pointer __p) noexcept
2222
: __ptr_(__p, std::__lldb::__value_init_tag()) {}
23-
#elif COMPRESSED_PAIR_REV == 1 || COMPRESSED_PAIR_REV == 2 || \
24-
COMPRESSED_PAIR_REV == 3
23+
#else
2524
_LLDB_COMPRESSED_PAIR(pointer, __ptr_, deleter_type, __deleter_);
2625
explicit unique_ptr(pointer __p) noexcept : __ptr_(__p), __deleter_() {}
2726
#endif

0 commit comments

Comments
 (0)