]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/main.cpp
Vendor import of lldb trunk r256945:
[FreeBSD/FreeBSD.git] / packages / Python / lldbsuite / test / functionalities / data-formatter / data-formatter-stl / libcxx / map / main.cpp
1 #include <string>
2 #include <map>
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
9 int g_the_foo = 0;
10
11 int thefoo_rw(int arg = 1)
12 {
13         if (arg < 0)
14                 arg = 0;
15         if (!arg)
16                 arg = 1;
17         g_the_foo += arg;
18         return g_the_foo;
19 }
20
21 int main()
22 {
23     intint_map ii;
24     
25     ii[0] = 0; // Set break point at this line.
26     ii[1] = 1;
27         thefoo_rw(1);  // Set break point at this line.
28     ii[2] = 0;
29     ii[3] = 1;
30         thefoo_rw(1);  // Set break point at this line.
31         ii[4] = 0;
32     ii[5] = 1;
33     ii[6] = 0;
34     ii[7] = 1;
35     thefoo_rw(1);  // Set break point at this line.
36     ii[85] = 1234567;
37
38     ii.clear();
39     
40     strint_map si;
41     thefoo_rw(1);  // Set break point at this line.
42         
43     si["zero"] = 0;
44         thefoo_rw(1);  // Set break point at this line.
45     si["one"] = 1;
46     si["two"] = 2;
47     si["three"] = 3;
48         thefoo_rw(1);  // Set break point at this line.
49     si["four"] = 4;
50
51     si.clear();
52     thefoo_rw(1);  // Set break point at this line.
53         
54     intstr_map is;
55     thefoo_rw(1);  // Set break point at this line.
56     is[85] = "goofy";
57     is[1] = "is";
58     is[2] = "smart";
59     is[3] = "!!!";
60     thefoo_rw(1);  // Set break point at this line.
61         
62     is.clear();
63     thefoo_rw(1);  // Set break point at this line.
64         
65     strstr_map ss;
66     thefoo_rw(1);  // Set break point at this line.
67         
68     ss["ciao"] = "hello";
69     ss["casa"] = "house";
70     ss["gatto"] = "cat";
71     thefoo_rw(1);  // Set break point at this line.
72     ss["a Mac.."] = "..is always a Mac!";
73     
74     ss.clear();
75     thefoo_rw(1);  // Set break point at this line.    
76     return 0;
77 }