1 /* This testcase is part of GDB, the GNU debugger.
3 Copyright 2014-2017 Free Software Foundation, Inc.
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.
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.
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/>. */
36 unsigned int unsigned_int_vla[n];
40 unsigned long unsigned_long_vla[n];
43 unsigned short unsigned_short_vla[n];
44 unsigned char unsigned_char_vla[n];
45 struct foo foo_vla[n];
55 struct inner_vla_struct
60 } inner_vla_struct_object;
67 vla_struct_object.something = n;
68 inner_vla_struct_object.something = n;
69 inner_vla_struct_object.after = n;
70 for (i = 0; i < n; i++)
73 unsigned_int_vla[i] = i*2;
74 double_vla[i] = i/2.0;
75 float_vla[i] = i/2.0f;
77 unsigned_long_vla[i] = i*2;
80 unsigned_short_vla[i] = i*2;
81 unsigned_char_vla[i] = 'A';
85 vla_struct_object.vla_field[i] = i*2;
86 vla_union_object.vla_field[i] = i*2;
87 inner_vla_struct_object.vla_field[i] = i*2;
90 size_t int_size = sizeof(int_vla); /* vlas_filled */
91 size_t uint_size = sizeof(unsigned_int_vla);
92 size_t double_size = sizeof(double_vla);
93 size_t float_size = sizeof(float_vla);
94 size_t long_size = sizeof(long_vla);
95 size_t char_size = sizeof(char_vla);
96 size_t short_size = sizeof(short_vla);
97 size_t ushort_size = sizeof(unsigned_short_vla);
98 size_t uchar_size = sizeof(unsigned_char_vla);
99 size_t foo_size = sizeof(foo_vla);
100 size_t bar_size = sizeof(bar_vla);
101 size_t vla_struct_object_size = sizeof(vla_struct_object);
102 size_t vla_union_object_size = sizeof(vla_union_object);
103 size_t inner_vla_struct_object_size = sizeof(inner_vla_struct_object);
105 return; /* break_end_of_vla_factory */