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 //===----------------------------------------------------------------------===//
13 typedef float RealNumber; // should show as char
14 typedef RealNumber Temperature; // should show as float
15 typedef RealNumber Speed; // should show as hex
17 typedef int Counter; // should show as int
18 typedef int BitField; // should show as hex
20 typedef BitField SignalMask; // should show as hex
21 typedef BitField Modifiers; // should show as hex
23 typedef Counter Accumulator; // should show as int
25 typedef int Type1; // should show as char
26 typedef Type1 Type2; // should show as hex
27 typedef Type2 Type3; // should show as char
28 typedef Type3 Type4; // should show as char
30 typedef int ChildType; // should show as int
31 typedef int AnotherChildType; // should show as int
36 Point(int X = 3, int Y = 2) : x(X), y(Y) {}
39 typedef float ShowMyGuts;
46 i_am_cool(int I, ShowMyGuts F, char C) :
47 integer(I), floating(F), character(C) {}
48 i_am_cool() : integer(1), floating(2), character('3') {}
55 i_am_cool second_cool;
58 i_am_cooler(int I1, int I2, float F1, float F2, char C1, char C2) :
60 second_cool(I2,F2,C2),
61 floating((F1 + F2)/2) {}
67 IUseCharStar() : pointer("Hello world") {}
70 int main (int argc, const char * argv[])
74 const float& IAmFloat = float(2.45);
76 RealNumber RNILookChar = 3.14;
77 Temperature TMILookFloat = 4.97;
78 Speed SPILookHex = 5.55;
80 Counter CTILookInt = 6;
81 BitField BFILookHex = 7;
82 SignalMask SMILookHex = 8;
83 Modifiers MFILookHex = 9;
85 Accumulator* ACILookInt = new Accumulator(10);
87 const Type1& T1ILookChar = 11;
88 Type2 T2ILookHex = 12;
89 Type3 T3ILookChar = 13;
90 Type4 T4ILookChar = 14;
92 AnotherChildType AHILookInt = 15;
94 Speed* SPPtrILookHex = new Speed(16);
96 Point iAmSomewhere(4,6);
98 i_am_cool *cool_pointer = (i_am_cool*)malloc(sizeof(i_am_cool)*3);
99 cool_pointer[0] = i_am_cool(3,-3.141592,'E');
100 cool_pointer[1] = i_am_cool(0,-3.141592,'E');
101 cool_pointer[2] = i_am_cool(0,-3.141592,'E');
103 i_am_cool cool_array[5];
105 cool_array[3].floating = 5.25;
106 cool_array[4].integer = 6;
107 cool_array[2].character = 'Q';
109 int int_array[] = {1,2,3,4,5};
111 IUseCharStar iEncapsulateCharStar;
113 char strarr[32] = "Hello world!";
114 char* strptr = "Hello world!";
116 i_am_cooler the_coolest_guy(1,2,3.14,6.28,'E','G');
118 return 0; // Set break point at this line.