]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - tools/lldb-perf/common/stepping/stepping-testcase.cpp
Vendor import of lldb trunk r290819:
[FreeBSD/FreeBSD.git] / tools / lldb-perf / common / stepping / stepping-testcase.cpp
1 #include <stdio.h>
2 #include <string>
3 #include <vector>
4
5 struct struct_for_copying {
6   struct_for_copying(int in_int, double in_double, const char *in_string)
7       : int_value(in_int), double_value(in_double), string_value(in_string) {}
8   struct_for_copying() { struct_for_copying(0, 0, ""); }
9
10   int int_value;
11   double double_value;
12   std::string string_value;
13 };
14
15 int main(int argc, char **argv) {
16   struct_for_copying input_struct(150 * argc, 10.0 * argc, argv[0]);
17   struct_for_copying output_struct;
18   int some_int = 44;
19   double some_double = 34.5;
20   double other_double;
21   size_t vector_size;
22   std::vector<struct_for_copying> my_vector;
23
24   printf("Here is some code to stop at originally.  Got: %d, %p.\n", argc,
25          argv);
26   output_struct = input_struct;
27   other_double = (some_double * some_int) / ((double)argc);
28   other_double = other_double > 0
29                      ? some_double / other_double
30                      : some_double > 0 ? other_double / some_double : 10.0;
31   my_vector.push_back(input_struct);
32   vector_size = my_vector.size();
33
34   return vector_size == 0 ? 0 : 1;
35 }