1// This smoke test ensures that LLDB doesn't crash when formatting types from MSVC's STL.
2// FIXME: LLDB currently has no built-in formatters for MSVC's STL (#24834)
3
4// REQUIRES: target-windows
5// RUN: %build --compiler=clang-cl -o %t.exe --std c++20 -- %s
6// RUN: env LLDB_USE_NATIVE_PDB_READER=1 %lldb -f %t.exe -o "b main" -o "run" -o "fr v" -o c | FileCheck %s
7
8#include <bitset>
9#include <coroutine>
10#include <deque>
11#include <forward_list>
12#include <list>
13#include <map>
14#include <memory>
15#include <optional>
16#include <set>
17#include <string>
18#include <tuple>
19#include <unordered_map>
20#include <unordered_set>
21#include <variant>
22#include <vector>
23
24int main() {
25 std::shared_ptr<int> foo;
26 std::weak_ptr<int> weak = foo;
27 std::unique_ptr<int> unique(new int(42));
28 std::optional<int> opt;
29 std::string str = "str";
30 std::string longStr = "string that is long enough such that no SSO can happen";
31 std::wstring wStr = L"wstr";
32 std::wstring longWStr = L"string that is long enough such that no SSO can happen";
33 std::tuple<int, bool, float> tuple{1, false, 4.2};
34 std::coroutine_handle<> coroHandle;
35 std::bitset<16> bitset(123);
36
37 std::map<int, int> map{{1, 2}, {2, 4}, {3, 6}, {4, 8}, {5, 10}};
38 auto mapIt = map.find(x: 3);
39 auto mapItEnd = map.find(x: 9);
40 std::set<int> set{1, 2, 3};
41 std::multimap<int, int> mMap{{1, 2}, {1, 1}, {2, 4}};
42 std::multiset<int> mSet{1, 2, 3};
43
44 std::variant<int, float, std::string, std::monostate> variant;
45 std::list<int> list{1, 2, 3};
46 std::forward_list<int> fwList{1, 2, 3};
47
48 std::unordered_map<int, int> uMap{{1, 2}, {2, 4}, {3, 6}};
49 std::unordered_set<int> uSet{1, 2, 4};
50 std::unordered_multimap<int, int> uMMap{{1, 2}, {1, 1}, {2, 4}};
51 std::unordered_multiset<int> uMSet{1, 1, 2};
52 std::deque<int> deque{1, 2, 3};
53 std::vector<int> vec{1, 2, 3};
54}
55
56// CHECK: Process {{.*}} exited with status = 0 (0x00000000)
57

source code of lldb/test/Shell/Process/Windows/msstl_smoke.cpp