build-many-glibcs.py: Add openrisc hard float glibc variant
[glibc.git] / stdio-common / tst-printfsz-islongdouble.c
blob3777dd88a5251e0119ab12f401fd9213cf7ae599
1 /* Test for the behaviour of 'is_long_double' in printf_size.
2 Copyright (C) 2018-2024 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, see
17 <https://www.gnu.org/licenses/>. */
19 #include <printf.h>
20 #include <stdio.h>
21 #include <string.h>
23 #include <support/check.h>
25 static int
26 do_test (void)
28 double d = 2000;
29 double *dptr = &d;
30 long double ld = 4000;
31 long double *ldptr = & ld;
32 struct printf_info info;
34 memset (&info, 0, sizeof (info));
35 info.spec = L'f';
37 /* Print a value with double type. */
38 printf_size (stdout, &info, (void *) &dptr);
40 /* Printf a value with long double type. */
41 info.is_long_double = 1;
42 printf_size (stdout, &info, (void *) &ldptr);
44 /* Setting both 'is_long_double' and 'is_binary128' to one is out of
45 the scope of this test, because such configuration is only valid
46 when _Float128 and long double are ABI-distinct (which is not
47 always true in this arch-independent test). */
48 return 0;
51 #include <support/test-driver.c>