1/* Disable this test for 16-bit targets. */ 2 3#include <limits.h> 4 5#if !(defined __GNUC__) || (INT_MAX > 32767) 6 7#include "compat-common.h" 8#include "struct-align-2.h" 9 10#define TEST(NAME) \ 11struct outer_##NAME { \ 12 int i; \ 13 struct epoll_event_##NAME ee; \ 14}; \ 15 \ 16extern unsigned int v1_##NAME; \ 17extern unsigned int v2_##NAME; \ 18extern unsigned long long v3_##NAME; \ 19 \ 20extern struct outer_##NAME s_##NAME[2]; \ 21 \ 22extern void pass_##NAME (struct outer_##NAME); \ 23extern struct outer_##NAME return_##NAME (void); \ 24 \ 25void \ 26checkp_##NAME (struct outer_##NAME *p) \ 27{ \ 28 if (p->i != v1_##NAME) \ 29 DEBUG_CHECK; \ 30 if (p->ee.events != v2_##NAME) \ 31 DEBUG_CHECK; \ 32 if (p->ee.data != v3_##NAME) \ 33 DEBUG_CHECK; \ 34} \ 35 \ 36void \ 37test_##NAME (void) \ 38{ \ 39 struct outer_##NAME s; \ 40 DEBUG_FPUTS (DESC_##NAME); \ 41 DEBUG_NL; \ 42 DEBUG_FPUTS (" global array"); \ 43 checkp_##NAME (&s_##NAME[0]); \ 44 checkp_##NAME (&s_##NAME[1]); \ 45 DEBUG_NL; \ 46 DEBUG_FPUTS (" argument"); \ 47 pass_##NAME (s_##NAME[0]); \ 48 DEBUG_NL; \ 49 DEBUG_FPUTS (" function result"); \ 50 s = return_##NAME (); \ 51 checkp_##NAME (&s); \ 52 DEBUG_NL; \ 53} 54 55TEST (orig) 56#ifndef SKIP_ATTRIBUTE 57TEST (structmax) 58TEST (struct4) 59TEST (struct8) 60TEST (data4) 61TEST (data8) 62TEST (p) 63TEST (pstruct4) 64TEST (pstruct8) 65TEST (pdata4) 66TEST (pdata8) 67#endif 68 69#else 70 71int i; /* prevent compiling an empty file */ 72 73#endif /* INT_MAX */ 74