aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.c-torture/compile/pr59119.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.c-torture/compile/pr59119.c')
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.c-torture/compile/pr59119.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.c-torture/compile/pr59119.c b/gcc-4.9/gcc/testsuite/gcc.c-torture/compile/pr59119.c
new file mode 100644
index 000000000..b026ba5d4
--- /dev/null
+++ b/gcc-4.9/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;
+ }
+}
+