xref: /netbsd-src/tests/usr.bin/xlint/lint1/platform_ldbl64.c (revision 1603ef6585f2749e804782955756b75415115f1c)
1 /*	$NetBSD: platform_ldbl64.c,v 1.5 2023/07/05 11:42:14 rillig Exp $	*/
2 # 3 "platform_ldbl64.c"
3 
4 /*
5  * Test features that only apply to platforms that have 64-bit long double.
6  */
7 
8 /* lint1-extra-flags: -c -h -a -p -b -r -z -X 351 */
9 /* lint1-only-if: ldbl64 */
10 
11 /* CONSTCOND */
12 typedef int bits_per_byte[((unsigned char)-1) == 255 ? 1 : -1];
13 typedef int bytes_per_long_double[sizeof(long double) == 8 ? 1 : -1];
14 
15 /* expect+1: warning: floating-point constant out of range [248] */
16 double larger_than_ldbl = 1e310;
17 /*
18  * Since 'long double' has the same size as 'double', there is no floating
19  * point constant that fits in 'long double' but not in 'double'.
20  */
21 /* expect+1: warning: floating-point constant out of range [248] */
22 long double larger_than_ldbl_l = 1e310L;
23