Updated copyright notices for most files.
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.cp / ref-types.cc
1 /* This test script is part of GDB, the GNU debugger.
2
3 Copyright 1999, 2004, 2007, 2008 Free Software Foundation, Inc.
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19 int main2(void);
20
21 void marker1 (void)
22 {
23
24 }
25
26
27
28 int main(void)
29 {
30 short s;
31 short &rs = s;
32 short *ps;
33 short *&rps = ps;
34 short as[4];
35 short (&ras)[4] = as;
36 s = -1;
37 ps = &s;
38 as[0] = 0;
39 as[1] = 1;
40 as[2] = 2;
41 as[3] = 3;
42
43 #ifdef usestubs
44 set_debug_traps();
45 breakpoint();
46 #endif
47 marker1();
48
49 main2();
50
51 return 0;
52 }
53
54 int f()
55 {
56 int f1;
57 f1 = 1;
58 return f1;
59 }
60
61 int main2(void)
62 {
63 char C;
64 unsigned char UC;
65 short S;
66 unsigned short US;
67 int I;
68 unsigned int UI;
69 long L;
70 unsigned long UL;
71 float F;
72 double D;
73 char &rC = C;
74 unsigned char &rUC = UC;
75 short &rS = S;
76 unsigned short &rUS = US;
77 int &rI = I;
78 unsigned int &rUI = UI;
79 long &rL = L;
80 unsigned long &rUL = UL;
81 float &rF = F;
82 double &rD = D;
83 C = 'A';
84 UC = 21;
85 S = -14;
86 US = 7;
87 I = 102;
88 UI = 1002;
89 L = -234;
90 UL = 234;
91 F = 1.25E10;
92 D = -1.375E-123;
93 I = f();
94
95 return 0;
96
97 }
This page took 0.031315 seconds and 4 git commands to generate.