1 /* 2 931004-6.c from the execute part of the gcc torture suite. 3 */ 4 5 #include <testfwk.h> 6 7 #ifdef __SDCC 8 #pragma std_c99 9 #endif 10 11 // Todo: Enable when sdcc supports struct passing! 12 #if 0 13 #include <stdarg.h> 14 15 struct tiny 16 { 17 short c; 18 short d; 19 }; 20 21 f (int n, ...) 22 { 23 struct tiny x; 24 int i; 25 26 va_list ap; 27 va_start (ap,n); 28 for (i = 0; i < n; i++) 29 { 30 x = va_arg (ap,struct tiny); 31 if (x.c != i + 10) 32 ASSERT (0); 33 if (x.d != i + 20) 34 ASSERT (0); 35 } 36 { 37 long x = va_arg (ap, long); 38 if (x != 123) 39 ASSERT (0); 40 } 41 va_end (ap); 42 } 43 #endif 44 45 void testTortureExecute(void)46testTortureExecute (void) 47 { 48 #if 0 49 struct tiny x[3]; 50 x[0].c = 10; 51 x[1].c = 11; 52 x[2].c = 12; 53 x[0].d = 20; 54 x[1].d = 21; 55 x[2].d = 22; 56 f (3, x[0], x[1], x[2], (long) 123); 57 return; 58 #endif 59 } 60 61