Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(25)

Side by Side Diff: gdb/testsuite/gdb.base/setvar.c

Issue 124383005: GDB 7.6.50 (Closed) Base URL: http://git.chromium.org/native_client/nacl-gdb.git@upstream
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « gdb/testsuite/gdb.base/setshow.exp ('k') | gdb/testsuite/gdb.base/setvar.exp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #include <stdlib.h> 1 #include <stdlib.h>
2 2
3 #ifdef PROTOTYPES 3 #ifdef PROTOTYPES
4 int main (int argc, char **argv, char **envp) 4 int main (int argc, char **argv, char **envp)
5 #else 5 #else
6 main (argc, argv, envp) 6 main (argc, argv, envp)
7 int argc; 7 int argc;
8 char **argv; 8 char **argv;
9 char **envp; 9 char **envp;
10 #endif 10 #endif
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 108
109 struct { 109 struct {
110 char v_char_member; 110 char v_char_member;
111 short v_short_member; 111 short v_short_member;
112 int v_int_member; 112 int v_int_member;
113 long v_long_member; 113 long v_long_member;
114 float v_float_member; 114 float v_float_member;
115 double v_double_member; 115 double v_double_member;
116 } v_struct2; 116 } v_struct2;
117 117
118 struct
119 {
120 long v_long_member;
121 struct t_struct t;
122 char v_char_member;
123 } v_struct3;
124
118 /**** unions *******/ 125 /**** unions *******/
119 126
120 union t_union { 127 union t_union {
121 char v_char_member; 128 char v_char_member;
122 short v_short_member; 129 short v_short_member;
123 int v_int_member; 130 int v_int_member;
124 long v_long_member; 131 long v_long_member;
125 float v_float_member; 132 float v_float_member;
126 double v_double_member; 133 double v_double_member;
127 } v_union; 134 } v_union;
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 struct senum_field {enum senum field:2; } sef; 197 struct senum_field {enum senum field:2; } sef;
191 enum uenum {u1 = 1, u2 = 2}; 198 enum uenum {u1 = 1, u2 = 2};
192 struct uenum_field {enum uenum field:2; } uef; 199 struct uenum_field {enum uenum field:2; } uef;
193 #endif 200 #endif
194 201
195 void 202 void
196 dummy () 203 dummy ()
197 { 204 {
198 /* setvar.exp wants to allocate memory for constants. So make sure malloc 205 /* setvar.exp wants to allocate memory for constants. So make sure malloc
199 gets linked into the program. */ 206 gets linked into the program. */
200 malloc (1); 207 void *p = malloc (1);
201 208
202 /* Some linkers (e.g. on AIX) remove unreferenced variables, 209 /* Some linkers (e.g. on AIX) remove unreferenced variables,
203 so make sure to reference them. */ 210 so make sure to reference them. */
204 v_char = 0; 211 v_char = 0;
205 v_signed_char = 1; 212 v_signed_char = 1;
206 v_unsigned_char = 2; 213 v_unsigned_char = 2;
207 214
208 v_short = 3; 215 v_short = 3;
209 v_signed_short = 4; 216 v_signed_short = 4;
210 v_unsigned_short = 5; 217 v_unsigned_short = 5;
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 271
265 u_link.next = s_link; 272 u_link.next = s_link;
266 273
267 v_struct2.v_int_member = v_struct1.v_int_member; 274 v_struct2.v_int_member = v_struct1.v_int_member;
268 v_union2.v_short_member = v_union.v_short_member; 275 v_union2.v_short_member = v_union.v_short_member;
269 276
270 #ifdef __GNUC__ 277 #ifdef __GNUC__
271 sef.field = s1; 278 sef.field = s1;
272 uef.field = u1; 279 uef.field = u1;
273 #endif 280 #endif
281 free (p);
274 } 282 }
OLDNEW
« no previous file with comments | « gdb/testsuite/gdb.base/setshow.exp ('k') | gdb/testsuite/gdb.base/setvar.exp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698