// S : tags kleetodo libc c // S : expect --result valid // S : cc -o test.bc -D_PDCLIB_BUILD -DTEST $file // S : verify -o nofail:malloc test.bc #include #include "_PDCLIB_test.h" int main( void ) { div_t result; result = div( 5, 2 ); TESTCASE( result.quot == 2 && result.rem == 1 ); result = div( -5, 2 ); TESTCASE( result.quot == -2 && result.rem == -1 ); result = div( 5, -2 ); TESTCASE( result.quot == -2 && result.rem == 1 ); TESTCASE( sizeof( result.quot ) == sizeof( int ) ); TESTCASE( sizeof( result.rem ) == sizeof( int ) ); return TEST_RESULTS; }