diff options
Diffstat (limited to 'gcc/testsuite/gcc.c-torture/compile/pr59119.c')
-rw-r--r-- | gcc/testsuite/gcc.c-torture/compile/pr59119.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr59119.c b/gcc/testsuite/gcc.c-torture/compile/pr59119.c new file mode 100644 index 00000000000..b026ba5d4ac --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr59119.c @@ -0,0 +1,23 @@ +extern void *memmove (void *, const void *, __SIZE_TYPE__); +extern void *memset (void *, int, __SIZE_TYPE__); + +typedef struct { + long n_prefix; + long n_spadding; +} NumberFieldWidths; + +void +fill_number(char *buf, const NumberFieldWidths *spec) +{ + if (spec->n_prefix) { + memmove(buf, + (char *) 0, + spec->n_prefix * sizeof(char)); + buf += spec->n_prefix; + } + if (spec->n_spadding) { + memset(buf, 0, spec->n_spadding); + buf += spec->n_spadding; + } +} + |