summaryrefslogtreecommitdiff
path: root/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/vector/main.cpp
blob: ec7ef7f84310e4c543a0c80c3e215ca403e7fd7a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#include <stdio.h>
#include <string>
#include <vector>
typedef std::vector<int> int_vect;
typedef std::vector<std::string> string_vect;

template <class T>
void by_ref_and_ptr(std::vector<T> &ref, std::vector<T> *ptr) {
  // Stop here to check by ref
  return;
}

int main() {
  int_vect numbers;
  numbers.push_back(1);  // break here
  numbers.push_back(12); // break here
  numbers.push_back(123);
  numbers.push_back(1234);
  numbers.push_back(12345); // break here
  numbers.push_back(123456);
  numbers.push_back(1234567);
  by_ref_and_ptr(numbers, &numbers);

  printf("break here");
  numbers.clear();

  numbers.push_back(7); // break here

  string_vect strings;
  strings.push_back(std::string("goofy"));
  strings.push_back(std::string("is"));
  strings.push_back(std::string("smart"));
  printf("break here");
  strings.push_back(std::string("!!!"));

  printf("break here");
  strings.clear();

  return 0; // break here
}