1#include <map>
2#include <string>
3
4#define intint_map std::map<int, int>
5#define strint_map std::map<std::string, int>
6#define intstr_map std::map<int, std::string>
7#define strstr_map std::map<std::string, std::string>
8
9int g_the_foo = 0;
10
11int thefoo_rw(int arg = 1) {
12 if (arg < 0)
13 arg = 0;
14 if (!arg)
15 arg = 1;
16 g_the_foo += arg;
17 return g_the_foo;
18}
19
20int main() {
21 intint_map ii;
22
23 ii[0] = 0; // Set break point at this line.
24 ii[1] = 1;
25
26 intint_map::iterator it = ii.begin();
27 intint_map::const_iterator const_it = ii.cbegin();
28 std::printf(format: "%d %d\n", it->second, const_it->second);
29
30 thefoo_rw(arg: 1); // Set break point at this line.
31 ii[2] = 0;
32 ii[3] = 1;
33 thefoo_rw(arg: 1); // Set break point at this line.
34 ii[4] = 0;
35 ii[5] = 1;
36 ii[6] = 0;
37 ii[7] = 1;
38 thefoo_rw(arg: 1); // Set break point at this line.
39 ii[85] = 1234567;
40
41 ii.clear();
42
43 strint_map si;
44 thefoo_rw(arg: 1); // Set break point at this line.
45
46 si["zero"] = 0;
47 thefoo_rw(arg: 1); // Set break point at this line.
48 si["one"] = 1;
49 si["two"] = 2;
50 si["three"] = 3;
51 thefoo_rw(arg: 1); // Set break point at this line.
52 si["four"] = 4;
53
54 si.clear();
55 thefoo_rw(arg: 1); // Set break point at this line.
56
57 intstr_map is;
58 thefoo_rw(arg: 1); // Set break point at this line.
59 is[85] = "goofy";
60 is[1] = "is";
61 is[2] = "smart";
62 is[3] = "!!!";
63 thefoo_rw(arg: 1); // Set break point at this line.
64
65 is.clear();
66 thefoo_rw(arg: 1); // Set break point at this line.
67
68 strstr_map ss;
69 thefoo_rw(arg: 1); // Set break point at this line.
70
71 ss["ciao"] = "hello";
72 ss["casa"] = "house";
73 ss["gatto"] = "cat";
74 thefoo_rw(arg: 1); // Set break point at this line.
75 ss["a Mac.."] = "..is always a Mac!";
76
77 ss.clear();
78 thefoo_rw(arg: 1); // Set break point at this line.
79 return 0;
80}
81

source code of lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/map/main.cpp