daily update
[external/binutils.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, 2009, 2010, 2011
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 3 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, see <http://www.gnu.org/licenses/>.
18    */
19
20 int main2(void);
21
22 void marker1 (void)
23 {
24     
25 }
26
27
28
29 int main(void)
30 {
31     short s;
32     short &rs = s;
33     short *ps;
34     short *&rps = ps;
35     short as[4];
36     short (&ras)[4] = as;
37     s = -1;
38     ps = &s;
39     as[0] = 0;
40     as[1] = 1;
41     as[2] = 2;
42     as[3] = 3;
43
44    #ifdef usestubs
45        set_debug_traps();
46        breakpoint();
47     #endif
48     marker1();
49
50     main2();
51
52     return 0;
53 }
54
55 int f()
56 {
57     int f1;
58     f1 = 1;
59     return f1;
60 }
61
62 int main2(void)
63 {
64     char C;
65     unsigned char UC;
66     short S;
67     unsigned short US;
68     int I;
69     unsigned int UI;
70     long L;
71     unsigned long UL;
72     float F;
73     double D;
74     char &rC = C;
75     unsigned char &rUC = UC;
76     short &rS = S;
77     unsigned short &rUS = US;
78     int &rI = I;
79     unsigned int &rUI = UI;
80     long &rL = L;
81     unsigned long &rUL = UL;
82     float &rF = F;
83     double &rD = D;
84     C = 'A';
85     UC = 21;
86     S = -14;
87     US = 7;
88     I = 102;
89     UI = 1002;
90     L = -234;
91     UL = 234;
92     F = 1.25E10;
93     D = -1.375E-123;
94     I = f();
95
96     return 0;
97     
98 }