// S : tags c libc stdio $TAGS // S : expect --result valid // S : cc -o test.bc $CC_OPT $file // S : verify -o nofail:malloc -o nofail:vfs $V_OPT test.bc #include #include int main() { FILE* fp = fopen("file.txt", "w"); assert( fp != NULL ); assert( __fpending(fp) == 0U ); assert( fputc('x', fp) == 'x' ); assert( __fpending(fp) == 1U ); assert( fputc('y', fp) == 'y' ); assert( __fpending(fp) == 2U ); fflush( fp ); assert( __fpending(fp) == 0U ); fclose( fp ); }