Commit | Line | Data |
---|---|---|
3c8c5dcc JB |
1 | /* Copyright 2014 Free Software Foundation, Inc. |
2 | ||
3 | This file is part of GDB. | |
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 | /* This C file provides some global variables laid out in a way | |
19 | that mimicks what the GNAT Ada compiler calls "fat pointers". | |
20 | These fat pointers are the memory representation used by | |
21 | the compiler to handle dynamic arrays. | |
22 | ||
23 | Debugging information on how to decode that data into an array | |
24 | will be generated separately by the testcase using that file. */ | |
25 | ||
26 | struct fat_pointer | |
27 | { | |
28 | int *data; | |
29 | int *bounds; | |
30 | }; | |
31 | ||
32 | int table_1_data[] = {1, 2, 3}; | |
33 | int table_1_bounds[] = {1, 3}; | |
34 | struct fat_pointer table_1 = {table_1_data, table_1_bounds}; | |
35 | ||
36 | int table_2_data[] = {5, 8, 13, 21, 34}; | |
37 | int table_2_bounds[] = {2, 6}; | |
38 | struct fat_pointer table_2 = {table_2_data, table_2_bounds}; | |
39 | ||
40 | int | |
41 | main (void) | |
42 | { | |
43 | table_1.bounds[1] = 2; | |
44 | table_2.bounds[1] = 3; | |
45 | return 0; | |
46 | } |