1// Test that the lldb command `statistics` works.
2#include <string>
3#include <vector>
4
5template <typename T> class Box {
6 T m_value;
7
8public:
9 Box(T value) : m_value(value) {}
10};
11
12void foo() {
13 std::string str = "hello world";
14 str += "\n"; // stop here
15}
16
17void bar(int x) {
18 auto box = Box<int>(x);
19 // stop here
20}
21
22void vec() {
23 std::vector<int> int_vec = {1, 2, 3, 4, 5, 6, 7, 8};
24 std::vector<double> double_vec = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0};
25 // stop vector
26 int x = int_vec.size();
27}
28
29int main(void) {
30 int patatino = 27;
31 foo();
32 bar(x: patatino);
33 vec();
34 return 0; // break here
35}
36

source code of lldb/test/API/commands/statistics/basic/main.cpp