1#include <stdarg.h> 2 3#include "compat-common.h" 4 5#ifdef SKIP_VA 6const int test_va = 0; 7#else 8const int test_va = 1; 9#endif 10 11#include "mixed-struct-defs.h" 12 13extern void checkScd (Scd x, int i); 14extern void checkScdc (Scdc x, int i); 15extern void checkSd (Sd x, int i); 16extern void checkSdi (Sdi x, int i); 17extern void checkScsds (Scsds x, int i); 18extern void checkScsdsc (Scsdsc x, int i); 19extern void checkScsdis (Scsdis x, int i); 20extern void checkScsdisc (Scsdisc x, int i); 21extern void checkSsds (Ssds x, int i); 22extern void checkSsdsc (Ssdsc x, int i); 23extern void checkScssdss (Scssdss x, int i); 24extern void checkScssdssc (Scssdssc x, int i); 25 26#include "mixed-struct-init.h" 27 28#define T(TYPE) \ 29extern TYPE g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE; \ 30extern TYPE g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE; \ 31extern TYPE g9s##TYPE, g10s##TYPE, g11s##TYPE, g12s##TYPE; \ 32extern TYPE g13s##TYPE, g14s##TYPE, g15s##TYPE, g16s##TYPE; \ 33 \ 34void \ 35checkg##TYPE (void) \ 36{ \ 37 check##TYPE ( g1s##TYPE, 1); \ 38 check##TYPE ( g2s##TYPE, 2); \ 39 check##TYPE ( g3s##TYPE, 3); \ 40 check##TYPE ( g4s##TYPE, 4); \ 41 check##TYPE ( g5s##TYPE, 5); \ 42 check##TYPE ( g6s##TYPE, 6); \ 43 check##TYPE ( g7s##TYPE, 7); \ 44 check##TYPE ( g8s##TYPE, 8); \ 45 check##TYPE ( g9s##TYPE, 9); \ 46 check##TYPE ( g10s##TYPE, 10); \ 47 check##TYPE ( g11s##TYPE, 11); \ 48 check##TYPE ( g12s##TYPE, 12); \ 49 check##TYPE ( g13s##TYPE, 13); \ 50 check##TYPE ( g14s##TYPE, 14); \ 51 check##TYPE ( g15s##TYPE, 15); \ 52 check##TYPE ( g16s##TYPE, 16); \ 53} \ 54 \ 55void \ 56test##TYPE (TYPE s1, TYPE s2, TYPE s3, TYPE s4, \ 57 TYPE s5, TYPE s6, TYPE s7, TYPE s8, \ 58 TYPE s9, TYPE s10, TYPE s11, TYPE s12, \ 59 TYPE s13, TYPE s14, TYPE s15, TYPE s16) \ 60{ \ 61 check##TYPE (s1, 1); \ 62 check##TYPE (s2, 2); \ 63 check##TYPE (s3, 3); \ 64 check##TYPE (s4, 4); \ 65 check##TYPE (s5, 5); \ 66 check##TYPE (s6, 6); \ 67 check##TYPE (s7, 7); \ 68 check##TYPE (s8, 8); \ 69 check##TYPE (s9, 9); \ 70 check##TYPE (s10, 10); \ 71 check##TYPE (s11, 11); \ 72 check##TYPE (s12, 12); \ 73 check##TYPE (s13, 13); \ 74 check##TYPE (s14, 14); \ 75 check##TYPE (s15, 15); \ 76 check##TYPE (s16, 16); \ 77} \ 78 \ 79void \ 80testva##TYPE (int n, ...) \ 81{ \ 82 int i; \ 83 va_list ap; \ 84 if (test_va) \ 85 { \ 86 va_start (ap, n); \ 87 for (i = 0; i < n; i++) \ 88 { \ 89 TYPE t = va_arg (ap, TYPE); \ 90 check##TYPE (t, i+1); \ 91 } \ 92 va_end (ap); \ 93 } \ 94} 95 96T(Scd) 97T(Scsds) 98T(Scssdss) 99