1 //===-- main.cpp ------------------------------------------------*- C++ -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
18 i_am_cool(int I, float F, char C) :
19 integer(I), floating(F), character(C) {}
20 i_am_cool() : integer(1), floating(2), character('3') {}
27 i_am_cool second_cool;
30 i_am_cooler(int I1, int I2, float F1, float F2, char C1, char C2) :
32 second_cool(I2,F2,C2),
33 floating((F1 + F2)/2) {}
40 IWrapPointers() : int_pointer(new int(4)), float_pointer(new float(1.111)) {}
48 Simple(int X, float Y, char Z) :
55 struct SimpleWithPointers
60 SimpleWithPointers(int X, float Y, char Z) :
72 SimpleWithPointers sp;
74 Couple(int X, float Y, char Z) : sp(X,Y,Z),
75 s(new Simple(X,Y,Z)) {}
135 int main (int argc, const char * argv[])
140 i_am_cool cool_boy(1,0.5,3);
141 i_am_cooler cooler_boy(1,2,0.1,0.2,'A','B');
143 i_am_cool *cool_pointer = new i_am_cool(3,-3.141592,'E');
145 i_am_cool cool_array[5];
147 cool_array[3].floating = 5.25;
148 cool_array[4].integer = 6;
149 cool_array[2].character = 'Q';
151 int int_array[] = {1,2,3,4,5};
153 IWrapPointers wrapper;
157 int* pointer = &cool_array[4].integer;
159 IWrapPointers *wrap_pointer = &wrapper;
161 Couple couple(9,9.99,'X');
163 SimpleWithPointers sparray[] =
164 {SimpleWithPointers(-1,-2,'3'),
165 SimpleWithPointers(-4,-5,'6'),
166 SimpleWithPointers(-7,-8,'9')};
168 Simple a_simple_object(3,0.14,'E');
172 return 0; // Set break point at this line.