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