From f05dbe69dd53b7d5eabcdb912115a58a46ab676a Mon Sep 17 00:00:00 2001 From: mortimer <> Date: Sun, 31 May 2020 12:27:19 +0000 Subject: Fix printing long doubles on architectures with hm and lm bits. Issue reported with initial patch by enh@google.com. ok deraadt@ --- src/regress/lib/libc/printf/fp.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/regress/lib/libc') diff --git a/src/regress/lib/libc/printf/fp.c b/src/regress/lib/libc/printf/fp.c index 6ed52fdb49..299d05f55d 100644 --- a/src/regress/lib/libc/printf/fp.c +++ b/src/regress/lib/libc/printf/fp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fp.c,v 1.1 2008/09/07 20:36:10 martynas Exp $ */ +/* $OpenBSD: fp.c,v 1.2 2020/05/31 12:27:19 mortimer Exp $ */ /*- * Copyright (c) 2002, 2005 David Schultz * All rights reserved. @@ -185,6 +185,14 @@ main(int argc, char *argv[]) testfmt("0x1p-1074", "%a", 0x1p-1074); testfmt("0x1.2345p-1024", "%a", 0x1.2345p-1024); +#if LDBL_MANT_DIG == 113 + testfmt("-0x1.e7d7c7b7a7978777675747372717p-14344", "%La", + -0x1.e7d7c7b7a7978777675747372717p-14344L); +#elif LDBL_MANT_DIG == 64 + testfmt("-0x8.777675747372717p-16248", "%La", + -0x8.777675747372717p-16248L); +#endif + return (0); } -- cgit v1.2.3-55-g6feb