Use $(PYTHON) to run benchtests python files.
[glibc.git] / math / test-signgam-main.c
blob7058aa68ff0ea819ba39e8216009d5f80aceba26
1 /* Test lgamma functions do not set signgam for ISO C.
2 Copyright (C) 2015-2016 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 <http://www.gnu.org/licenses/>. */
19 #undef _LIBC
20 #undef _GNU_SOURCE
21 #define _ISOMAC
23 #include <math.h>
24 #include <stdio.h>
26 #define INITVAL ((TYPE) -1 / 3)
28 #if DO_INIT
29 TYPE signgam = INITVAL;
30 #else
31 TYPE signgam;
32 #endif
34 #define RUN_TESTS(FUNC, TYPE) \
35 do \
36 { \
37 volatile TYPE a, b, c __attribute__ ((unused)); \
38 a = 0.5; \
39 b = -0.5; \
40 signgam = INITVAL; \
41 c = FUNC (a); \
42 if (signgam == INITVAL) \
43 puts ("PASS: " #FUNC " (0.5) setting signgam"); \
44 else \
45 { \
46 puts ("FAIL: " #FUNC " (0.5) setting signgam"); \
47 result = 1; \
48 } \
49 signgam = INITVAL; \
50 c = FUNC (b); \
51 if (signgam == INITVAL) \
52 puts ("PASS: " #FUNC " (-0.5) setting signgam"); \
53 else \
54 { \
55 puts ("FAIL: " #FUNC " (-0.5) setting signgam"); \
56 result = 1; \
57 } \
58 } \
59 while (0)
61 int
62 main (void)
64 int result = 0;
65 RUN_TESTS (lgammaf, float);
66 RUN_TESTS (lgamma, double);
67 #ifndef NO_LONG_DOUBLE
68 RUN_TESTS (lgammal, long double);
69 #endif
70 return result;