]> git.ipfire.org Git - thirdparty/glibc.git/blame - math/test-math-isinff.cc
Add fmaximum, fminimum functions
[thirdparty/glibc.git] / math / test-math-isinff.cc
CommitLineData
3c47c83a 1/* Test for bug 19439.
2b778ceb 2 Copyright (C) 2016-2021 Free Software Foundation, Inc.
3c47c83a 3 This file is part of the GNU C Library.
3c47c83a
CD
4
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.
9
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.
14
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, see
5a82c748 17 <https://www.gnu.org/licenses/>. */
3c47c83a
CD
18
19#define _GNU_SOURCE 1
20#include <math.h>
21#include <stdio.h>
22#include <stdlib.h>
23
24static int
25do_test (void)
26{
27 /* Verify that isinff, isinfl, isnanf, and isnanlf are defined
28 in the header under C++11 and can be called. Without the
29 header fix this test will not compile. */
30 if (isinff (1.0f)
31 || !isinff (INFINITY)
32 || isinfl (1.0L)
33 || !isinfl (INFINITY)
34 || isnanf (2.0f)
35 || !isnanf (NAN)
36 || isnanl (2.0L)
8dfdd079 37 || !isnanl (NAN)
8dfdd079 38 )
3c47c83a
CD
39 {
40 printf ("FAIL: Failed to call is* functions.\n");
41 exit (1);
42 }
43 printf ("PASS: Able to call isinff, isinfl, isnanf, and isnanl.\n");
44 exit (0);
45}
46
47#define TEST_FUNCTION do_test ()
48#include "../test-skeleton.c"