/* test C2X memalignment. type: char, int, long, long long */ #include #ifdef __SDCC #pragma std_c23 #include size_t memalignment(const void *p); // TODO: Rely on stdlib.h instead once the preprocessor can handle the option for C2X. {type} c; #endif void testMemalign(void) { #ifdef __SDCC ASSERT(memalignment(0) == 0); ASSERT(memalignment(&c) > 0); ASSERT(memalignment(&c) >= _Alignof({type})); #endif }