File: stepping-testcase.cpp

package info (click to toggle)
llvm-toolchain-3.5 1%3A3.5-10
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 282,028 kB
  • ctags: 310,872
  • sloc: cpp: 1,883,926; ansic: 310,731; objc: 86,612; python: 79,565; asm: 65,844; sh: 9,829; makefile: 6,057; perl: 5,589; ml: 5,254; pascal: 3,285; lisp: 1,640; xml: 686; cs: 239; csh: 117
file content (42 lines) | stat: -rw-r--r-- 1,149 bytes parent folder | download | duplicates (8)
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
41
42
#include <stdio.h>
#include <vector>
#include <string>

struct struct_for_copying
{
    struct_for_copying (int in_int, double in_double, const char *in_string) :
        int_value(in_int),
        double_value(in_double),
        string_value (in_string)
    {
        
    }
    struct_for_copying()
    {
        struct_for_copying (0, 0, "");
    }
    
    int int_value;
    double double_value;
    std::string string_value;
};

int main (int argc, char **argv)
{
    struct_for_copying input_struct (150 * argc, 10.0 * argc, argv[0]);
    struct_for_copying output_struct;
    int some_int = 44;
    double some_double = 34.5;
    double other_double;
    size_t vector_size;
    std::vector<struct_for_copying> my_vector;
    
    printf ("Here is some code to stop at originally.  Got: %d, %p.\n", argc, argv);
    output_struct = input_struct;
    other_double = (some_double * some_int)/((double) argc);
    other_double = other_double > 0 ? some_double/other_double : some_double > 0 ? other_double/some_double : 10.0;
    my_vector.push_back (input_struct);
    vector_size = my_vector.size();
    
	return vector_size == 0 ? 0 : 1;
}