| 1 |
// Copyright (C) 2019-2025 Free Software Foundation, Inc. |
| 2 |
// |
| 3 |
// This file is part of the GNU ISO C++ Library. This library is free |
| 4 |
// software; you can redistribute it and/or modify it under the |
| 5 |
// terms of the GNU General Public License as published by the |
| 6 |
// Free Software Foundation; either version 3, or (at your option) |
| 7 |
// any later version. |
| 8 |
|
| 9 |
// This library is distributed in the hope that it will be useful, |
| 10 |
// but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 |
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 |
// GNU General Public License for more details. |
| 13 |
|
| 14 |
// You should have received a copy of the GNU General Public License along |
| 15 |
// with this library; see the file COPYING3. If not see |
| 16 |
// <http://www.gnu.org/licenses/>. |
| 17 |
|
| 18 |
// { dg-do compile { target c++17 } } |
| 19 |
|
| 20 |
#undef __STDCPP_WANT_MATH_SPEC_FUNCS__ |
| 21 |
#define __STDCPP_WANT_MATH_SPEC_FUNCS__ 0 |
| 22 |
#include <math.h> |
| 23 |
|
| 24 |
struct R { }; |
| 25 |
|
| 26 |
// When __STDCPP_WANT_MATH_SPEC_FUNCS__ == 0, none of these names should be |
| 27 |
// declared in the global namespace by <math.h>. Calls to them should find |
| 28 |
// the overloads declared in this file, not the ones that are present in |
| 29 |
// namespace std for C++17 and later. |
| 30 |
|
| 31 |
R assoc_laguerre(...); |
| 32 |
R assoc_laguerref(...); |
| 33 |
R assoc_laguerrel(...); |
| 34 |
R assoc_legendre(...); |
| 35 |
R assoc_legendref(...); |
| 36 |
R assoc_legendrel(...); |
| 37 |
R beta(...); |
| 38 |
R betaf(...); |
| 39 |
R betal(...); |
| 40 |
R comp_ellint_1(...); |
| 41 |
R comp_ellint_1f(...); |
| 42 |
R comp_ellint_1l(...); |
| 43 |
R comp_ellint_2(...); |
| 44 |
R comp_ellint_2f(...); |
| 45 |
R comp_ellint_2l(...); |
| 46 |
R comp_ellint_3(...); |
| 47 |
R comp_ellint_3f(...); |
| 48 |
R comp_ellint_3l(...); |
| 49 |
R cyl_bessel_i(...); |
| 50 |
R cyl_bessel_if(...); |
| 51 |
R cyl_bessel_il(...); |
| 52 |
R cyl_bessel_j(...); |
| 53 |
R cyl_bessel_jf(...); |
| 54 |
R cyl_bessel_jl(...); |
| 55 |
R cyl_bessel_k(...); |
| 56 |
R cyl_bessel_kf(...); |
| 57 |
R cyl_bessel_kl(...); |
| 58 |
R cyl_neumann(...); |
| 59 |
R cyl_neumannf(...); |
| 60 |
R cyl_neumannl(...); |
| 61 |
R ellint_1(...); |
| 62 |
R ellint_1f(...); |
| 63 |
R ellint_1l(...); |
| 64 |
R ellint_2(...); |
| 65 |
R ellint_2f(...); |
| 66 |
R ellint_2l(...); |
| 67 |
R ellint_3(...); |
| 68 |
R ellint_3f(...); |
| 69 |
R ellint_3l(...); |
| 70 |
R expint(...); |
| 71 |
R expintf(...); |
| 72 |
R expintl(...); |
| 73 |
R hermite(...); |
| 74 |
R hermitef(...); |
| 75 |
R hermitel(...); |
| 76 |
R laguerre(...); |
| 77 |
R laguerref(...); |
| 78 |
R laguerrel(...); |
| 79 |
R legendre(...); |
| 80 |
R legendref(...); |
| 81 |
R legendrel(...); |
| 82 |
R riemann_zeta(...); |
| 83 |
R riemann_zetaf(...); |
| 84 |
R riemann_zetal(...); |
| 85 |
R sph_bessel(...); |
| 86 |
R sph_besself(...); |
| 87 |
R sph_bessell(...); |
| 88 |
R sph_legendre(...); |
| 89 |
R sph_legendref(...); |
| 90 |
R sph_legendrel(...); |
| 91 |
R sph_neumann(...); |
| 92 |
R sph_neumannf(...); |
| 93 |
R sph_neumannl(...); |
| 94 |
|
| 95 |
void |
| 96 |
test01() |
| 97 |
{ |
| 98 |
R r; |
| 99 |
// Call each function with arguments matching the real special functions |
| 100 |
// in namespace std, to verify that the overloads above are called instead. |
| 101 |
r = assoc_laguerre(1u, 1u, 1.0); |
| 102 |
r = assoc_laguerref(1u, 1u, 1.0f); |
| 103 |
r = assoc_laguerrel(1u, 1u, 1.0l); |
| 104 |
r = assoc_legendre(1u, 1u, 1.0); |
| 105 |
r = assoc_legendref(1u, 1u, 1.0f); |
| 106 |
r = assoc_legendrel(1u, 1u, 1.0l); |
| 107 |
r = beta(1.0, 1.0); |
| 108 |
r = betaf(1.0f, 1.0f); |
| 109 |
r = betal(1.0l, 1.0l); |
| 110 |
r = comp_ellint_1(1.0); |
| 111 |
r = comp_ellint_1f(1.0f); |
| 112 |
r = comp_ellint_1l(1.0l); |
| 113 |
r = comp_ellint_2(1.0); |
| 114 |
r = comp_ellint_2f(1.0f); |
| 115 |
r = comp_ellint_2l(1.0l); |
| 116 |
r = comp_ellint_3(1.0, 1.0); |
| 117 |
r = comp_ellint_3f(1.0f, 1.0f); |
| 118 |
r = comp_ellint_3l(1.0l, 1.0l); |
| 119 |
r = cyl_bessel_i(1.0, 1.0); |
| 120 |
r = cyl_bessel_if(1.0f, 1.0f); |
| 121 |
r = cyl_bessel_il(1.0l, 1.0l); |
| 122 |
r = cyl_bessel_j(1.0, 1.0); |
| 123 |
r = cyl_bessel_jf(1.0f, 1.0f); |
| 124 |
r = cyl_bessel_jl(1.0l, 1.0l); |
| 125 |
r = cyl_bessel_k(1.0, 1.0); |
| 126 |
r = cyl_bessel_kf(1.0f, 1.0f); |
| 127 |
r = cyl_bessel_kl(1.0l, 1.0l); |
| 128 |
r = cyl_neumann(1.0, 1.0); |
| 129 |
r = cyl_neumannf(1.0f, 1.0f); |
| 130 |
r = cyl_neumannl(1.0l, 1.0l); |
| 131 |
r = ellint_1(1.0, 1.0); |
| 132 |
r = ellint_1f(1.0f, 1.0f); |
| 133 |
r = ellint_1l(1.0l, 1.0l); |
| 134 |
r = ellint_2(1.0, 1.0); |
| 135 |
r = ellint_2f(1.0f, 1.0f); |
| 136 |
r = ellint_2l(1.0l, 1.0l); |
| 137 |
r = ellint_3(1.0, 1.0, 1.0); |
| 138 |
r = ellint_3f(1.0f, 1.0f, 1.0f); |
| 139 |
r = ellint_3l(1.0l, 1.0l, 1.0l); |
| 140 |
r = expint(1.0); |
| 141 |
r = expintf(1.0f); |
| 142 |
r = expintl(1.0l); |
| 143 |
r = hermite(1u, 1.0); |
| 144 |
r = hermitef(1u, 1.0f); |
| 145 |
r = hermitel(1u, 1.0l); |
| 146 |
r = laguerre(1u, 1.0); |
| 147 |
r = laguerref(1u, 1.0f); |
| 148 |
r = laguerrel(1u, 1.0l); |
| 149 |
r = legendre(1u, 1.0); |
| 150 |
r = legendref(1u, 1.0f); |
| 151 |
r = legendrel(1u, 1.0l); |
| 152 |
r = riemann_zeta(1.0); |
| 153 |
r = riemann_zetaf(1.0f); |
| 154 |
r = riemann_zetal(1.0l); |
| 155 |
r = sph_bessel(1u, 1.0); |
| 156 |
r = sph_besself(1u, 1.0f); |
| 157 |
r = sph_bessell(1u, 1.0l); |
| 158 |
r = sph_legendre(1u, 1u, 1.0); |
| 159 |
r = sph_legendref(1u, 1u, 1.0f); |
| 160 |
r = sph_legendrel(1u, 1u, 1.0l); |
| 161 |
r = sph_neumann(1u, 1.0); |
| 162 |
r = sph_neumannf(1u, 1.0f); |
| 163 |
r = sph_neumannl(1u, 1.0l); |
| 164 |
} |