]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gdb/testsuite/gdb.cp/ref-types.cc
Updated copyright notices for most files.
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.cp / ref-types.cc
CommitLineData
ef220b33
MC
1/* This test script is part of GDB, the GNU debugger.
2
9b254dd1 3 Copyright 1999, 2004, 2007, 2008 Free Software Foundation, Inc.
ef220b33
MC
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
a9762ec7 7 the Free Software Foundation; either version 3 of the License, or
ef220b33
MC
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.
a9762ec7 14
ef220b33 15 You should have received a copy of the GNU General Public License
a9762ec7 16 along with this program. If not, see <http://www.gnu.org/licenses/>.
ef220b33
MC
17 */
18
a0b3c4fd
JM
19int main2(void);
20
c906108c
SS
21void marker1 (void)
22{
23
24}
25
26
27
28int 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();
a0b3c4fd
JM
48
49 main2();
50
51 return 0;
52}
53
54int f()
55{
56 int f1;
57 f1 = 1;
58 return f1;
59}
60
61int 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
c906108c 95 return 0;
a0b3c4fd 96
c906108c 97}