]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/unordered/main.cpp
Vendor import of lldb trunk r256945:
[FreeBSD/FreeBSD.git] / packages / Python / lldbsuite / test / functionalities / data-formatter / data-formatter-stl / libcxx / unordered / main.cpp
1 #include <string>
2 #ifdef _LIBCPP_INLINE_VISIBILITY
3 #undef _LIBCPP_INLINE_VISIBILITY
4 #endif
5 #define _LIBCPP_INLINE_VISIBILITY
6 #include <unordered_map>
7 #include <unordered_set>
8
9 using std::string;
10
11 #define intstr_map std::unordered_map<int, string> 
12 #define intstr_mmap std::unordered_multimap<int, string> 
13
14 #define int_set std::unordered_set<int> 
15 #define str_set std::unordered_set<string> 
16 #define int_mset std::unordered_multiset<int> 
17 #define str_mset std::unordered_multiset<string> 
18
19 int g_the_foo = 0;
20
21 int thefoo_rw(int arg = 1)
22 {
23         if (arg < 0)
24                 arg = 0;
25         if (!arg)
26                 arg = 1;
27         g_the_foo += arg;
28         return g_the_foo;
29 }
30
31 int main()
32 {
33         intstr_map map;
34         map.emplace(1,"hello");
35         map.emplace(2,"world");
36         map.emplace(3,"this");
37         map.emplace(4,"is");
38         map.emplace(5,"me");
39         thefoo_rw();  // Set break point at this line.
40         
41         intstr_mmap mmap;
42         mmap.emplace(1,"hello");
43         mmap.emplace(2,"hello");
44         mmap.emplace(2,"world");
45         mmap.emplace(3,"this");
46         mmap.emplace(3,"this");
47         mmap.emplace(3,"this");
48         thefoo_rw();  // Set break point at this line.
49         
50         int_set iset;
51         iset.emplace(1);
52         iset.emplace(2);
53         iset.emplace(3);
54         iset.emplace(4);
55         iset.emplace(5);
56         thefoo_rw();  // Set break point at this line.
57         
58         str_set sset;
59         sset.emplace("hello");
60         sset.emplace("world");
61         sset.emplace("this");
62         sset.emplace("is");
63         sset.emplace("me");
64         thefoo_rw();  // Set break point at this line.
65         
66         int_mset imset;
67         imset.emplace(1);
68         imset.emplace(2);
69         imset.emplace(2);
70         imset.emplace(3);
71         imset.emplace(3);
72         imset.emplace(3);
73         thefoo_rw();  // Set break point at this line.
74         
75         str_mset smset;
76         smset.emplace("hello");
77         smset.emplace("world");
78         smset.emplace("world");
79         smset.emplace("is");
80         smset.emplace("is");
81         thefoo_rw();  // Set break point at this line.
82         
83     return 0;
84 }