1/* This testcase is part of GDB, the GNU debugger. 2 3 Copyright 1996, 1999, 2003, 2007 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 Please email any bugs, comments, and/or additions to this file to: 19 bug-gdb@prep.ai.mit.edu */ 20 21/* Useful abreviations. */ 22typedef void t; 23typedef char tc; 24typedef short ts; 25typedef int ti; 26typedef long tl; 27typedef long long tll; 28typedef float tf; 29typedef double td; 30typedef long double tld; 31 32/* Force the type of each field. */ 33#ifndef tA 34typedef t tA; 35#endif 36#ifndef tB 37typedef tA tB; 38#endif 39#ifndef tC 40typedef tB tC; 41#endif 42#ifndef tD 43typedef tC tD; 44#endif 45#ifndef tE 46typedef tD tE; 47#endif 48#ifndef tF 49typedef tE tF; 50#endif 51#ifndef tG 52typedef tF tG; 53#endif 54#ifndef tH 55typedef tG tH; 56#endif 57#ifndef tI 58typedef tH tI; 59#endif 60#ifndef tJ 61typedef tI tJ; 62#endif 63#ifndef tK 64typedef tJ tK; 65#endif 66#ifndef tL 67typedef tK tL; 68#endif 69#ifndef tM 70typedef tL tM; 71#endif 72#ifndef tN 73typedef tM tN; 74#endif 75#ifndef tO 76typedef tN tO; 77#endif 78#ifndef tP 79typedef tO tP; 80#endif 81#ifndef tQ 82typedef tP tQ; 83#endif 84#ifndef tR 85typedef tQ tR; 86#endif 87 88struct struct1 {tA a;}; 89struct struct2 {tA a; tB b;}; 90struct struct3 {tA a; tB b; tC c; }; 91struct struct4 {tA a; tB b; tC c; tD d; }; 92struct struct5 {tA a; tB b; tC c; tD d; tE e; }; 93struct struct6 {tA a; tB b; tC c; tD d; tE e; tF f; }; 94struct struct7 {tA a; tB b; tC c; tD d; tE e; tF f; tG g; }; 95struct struct8 {tA a; tB b; tC c; tD d; tE e; tF f; tG g; tH h; }; 96struct struct9 {tA a; tB b; tC c; tD d; tE e; tF f; tG g; tH h; tI i; }; 97struct struct10 {tA a; tB b; tC c; tD d; tE e; tF f; tG g; tH h; tI i; tJ j; }; 98struct struct11 {tA a; tB b; tC c; tD d; tE e; tF f; tG g; tH h; tI i; tJ j; tK k; }; 99struct struct12 {tA a; tB b; tC c; tD d; tE e; tF f; tG g; tH h; tI i; tJ j; tK k; tL l; }; 100struct struct13 {tA a; tB b; tC c; tD d; tE e; tF f; tG g; tH h; tI i; tJ j; tK k; tL l; tM m; }; 101struct struct14 {tA a; tB b; tC c; tD d; tE e; tF f; tG g; tH h; tI i; tJ j; tK k; tL l; tM m; tN n; }; 102struct struct15 {tA a; tB b; tC c; tD d; tE e; tF f; tG g; tH h; tI i; tJ j; tK k; tL l; tM m; tN n; tO o; }; 103struct struct16 {tA a; tB b; tC c; tD d; tE e; tF f; tG g; tH h; tI i; tJ j; tK k; tL l; tM m; tN n; tO o; tP p; }; 104struct struct17 {tA a; tB b; tC c; tD d; tE e; tF f; tG g; tH h; tI i; tJ j; tK k; tL l; tM m; tN n; tO o; tP p; tQ q; }; 105struct struct18 {tA a; tB b; tC c; tD d; tE e; tF f; tG g; tH h; tI i; tJ j; tK k; tL l; tM m; tN n; tO o; tP p; tQ q; tR r; }; 106 107struct struct1 foo1 = {'1'}, L1; 108struct struct2 foo2 = {'a','2'}, L2; 109struct struct3 foo3 = {'1','b','3'}, L3; 110struct struct4 foo4 = {'a','2','c','4'}, L4; 111struct struct5 foo5 = {'1','b','3','d','5'}, L5; 112struct struct6 foo6 = {'a','2','c','4','e','6'}, L6; 113struct struct7 foo7 = {'1','b','3','d','5','f','7'}, L7; 114struct struct8 foo8 = {'a','2','c','4','e','6','g','8'}, L8; 115struct struct9 foo9 = {'1','b','3','d','5','f','7','h','9'}, L9; 116struct struct10 foo10 = {'a','2','c','4','e','6','g','8','i','A'}, L10; 117struct struct11 foo11 = {'1','b','3','d','5','f','7','h','9','j','B'}, L11; 118struct struct12 foo12 = {'a','2','c','4','e','6','g','8','i','A','k','C'}, L12; 119struct struct13 foo13 = {'1','b','3','d','5','f','7','h','9','j','B','l','D'}, L13; 120struct struct14 foo14 = {'a','2','c','4','e','6','g','8','i','A','k','C','m','E'}, L14; 121struct struct15 foo15 = {'1','b','3','d','5','f','7','h','9','j','B','l','D','n','F'}, L15; 122struct struct16 foo16 = {'a','2','c','4','e','6','g','8','i','A','k','C','m','E','o','G'}, L16; 123struct struct17 foo17 = {'1','b','3','d','5','f','7','h','9','j','B','l','D','n','F','p','H'}, L17; 124struct struct18 foo18 = {'a','2','c','4','e','6','g','8','i','A','k','C','m','E','o','G','q','I'}, L18; 125 126struct struct1 fun1() 127{ 128 return foo1; 129} 130struct struct2 fun2() 131{ 132 return foo2; 133} 134struct struct3 fun3() 135{ 136 return foo3; 137} 138struct struct4 fun4() 139{ 140 return foo4; 141} 142struct struct5 fun5() 143{ 144 return foo5; 145} 146struct struct6 fun6() 147{ 148 return foo6; 149} 150struct struct7 fun7() 151{ 152 return foo7; 153} 154struct struct8 fun8() 155{ 156 return foo8; 157} 158struct struct9 fun9() 159{ 160 return foo9; 161} 162struct struct10 fun10() 163{ 164 return foo10; 165} 166struct struct11 fun11() 167{ 168 return foo11; 169} 170struct struct12 fun12() 171{ 172 return foo12; 173} 174struct struct13 fun13() 175{ 176 return foo13; 177} 178struct struct14 fun14() 179{ 180 return foo14; 181} 182struct struct15 fun15() 183{ 184 return foo15; 185} 186struct struct16 fun16() 187{ 188 return foo16; 189} 190struct struct17 fun17() 191{ 192 return foo17; 193} 194struct struct18 fun18() 195{ 196 return foo18; 197} 198 199#ifdef PROTOTYPES 200void Fun1(struct struct1 foo1) 201#else 202void Fun1(foo1) 203 struct struct1 foo1; 204#endif 205{ 206 L1 = foo1; 207} 208#ifdef PROTOTYPES 209void Fun2(struct struct2 foo2) 210#else 211void Fun2(foo2) 212 struct struct2 foo2; 213#endif 214{ 215 L2 = foo2; 216} 217#ifdef PROTOTYPES 218void Fun3(struct struct3 foo3) 219#else 220void Fun3(foo3) 221 struct struct3 foo3; 222#endif 223{ 224 L3 = foo3; 225} 226#ifdef PROTOTYPES 227void Fun4(struct struct4 foo4) 228#else 229void Fun4(foo4) 230 struct struct4 foo4; 231#endif 232{ 233 L4 = foo4; 234} 235#ifdef PROTOTYPES 236void Fun5(struct struct5 foo5) 237#else 238void Fun5(foo5) 239 struct struct5 foo5; 240#endif 241{ 242 L5 = foo5; 243} 244#ifdef PROTOTYPES 245void Fun6(struct struct6 foo6) 246#else 247void Fun6(foo6) 248 struct struct6 foo6; 249#endif 250{ 251 L6 = foo6; 252} 253#ifdef PROTOTYPES 254void Fun7(struct struct7 foo7) 255#else 256void Fun7(foo7) 257 struct struct7 foo7; 258#endif 259{ 260 L7 = foo7; 261} 262#ifdef PROTOTYPES 263void Fun8(struct struct8 foo8) 264#else 265void Fun8(foo8) 266 struct struct8 foo8; 267#endif 268{ 269 L8 = foo8; 270} 271#ifdef PROTOTYPES 272void Fun9(struct struct9 foo9) 273#else 274void Fun9(foo9) 275 struct struct9 foo9; 276#endif 277{ 278 L9 = foo9; 279} 280#ifdef PROTOTYPES 281void Fun10(struct struct10 foo10) 282#else 283void Fun10(foo10) 284 struct struct10 foo10; 285#endif 286{ 287 L10 = foo10; 288} 289#ifdef PROTOTYPES 290void Fun11(struct struct11 foo11) 291#else 292void Fun11(foo11) 293 struct struct11 foo11; 294#endif 295{ 296 L11 = foo11; 297} 298#ifdef PROTOTYPES 299void Fun12(struct struct12 foo12) 300#else 301void Fun12(foo12) 302 struct struct12 foo12; 303#endif 304{ 305 L12 = foo12; 306} 307#ifdef PROTOTYPES 308void Fun13(struct struct13 foo13) 309#else 310void Fun13(foo13) 311 struct struct13 foo13; 312#endif 313{ 314 L13 = foo13; 315} 316#ifdef PROTOTYPES 317void Fun14(struct struct14 foo14) 318#else 319void Fun14(foo14) 320 struct struct14 foo14; 321#endif 322{ 323 L14 = foo14; 324} 325#ifdef PROTOTYPES 326void Fun15(struct struct15 foo15) 327#else 328void Fun15(foo15) 329 struct struct15 foo15; 330#endif 331{ 332 L15 = foo15; 333} 334#ifdef PROTOTYPES 335void Fun16(struct struct16 foo16) 336#else 337void Fun16(foo16) 338 struct struct16 foo16; 339#endif 340{ 341 L16 = foo16; 342} 343#ifdef PROTOTYPES 344void Fun17(struct struct17 foo17) 345#else 346void Fun17(foo17) 347 struct struct17 foo17; 348#endif 349{ 350 L17 = foo17; 351} 352#ifdef PROTOTYPES 353void Fun18(struct struct18 foo18) 354#else 355void Fun18(foo18) 356 struct struct18 foo18; 357#endif 358{ 359 L18 = foo18; 360} 361 362zed () 363{ 364 365 L1.a = L2.a = L3.a = L4.a = L5.a = L6.a = L7.a = L8.a = L9.a = L10.a = L11.a = L12.a = L13.a = L14.a = L15.a = L16.a = L17.a = L18.a = 'Z'; 366 367 L2.b = L3.b = L4.b = L5.b = L6.b = L7.b = L8.b = L9.b = L10.b = L11.b = L12.b = L13.b = L14.b = L15.b = L16.b = L17.b = L18.b = 'Z'; 368 369 L3.c = L4.c = L5.c = L6.c = L7.c = L8.c = L9.c = L10.c = L11.c = L12.c = L13.c = L14.c = L15.c = L16.c = L17.c = L18.c = 'Z'; 370 371 L4.d = L5.d = L6.d = L7.d = L8.d = L9.d = L10.d = L11.d = L12.d = L13.d = L14.d = L15.d = L16.d = L17.d = L18.d = 'Z'; 372 373 L5.e = L6.e = L7.e = L8.e = L9.e = L10.e = L11.e = L12.e = L13.e = L14.e = L15.e = L16.e = L17.e = L18.e = 'Z'; 374 375 L6.f = L7.f = L8.f = L9.f = L10.f = L11.f = L12.f = L13.f = L14.f = L15.f = L16.f = L17.f = L18.f = 'Z'; 376 377 L7.g = L8.g = L9.g = L10.g = L11.g = L12.g = L13.g = L14.g = L15.g = L16.g = L17.g = L18.g = 'Z'; 378 379 L8.h = L9.h = L10.h = L11.h = L12.h = L13.h = L14.h = L15.h = L16.h = L17.h = L18.h = 'Z'; 380 381 L9.i = L10.i = L11.i = L12.i = L13.i = L14.i = L15.i = L16.i = L17.i = L18.i = 'Z'; 382 383 L10.j = L11.j = L12.j = L13.j = L14.j = L15.j = L16.j = L17.j = L18.j = 'Z'; 384 385 L11.k = L12.k = L13.k = L14.k = L15.k = L16.k = L17.k = L18.k = 'Z'; 386 387 L12.l = L13.l = L14.l = L15.l = L16.l = L17.l = L18.l = 'Z'; 388 389 L13.m = L14.m = L15.m = L16.m = L17.m = L18.m = 'Z'; 390 391 L14.n = L15.n = L16.n = L17.n = L18.n = 'Z'; 392 393 L15.o = L16.o = L17.o = L18.o = 'Z'; 394 395 L16.p = L17.p = L18.p = 'Z'; 396 397 L17.q = L18.q = 'Z'; 398 399 L18.r = 'Z'; 400} 401 402int main() 403{ 404#ifdef usestubs 405 set_debug_traps(); 406 breakpoint(); 407#endif 408 int i; 409 410 Fun1(foo1); 411 Fun2(foo2); 412 Fun3(foo3); 413 Fun4(foo4); 414 Fun5(foo5); 415 Fun6(foo6); 416 Fun7(foo7); 417 Fun8(foo8); 418 Fun9(foo9); 419 Fun10(foo10); 420 Fun11(foo11); 421 Fun12(foo12); 422 Fun13(foo13); 423 Fun14(foo14); 424 Fun15(foo15); 425 Fun16(foo16); 426 Fun17(foo17); 427 Fun18(foo18); 428 429 /* An infinite loop that first clears all the variables and then 430 calls each function. This "hack" is to make testing random 431 functions easier - "advance funN" is guaranteed to have always 432 been preceeded by a global variable clearing zed call. */ 433 434 while (1) 435 { 436 zed (); 437 L1 = fun1(); 438 L2 = fun2(); 439 L3 = fun3(); 440 L4 = fun4(); 441 L5 = fun5(); 442 L6 = fun6(); 443 L7 = fun7(); 444 L8 = fun8(); 445 L9 = fun9(); 446 L10 = fun10(); 447 L11 = fun11(); 448 L12 = fun12(); 449 L13 = fun13(); 450 L14 = fun14(); 451 L15 = fun15(); 452 L16 = fun16(); 453 L17 = fun17(); 454 L18 = fun18(); 455 } 456 457 return 0; 458} 459