Module Name:    src
Committed By:   christos
Date:           Thu May  7 20:40:25 UTC 2009

Modified Files:
        src/regress/lib/libc: Makefile
Added Files:
        src/regress/lib/libc/gdtoa: Makefile gdtoa.c

Log Message:
add regression test for gdtoa large field width.


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/regress/lib/libc/Makefile
cvs rdiff -u -r0 -r1.1 src/regress/lib/libc/gdtoa/Makefile \
    src/regress/lib/libc/gdtoa/gdtoa.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/regress/lib/libc/Makefile
diff -u src/regress/lib/libc/Makefile:1.55 src/regress/lib/libc/Makefile:1.56
--- src/regress/lib/libc/Makefile:1.55	Fri Jan 18 23:12:20 2008
+++ src/regress/lib/libc/Makefile	Thu May  7 16:40:25 2009
@@ -1,7 +1,7 @@
-#	$NetBSD: Makefile,v 1.55 2008/01/19 04:12:20 ginsbach Exp $
+#	$NetBSD: Makefile,v 1.56 2009/05/07 20:40:25 christos Exp $
 
 SUBDIR+= _setjmp atexit basename citrus clone context convfp db dirname \
-	div divrem gen getaddrinfo hsearch inet int_fmtio locale md5sha \
+	div divrem gen gdtoa getaddrinfo hsearch inet int_fmtio locale md5sha \
 	nsdispatch popen pty randomid regex rpc servent setjmp sigsetjmp \
 	stdio stdlib string strptime sys time
 

Added files:

Index: src/regress/lib/libc/gdtoa/Makefile
diff -u /dev/null src/regress/lib/libc/gdtoa/Makefile:1.1
--- /dev/null	Thu May  7 16:40:25 2009
+++ src/regress/lib/libc/gdtoa/Makefile	Thu May  7 16:40:25 2009
@@ -0,0 +1,12 @@
+#	$NetBSD: Makefile,v 1.1 2009/05/07 20:40:25 christos Exp $
+
+NOMAN=	# defined
+
+.include <bsd.own.mk>
+
+PROG=	gdtoa
+
+regress: ${PROG}
+	./${PROG}
+
+.include <bsd.prog.mk>
Index: src/regress/lib/libc/gdtoa/gdtoa.c
diff -u /dev/null src/regress/lib/libc/gdtoa/gdtoa.c:1.1
--- /dev/null	Thu May  7 16:40:25 2009
+++ src/regress/lib/libc/gdtoa/gdtoa.c	Thu May  7 16:40:25 2009
@@ -0,0 +1,49 @@
+/*-
+ * Copyright (c) 2009 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Christos Zoulas.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *        This product includes software developed by the NetBSD
+ *        Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: gdtoa.c,v 1.1 2009/05/07 20:40:25 christos Exp $");
+#include <stdio.h>
+
+/* reported by Maksymilian Arciemowicz */
+
+int
+main(int argc, char *argv[])
+{
+	char *buf;
+	(void)asprintf(&buf, "%1.262159f", 1.1);
+	return 0;
+}
+

Reply via email to