Skip to content

Commit b5b1b76

Browse files
committed
fixup! add another test-case
1 parent 28ffd29 commit b5b1b76

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx-simulators/invalid-vector/TestDataFormatterLibcxxInvalidVectorSimulator.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,7 @@ def test(self):
3333
"frame variable v4",
3434
substrs=["size=error: Failed to determine start/end of vector data."],
3535
)
36+
self.expect(
37+
"frame variable v5",
38+
substrs=["size=error: Size not multiple of element size."],
39+
)

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

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,25 @@ template <typename T> struct vector {
1313
namespace __2 {
1414
template <typename T> struct vector {};
1515
} // namespace __2
16+
17+
namespace __3 {
18+
template <typename T> struct vector {
19+
T *__begin_;
20+
T *__end_;
21+
_LLDB_COMPRESSED_PAIR(short *, __cap_ = nullptr, void *, __alloc_);
22+
};
23+
} // namespace __3
1624
} // namespace std
1725

1826
int main() {
1927
int arr[] = {1, 2, 3};
2028
std::__1::vector<int> v1{.__begin_ = arr, .__end_ = nullptr};
2129
std::__1::vector<int> v2{.__begin_ = nullptr, .__end_ = arr};
22-
std::__1::vector<int> v3{.__begin_ = &arr[3], .__end_ = arr};
30+
std::__1::vector<int> v3{.__begin_ = &arr[2], .__end_ = arr};
2331
std::__2::vector<int> v4;
2432

33+
char carr[] = {'a'};
34+
std::__3::vector<char> v5{.__begin_=carr, .__end_=carr + 1};
35+
2536
return 0;
2637
}

0 commit comments

Comments
 (0)