# HG changeset patch # User Tassilo Philipp # Date 1643201800 -3600 # Node ID 252f32fa59d857a59daa4e490a0c3028c4d8b22b # Parent b4ddad459690ed437a2f276e118f0fab6820e454 - suite_aggrs: added compile time knob to enforce intentional struct instance misalignment (should maybe be part of generator) diff -r b4ddad459690 -r 252f32fa59d8 test/suite_aggrs/README.txt --- a/test/suite_aggrs/README.txt Wed Jan 26 13:37:19 2022 +0100 +++ b/test/suite_aggrs/README.txt Wed Jan 26 13:56:40 2022 +0100 @@ -1,6 +1,10 @@ suite_aggrs for dyncall written in C and Lua. -Tests aggregates (structs, unions and arrays) passed by value, along with other, non-aggregate args. +Tests aggregates (structs, unions and arrays) passed by value, along with +other, non-aggregate args. + +A macro AGGR_MISALIGN can be used in globals.c to intentionally misalign +aggregate instances. @@@ unions and arrays missing diff -r b4ddad459690 -r 252f32fa59d8 test/suite_aggrs/globals.c --- a/test/suite_aggrs/globals.c Wed Jan 26 13:37:19 2022 +0100 +++ b/test/suite_aggrs/globals.c Wed Jan 26 13:56:40 2022 +0100 @@ -30,8 +30,10 @@ DEF_TYPES #undef X +#define AGGR_MISALIGN 0 + static double rand_d() { return ( ( (double) rand() ) / ( (double) RAND_MAX ) ); } -static void rand_mem(void* p, size_t s) { for(int i=0; i