Add support to GDB for the Renesas rl78 architecture.
[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-2012 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     marker1();
44
45     main2();
46
47     return 0;
48 }
49
50 int f()
51 {
52     int f1;
53     f1 = 1;
54     return f1;
55 }
56
57 int main2(void)
58 {
59     char C;
60     unsigned char UC;
61     short S;
62     unsigned short US;
63     int I;
64     unsigned int UI;
65     long L;
66     unsigned long UL;
67     float F;
68     double D;
69     char &rC = C;
70     unsigned char &rUC = UC;
71     short &rS = S;
72     unsigned short &rUS = US;
73     int &rI = I;
74     unsigned int &rUI = UI;
75     long &rL = L;
76     unsigned long &rUL = UL;
77     float &rF = F;
78     double &rD = D;
79     C = 'A';
80     UC = 21;
81     S = -14;
82     US = 7;
83     I = 102;
84     UI = 1002;
85     L = -234;
86     UL = 234;
87     F = 1.25E10;
88     D = -1.375E-123;
89     I = f();
90
91     return 0;
92     
93 }