platform_ldbl96.c revision 1.4
11.4Srillig/*	$NetBSD: platform_ldbl96.c,v 1.4 2023/04/05 20:13:01 rillig Exp $	*/
21.1Srillig# 3 "platform_ldbl96.c"
31.1Srillig
41.1Srillig/*
51.1Srillig * Test features that only apply to platforms that have 96-bit long double.
61.1Srillig */
71.1Srillig
81.4Srillig/* lint1-extra-flags: -c -h -a -p -b -r -z -X 351 */
91.1Srillig/* lint1-only-if: ldbl-96 */
101.1Srillig
111.3Srillig/* CONSTCOND */
121.3Srilligtypedef int bits_per_byte[((unsigned char)-1) == 255 ? 1 : -1];
131.3Srilligtypedef int bytes_per_long_double[sizeof(long double) == 12 ? 1 : -1];
141.4Srillig
151.4Srillig/*
161.4Srillig * Both i386 and m68k use the same floating point format for 'long double',
171.4Srillig * which has 1 bit sign + 15 bit exponent + 64 bit unnormalized mantissa.
181.4Srillig * This means the maximum representable value is 1.1111111(bin) * 2^16383,
191.4Srillig * which is about 1.189e4932.
201.4Srillig */
211.4Srillig/* FIXME: Remove the duplicate warning. */
221.4Srillig/* expect+2: warning: floating-point constant out of range [248] */
231.4Srillig/* expect+1: warning: floating-point constant out of range [248] */
241.4Srilligdouble larger_than_ldbl = 1e4933;
251.4Srillig/* expect+1: warning: floating-point constant out of range [248] */
261.4Srilliglong double larger_than_ldbl_l = 1e4933L;
271.4Srillig/* expect+1: warning: floating-point constant out of range [248] */
281.4Srilligdouble larger_than_dbl = 1e4932;
291.4Srillig/* Fits in 'long double' but not in 'double'. */
301.4Srilliglong double larger_than_dbl_l = 1e4932L;
31