OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gdb-7.1/] [gdb/] [testsuite/] [gdb.base/] [pointers.c] - Blame information for rev 862

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 227 jeremybenn
 
2
#if !defined (__STDC__) && !defined (_AIX)
3
#define signed  /**/
4
#endif
5
 
6
char            v_char;
7
signed char     v_signed_char;
8
unsigned char   v_unsigned_char;
9
 
10
short           v_short;
11
signed short    v_signed_short;
12
unsigned short  v_unsigned_short;
13
 
14
int             v_int;
15
signed int      v_signed_int;
16
unsigned int    v_unsigned_int;
17
 
18
long            v_long;
19
signed long     v_signed_long;
20
unsigned long   v_unsigned_long;
21
 
22
float           v_float;
23
double          v_double;
24
 
25
 
26
 
27
char            *v_char_pointer;
28
signed char     *v_signed_char_pointer;
29
unsigned char   *v_unsigned_char_pointer;
30
 
31
short           *v_short_pointer;
32
signed short    *v_signed_short_pointer;
33
unsigned short  *v_unsigned_short_pointer;
34
 
35
int             *v_int_pointer;
36
int             *v_int_pointer2;
37
signed int      *v_signed_int_pointer;
38
unsigned int    *v_unsigned_int_pointer;
39
 
40
long            *v_long_pointer;
41
signed long     *v_signed_long_pointer;
42
unsigned long   *v_unsigned_long_pointer;
43
 
44
float           *v_float_pointer;
45
double          *v_double_pointer;
46
 
47
 
48
char            v_char_array[2];
49
signed char     v_signed_char_array[2];
50
unsigned char   v_unsigned_char_array[2];
51
 
52
short           v_short_array[2];
53
signed short    v_signed_short_array[2];
54
unsigned short  v_unsigned_short_array[2];
55
 
56
int             v_int_array[2];
57
signed int      v_signed_int_array[2];
58
unsigned int    v_unsigned_int_array[2];
59
 
60
long            v_long_array[2];
61
signed long     v_signed_long_array[2];
62
unsigned long   v_unsigned_long_array[2];
63
 
64
float           v_float_array[2];
65
double          v_double_array[2];
66
 
67
int matrix[2][3] = { { 0, 1, 2}, {3, 4, 5}};
68
int (*rptr)[3] = matrix;
69
 
70
float ** ptr_to_ptr_to_float;
71
 
72
int y;
73
 
74
 
75
typedef long k[5];
76
 
77
typedef struct {
78
  k array_variable;
79
} S;
80
 
81
S instance;
82
 
83
/* Do nothing function used for forcing some of the above variables to
84
   be referenced by the program source.  If the variables are not
85
   referenced, some linkers will remove the symbol from the symbol
86
   table making it impossible to refer to the variable in gdb.  */
87
void usevar (void *var) {}
88
 
89
int main ()
90
{
91
  void dummy();
92
  int more_code();
93
 
94
#ifdef usestubs
95
  set_debug_traps();
96
  breakpoint();
97
#endif
98
  dummy();
99
 
100
  more_code ();
101
 
102
  usevar (&v_int_pointer2);
103
  usevar (&rptr);
104
  usevar (&y);
105
 
106
  return 0;
107
 
108
}
109
 
110
void dummy()
111
{
112
 
113
 
114
  v_char = 0;
115
  v_signed_char = 1;
116
  v_unsigned_char = 2;
117
 
118
  v_short = 3;
119
  v_signed_short = 4;
120
  v_unsigned_short = 5;
121
 
122
  v_int = 6;
123
  v_signed_int = 7;
124
  v_unsigned_int = 8;
125
 
126
  v_long = 9;
127
  v_signed_long = 10;
128
  v_unsigned_long = 11;
129
 
130
  v_float = 100.0;
131
  v_double = 200.0;
132
 
133
 
134
 
135
  v_char_pointer = &v_char;
136
  v_signed_char_pointer = &v_signed_char;
137
  v_unsigned_char_pointer = &v_unsigned_char;
138
 
139
  v_short_pointer = &v_short;
140
  v_signed_short_pointer = &v_signed_short;
141
  v_unsigned_short_pointer = &v_unsigned_short;
142
 
143
  v_int_pointer = &v_int;
144
  v_signed_int_pointer = &v_signed_int;
145
  v_unsigned_int_pointer = &v_unsigned_int;
146
 
147
  v_long_pointer = &v_long;
148
  v_signed_long_pointer = &v_signed_long;
149
  v_unsigned_long_pointer = &v_unsigned_long;
150
 
151
  v_float_pointer = &v_float;
152
  v_double_pointer = &v_double;
153
 
154
  ptr_to_ptr_to_float = &v_float_pointer;
155
 
156
 
157
  v_char_array[0] = v_char;
158
  v_signed_char_array[0] = v_signed_char;
159
  v_unsigned_char_array[0] = v_unsigned_char;
160
 
161
  v_short_array[0] = v_short;
162
  v_signed_short_array[0] = v_signed_short;
163
  v_unsigned_short_array[0] = v_unsigned_short;
164
 
165
  v_int_array[0] = v_int;
166
  v_int_array[1] = v_int * 3;
167
 
168
  v_signed_int_array[0] = v_signed_int;
169
  v_unsigned_int_array[0] = v_unsigned_int;
170
 
171
  v_long_array[0] = v_long;
172
  v_signed_long_array[0] = v_signed_long;
173
  v_unsigned_long_array[0] = v_unsigned_long;
174
 
175
  v_float_array[0] = v_float;
176
  v_double_array[0] = v_double;
177
 
178
}
179
 
180
void marker1 ()
181
{
182
}
183
 
184
int more_code()
185
{
186
    char C, *pC, **ppC, ***pppC, ****ppppC, *****pppppC, ******ppppppC;
187
    unsigned char UC, *pUC;
188
    short S, *pS;
189
    unsigned short US, *pUS;
190
    int I, *pI;
191
    unsigned int UI, *pUI;
192
    long L, *pL;
193
    unsigned long UL, *pUL;
194
    float F, *pF;
195
    double D, *pD;
196
 
197
    C = 'A';
198
    UC = 21;
199
    S = -14;
200
    US = 7;
201
    I = 102;
202
    UI = 1002;
203
    L = -234;
204
    UL = 234;
205
    F = 1.25E10;
206
    D = -1.25E-37;
207
    pC = &C;
208
    ppC = &pC;
209
    pppC = &ppC;
210
    ppppC = &pppC;
211
    pppppC = &ppppC;
212
    ppppppC = &pppppC;
213
    pUC = &UC;
214
    pS = &S;
215
    pUS = &US;
216
    pI = &I;
217
    pUI = &UI;
218
    pL = &L;
219
    pUL = &UL;
220
    pF = &F;
221
    pD = &D;
222
 
223
    marker1();
224
    return 0;
225
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.