diff mbox

TR29124 C++ Special Maths - Make <math.h> pull functions into global namespace.

Message ID 56A0349C.4090406@verizon.net
State New
Headers show

Commit Message

Ed Smith-Rowland Jan. 21, 2016, 1:30 a.m. UTC
Now that libstdc++ installs a proper math.h we can piggyback on that to 
put in the last bit of TR29124.

This patch adds the math special functions to c_compatibility/math.h in 
the global namespace.
I remove the XFAILs from the compile_2.cc tests.

This converts 21 XFAILs into 21 PASSes.

Tested on x86_64-linux.

I understand if this is too late.
I'll put it up on trunk and backport after stage 1 reopens.

Meanwhile I'll commit this to the tr29124 branch.

Ed
2016-01-20  Edward Smith-Rowland  <3dw4rd@verizon.net>

	TR29124 C++ Special Math - <math.h> pulls funcs into global namespace.
	* include/c_compatibility/math.h: Import the TR29124 functions
	into the global namespace.
	* testsuite/special_functions/01_assoc_laguerre/compile_2.cc: Remove
	xfail and make compile-only.
	* testsuite/special_functions/02_assoc_legendre/compile_2.cc: Ditto.
	* testsuite/special_functions/03_beta/compile_2.cc: Ditto.
	* testsuite/special_functions/04_comp_ellint_1/compile_2.cc: Ditto.
	* testsuite/special_functions/05_comp_ellint_2/compile_2.cc: Ditto.
	* testsuite/special_functions/06_comp_ellint_3/compile_2.cc: Ditto.
	* testsuite/special_functions/07_cyl_bessel_i/compile_2.cc: Ditto.
	* testsuite/special_functions/08_cyl_bessel_j/compile_2.cc: Ditto.
	* testsuite/special_functions/09_cyl_bessel_k/compile_2.cc: Ditto.
	* testsuite/special_functions/10_cyl_neumann/compile_2.cc: Ditto.
	* testsuite/special_functions/11_ellint_1/compile_2.cc: Ditto.
	* testsuite/special_functions/12_ellint_2/compile_2.cc: Ditto.
	* testsuite/special_functions/13_ellint_3/compile_2.cc: Ditto.
	* testsuite/special_functions/14_expint/compile_2.cc: Ditto.
	* testsuite/special_functions/15_hermite/compile_2.cc: Ditto.
	* testsuite/special_functions/16_laguerre/compile_2.cc: Ditto.
	* testsuite/special_functions/17_legendre/compile_2.cc: Ditto.
	* testsuite/special_functions/18_riemann_zeta/compile_2.cc: Ditto.
	* testsuite/special_functions/19_sph_bessel/compile_2.cc: Ditto.
	* testsuite/special_functions/20_sph_legendre/compile_2.cc: Ditto.
	* testsuite/special_functions/21_sph_neumann/compile_2.cc: Ditto.

Comments

Jonathan Wakely Jan. 21, 2016, 12:29 p.m. UTC | #1
On 20/01/16 20:30 -0500, Ed Smith-Rowland wrote:
>Now that libstdc++ installs a proper math.h we can piggyback on that 
>to put in the last bit of TR29124.
>
>This patch adds the math special functions to c_compatibility/math.h 
>in the global namespace.
>I remove the XFAILs from the compile_2.cc tests.
>
>This converts 21 XFAILs into 21 PASSes.
>
>Tested on x86_64-linux.
>
>I understand if this is too late.
>I'll put it up on trunk and backport after stage 1 reopens.
>
>Meanwhile I'll commit this to the tr29124 branch.

I'm inclined to say the change is OK for trunk now. We've added math.h
and we've added the special functions, it would be good if the two new
things work together.

However ...

>Index: include/c_compatibility/math.h
>===================================================================
>--- include/c_compatibility/math.h	(revision 232610)
>+++ include/c_compatibility/math.h	(working copy)
>@@ -75,70 +75,71 @@
> #endif
>
> #if __STDCPP_WANT_MATH_SPEC_FUNCS__ == 1
>-using std::assoc_laguerref

This doesn't look like the right patch, because these lines aren't in
the version on trunk.
Ed Smith-Rowland Jan. 22, 2016, 12:07 a.m. UTC | #2
On 01/21/2016 07:29 AM, Jonathan Wakely wrote:
> On 20/01/16 20:30 -0500, Ed Smith-Rowland wrote:
>> Now that libstdc++ installs a proper math.h we can piggyback on that 
>> to put in the last bit of TR29124.
>>
>> This patch adds the math special functions to c_compatibility/math.h 
>> in the global namespace.
>> I remove the XFAILs from the compile_2.cc tests.
>>
>> This converts 21 XFAILs into 21 PASSes.
>>
>> Tested on x86_64-linux.
>>
>> I understand if this is too late.
>> I'll put it up on trunk and backport after stage 1 reopens.
>>
>> Meanwhile I'll commit this to the tr29124 branch.
>
> I'm inclined to say the change is OK for trunk now. We've added math.h
> and we've added the special functions, it would be good if the two new
> things work together.
>
> However ...
>
>> Index: include/c_compatibility/math.h
>> ===================================================================
>> --- include/c_compatibility/math.h    (revision 232610)
>> +++ include/c_compatibility/math.h    (working copy)
>> @@ -75,70 +75,71 @@
>> #endif
>>
>> #if __STDCPP_WANT_MATH_SPEC_FUNCS__ == 1
>> -using std::assoc_laguerref
>
> This doesn't look like the right patch, because these lines aren't in
> the version on trunk.
>
>
I must have given you a negative patch relative to the tr29124 
branch...  Sigh.
I'll make a new one.
Those lines have to be *added*.
Sorry.
Jonathan Wakely Jan. 22, 2016, 10:39 a.m. UTC | #3
On 21/01/16 19:07 -0500, Ed Smith-Rowland wrote:
>On 01/21/2016 07:29 AM, Jonathan Wakely wrote:
>>On 20/01/16 20:30 -0500, Ed Smith-Rowland wrote:
>>>Now that libstdc++ installs a proper math.h we can piggyback on 
>>>that to put in the last bit of TR29124.
>>>
>>>This patch adds the math special functions to 
>>>c_compatibility/math.h in the global namespace.
>>>I remove the XFAILs from the compile_2.cc tests.
>>>
>>>This converts 21 XFAILs into 21 PASSes.
>>>
>>>Tested on x86_64-linux.
>>>
>>>I understand if this is too late.
>>>I'll put it up on trunk and backport after stage 1 reopens.
>>>
>>>Meanwhile I'll commit this to the tr29124 branch.
>>
>>I'm inclined to say the change is OK for trunk now. We've added math.h
>>and we've added the special functions, it would be good if the two new
>>things work together.
>>
>>However ...
>>
>>>Index: include/c_compatibility/math.h
>>>===================================================================
>>>--- include/c_compatibility/math.h    (revision 232610)
>>>+++ include/c_compatibility/math.h    (working copy)
>>>@@ -75,70 +75,71 @@
>>>#endif
>>>
>>>#if __STDCPP_WANT_MATH_SPEC_FUNCS__ == 1
>>>-using std::assoc_laguerref
>>
>>This doesn't look like the right patch, because these lines aren't in
>>the version on trunk.
>>
>>
>I must have given you a negative patch relative to the tr29124 
>branch...  Sigh.
>I'll make a new one.
>Those lines have to be *added*.
>Sorry.

No problem. It looks like it was a partial patch, adding semi-colons
to the using declarations, so you just need to diff against the
previous revision instead.
diff mbox

Patch

Index: include/c_compatibility/math.h
===================================================================
--- include/c_compatibility/math.h	(revision 232610)
+++ include/c_compatibility/math.h	(working copy)
@@ -75,70 +75,71 @@ 
 #endif
 
 #if __STDCPP_WANT_MATH_SPEC_FUNCS__ == 1
-using std::assoc_laguerref
-using std::assoc_laguerrel
-using std::assoc_laguerre
-using std::assoc_legendref
-using std::assoc_legendrel
-using std::assoc_legendre
-using std::betaf
-using std::betal
-using std::beta
-using std::comp_ellint_1f
-using std::comp_ellint_1l
-using std::comp_ellint_1
-using std::comp_ellint_2f
-using std::comp_ellint_2l
-using std::comp_ellint_2
-using std::comp_ellint_3f
-using std::comp_ellint_3l
-using std::comp_ellint_3
-using std::cyl_bessel_if
-using std::cyl_bessel_il
-using std::cyl_bessel_i
-using std::cyl_bessel_jf
-using std::cyl_bessel_jl
-using std::cyl_bessel_j
-using std::cyl_bessel_kf
-using std::cyl_bessel_kl
-using std::cyl_bessel_k
-using std::cyl_neumannf
-using std::cyl_neumannl
-using std::cyl_neumann
-using std::ellint_1f
-using std::ellint_1l
-using std::ellint_1
-using std::ellint_2f
-using std::ellint_2l
-using std::ellint_2
-using std::ellint_3f
-using std::ellint_3l
-using std::ellint_3
-using std::expintf
-using std::expintl
-using std::expint
-using std::hermitef
-using std::hermitel
-using std::hermite
-using std::laguerref
-using std::laguerrel
-using std::laguerre
-using std::legendref
-using std::legendrel
-using std::legendre
-using std::riemann_zetaf
-using std::riemann_zetal
-using std::riemann_zeta
-using std::sph_besself
-using std::sph_bessell
-using std::sph_bessel
-using std::sph_legendref
-using std::sph_legendrel
-using std::sph_legendre
-using std::sph_neumannf
-using std::sph_neumannl
-using std::sph_neumann
-#endif
-#endif
+using std::assoc_laguerref;
+using std::assoc_laguerrel;
+using std::assoc_laguerre;
+using std::assoc_legendref;
+using std::assoc_legendrel;
+using std::assoc_legendre;
+using std::betaf;
+using std::betal;
+using std::beta;
+using std::comp_ellint_1f;
+using std::comp_ellint_1l;
+using std::comp_ellint_1;
+using std::comp_ellint_2f;
+using std::comp_ellint_2l;
+using std::comp_ellint_2;
+using std::comp_ellint_3f;
+using std::comp_ellint_3l;
+using std::comp_ellint_3;
+using std::cyl_bessel_if;
+using std::cyl_bessel_il;
+using std::cyl_bessel_i;
+using std::cyl_bessel_jf;
+using std::cyl_bessel_jl;
+using std::cyl_bessel_j;
+using std::cyl_bessel_kf;
+using std::cyl_bessel_kl;
+using std::cyl_bessel_k;
+using std::cyl_neumannf;
+using std::cyl_neumannl;
+using std::cyl_neumann;
+using std::ellint_1f;
+using std::ellint_1l;
+using std::ellint_1;
+using std::ellint_2f;
+using std::ellint_2l;
+using std::ellint_2;
+using std::ellint_3f;
+using std::ellint_3l;
+using std::ellint_3;
+using std::expintf;
+using std::expintl;
+using std::expint;
+using std::hermitef;
+using std::hermitel;
+using std::hermite;
+using std::laguerref;
+using std::laguerrel;
+using std::laguerre;
+using std::legendref;
+using std::legendrel;
+using std::legendre;
+using std::riemann_zetaf;
+using std::riemann_zetal;
+using std::riemann_zeta;
+using std::sph_besself;
+using std::sph_bessell;
+using std::sph_bessel;
+using std::sph_legendref;
+using std::sph_legendrel;
+using std::sph_legendre;
+using std::sph_neumannf;
+using std::sph_neumannl;
+using std::sph_neumann;
+#endif // __STDCPP_WANT_MATH_SPEC_FUNCS__
 
-#endif
+#endif // __cplusplus
+
+#endif // _GLIBCXX_MATH_H
Index: testsuite/special_functions/01_assoc_laguerre/compile_2.cc
===================================================================
--- testsuite/special_functions/01_assoc_laguerre/compile_2.cc	(revision 232600)
+++ testsuite/special_functions/01_assoc_laguerre/compile_2.cc	(working copy)
@@ -1,5 +1,4 @@ 
-// { dg-do compile { xfail *-*-* } }
-// { dg-excess-errors "" }
+// { dg-do compile }
 // { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
 
 // Copyright (C) 2016 Free Software Foundation, Inc.
Index: testsuite/special_functions/02_assoc_legendre/compile_2.cc
===================================================================
--- testsuite/special_functions/02_assoc_legendre/compile_2.cc	(revision 232600)
+++ testsuite/special_functions/02_assoc_legendre/compile_2.cc	(working copy)
@@ -1,5 +1,4 @@ 
-// { dg-do compile { xfail *-*-* } }
-// { dg-excess-errors "" }
+// { dg-do compile }
 // { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
 
 // Copyright (C) 2016 Free Software Foundation, Inc.
Index: testsuite/special_functions/03_beta/compile_2.cc
===================================================================
--- testsuite/special_functions/03_beta/compile_2.cc	(revision 232600)
+++ testsuite/special_functions/03_beta/compile_2.cc	(working copy)
@@ -1,5 +1,4 @@ 
-// { dg-do compile { xfail *-*-* } }
-// { dg-excess-errors "" }
+// { dg-do compile }
 // { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
 
 // Copyright (C) 2016 Free Software Foundation, Inc.
Index: testsuite/special_functions/04_comp_ellint_1/compile_2.cc
===================================================================
--- testsuite/special_functions/04_comp_ellint_1/compile_2.cc	(revision 232600)
+++ testsuite/special_functions/04_comp_ellint_1/compile_2.cc	(working copy)
@@ -1,5 +1,4 @@ 
-// { dg-do compile { xfail *-*-* } }
-// { dg-excess-errors "" }
+// { dg-do compile }
 // { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
 
 // Copyright (C) 2016 Free Software Foundation, Inc.
Index: testsuite/special_functions/05_comp_ellint_2/compile_2.cc
===================================================================
--- testsuite/special_functions/05_comp_ellint_2/compile_2.cc	(revision 232600)
+++ testsuite/special_functions/05_comp_ellint_2/compile_2.cc	(working copy)
@@ -1,5 +1,4 @@ 
-// { dg-do compile { xfail *-*-* } }
-// { dg-excess-errors "" }
+// { dg-do compile }
 // { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
 
 // Copyright (C) 2016 Free Software Foundation, Inc.
Index: testsuite/special_functions/06_comp_ellint_3/compile_2.cc
===================================================================
--- testsuite/special_functions/06_comp_ellint_3/compile_2.cc	(revision 232600)
+++ testsuite/special_functions/06_comp_ellint_3/compile_2.cc	(working copy)
@@ -1,5 +1,4 @@ 
-// { dg-do compile { xfail *-*-* } }
-// { dg-excess-errors "" }
+// { dg-do compile }
 // { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
 
 // Copyright (C) 2016 Free Software Foundation, Inc.
Index: testsuite/special_functions/07_cyl_bessel_i/compile_2.cc
===================================================================
--- testsuite/special_functions/07_cyl_bessel_i/compile_2.cc	(revision 232600)
+++ testsuite/special_functions/07_cyl_bessel_i/compile_2.cc	(working copy)
@@ -1,5 +1,4 @@ 
-// { dg-do compile { xfail *-*-* } }
-// { dg-excess-errors "" }
+// { dg-do compile }
 // { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
 
 // Copyright (C) 2016 Free Software Foundation, Inc.
Index: testsuite/special_functions/08_cyl_bessel_j/compile_2.cc
===================================================================
--- testsuite/special_functions/08_cyl_bessel_j/compile_2.cc	(revision 232600)
+++ testsuite/special_functions/08_cyl_bessel_j/compile_2.cc	(working copy)
@@ -1,5 +1,4 @@ 
-// { dg-do compile { xfail *-*-* } }
-// { dg-excess-errors "" }
+// { dg-do compile }
 // { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
 
 // Copyright (C) 2016 Free Software Foundation, Inc.
Index: testsuite/special_functions/09_cyl_bessel_k/compile_2.cc
===================================================================
--- testsuite/special_functions/09_cyl_bessel_k/compile_2.cc	(revision 232600)
+++ testsuite/special_functions/09_cyl_bessel_k/compile_2.cc	(working copy)
@@ -1,5 +1,4 @@ 
-// { dg-do compile { xfail *-*-* } }
-// { dg-excess-errors "" }
+// { dg-do compile }
 // { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
 
 // Copyright (C) 2016 Free Software Foundation, Inc.
Index: testsuite/special_functions/10_cyl_neumann/compile_2.cc
===================================================================
--- testsuite/special_functions/10_cyl_neumann/compile_2.cc	(revision 232600)
+++ testsuite/special_functions/10_cyl_neumann/compile_2.cc	(working copy)
@@ -1,5 +1,4 @@ 
-// { dg-do compile { xfail *-*-* } }
-// { dg-excess-errors "" }
+// { dg-do compile }
 // { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
 
 // Copyright (C) 2016 Free Software Foundation, Inc.
Index: testsuite/special_functions/11_ellint_1/compile_2.cc
===================================================================
--- testsuite/special_functions/11_ellint_1/compile_2.cc	(revision 232600)
+++ testsuite/special_functions/11_ellint_1/compile_2.cc	(working copy)
@@ -1,5 +1,4 @@ 
-// { dg-do compile { xfail *-*-* } }
-// { dg-excess-errors "" }
+// { dg-do compile }
 // { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
 
 // Copyright (C) 2016 Free Software Foundation, Inc.
Index: testsuite/special_functions/12_ellint_2/compile_2.cc
===================================================================
--- testsuite/special_functions/12_ellint_2/compile_2.cc	(revision 232600)
+++ testsuite/special_functions/12_ellint_2/compile_2.cc	(working copy)
@@ -1,5 +1,4 @@ 
-// { dg-do compile { xfail *-*-* } }
-// { dg-excess-errors "" }
+// { dg-do compile }
 // { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
 
 // Copyright (C) 2016 Free Software Foundation, Inc.
Index: testsuite/special_functions/13_ellint_3/compile_2.cc
===================================================================
--- testsuite/special_functions/13_ellint_3/compile_2.cc	(revision 232600)
+++ testsuite/special_functions/13_ellint_3/compile_2.cc	(working copy)
@@ -1,5 +1,4 @@ 
-// { dg-do compile { xfail *-*-* } }
-// { dg-excess-errors "" }
+// { dg-do compile }
 // { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
 
 // Copyright (C) 2016 Free Software Foundation, Inc.
Index: testsuite/special_functions/14_expint/compile_2.cc
===================================================================
--- testsuite/special_functions/14_expint/compile_2.cc	(revision 232600)
+++ testsuite/special_functions/14_expint/compile_2.cc	(working copy)
@@ -1,5 +1,4 @@ 
-// { dg-do compile { xfail *-*-* } }
-// { dg-excess-errors "" }
+// { dg-do compile }
 // { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
 
 // Copyright (C) 2016 Free Software Foundation, Inc.
Index: testsuite/special_functions/15_hermite/compile_2.cc
===================================================================
--- testsuite/special_functions/15_hermite/compile_2.cc	(revision 232600)
+++ testsuite/special_functions/15_hermite/compile_2.cc	(working copy)
@@ -1,5 +1,4 @@ 
-// { dg-do compile { xfail *-*-* } }
-// { dg-excess-errors "" }
+// { dg-do compile }
 // { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
 
 // Copyright (C) 2016 Free Software Foundation, Inc.
Index: testsuite/special_functions/16_laguerre/compile_2.cc
===================================================================
--- testsuite/special_functions/16_laguerre/compile_2.cc	(revision 232600)
+++ testsuite/special_functions/16_laguerre/compile_2.cc	(working copy)
@@ -1,5 +1,4 @@ 
-// { dg-do compile { xfail *-*-* } }
-// { dg-excess-errors "" }
+// { dg-do compile }
 // { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
 
 // Copyright (C) 2016 Free Software Foundation, Inc.
Index: testsuite/special_functions/17_legendre/compile_2.cc
===================================================================
--- testsuite/special_functions/17_legendre/compile_2.cc	(revision 232600)
+++ testsuite/special_functions/17_legendre/compile_2.cc	(working copy)
@@ -1,5 +1,4 @@ 
-// { dg-do compile { xfail *-*-* } }
-// { dg-excess-errors "" }
+// { dg-do compile }
 // { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
 
 // Copyright (C) 2016 Free Software Foundation, Inc.
Index: testsuite/special_functions/18_riemann_zeta/compile_2.cc
===================================================================
--- testsuite/special_functions/18_riemann_zeta/compile_2.cc	(revision 232600)
+++ testsuite/special_functions/18_riemann_zeta/compile_2.cc	(working copy)
@@ -1,5 +1,4 @@ 
-// { dg-do compile { xfail *-*-* } }
-// { dg-excess-errors "" }
+// { dg-do compile }
 // { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
 
 // Copyright (C) 2016 Free Software Foundation, Inc.
Index: testsuite/special_functions/19_sph_bessel/compile_2.cc
===================================================================
--- testsuite/special_functions/19_sph_bessel/compile_2.cc	(revision 232600)
+++ testsuite/special_functions/19_sph_bessel/compile_2.cc	(working copy)
@@ -1,5 +1,4 @@ 
-// { dg-do compile { xfail *-*-* } }
-// { dg-excess-errors "" }
+// { dg-do compile }
 // { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
 
 // Copyright (C) 2016 Free Software Foundation, Inc.
Index: testsuite/special_functions/20_sph_legendre/compile_2.cc
===================================================================
--- testsuite/special_functions/20_sph_legendre/compile_2.cc	(revision 232600)
+++ testsuite/special_functions/20_sph_legendre/compile_2.cc	(working copy)
@@ -1,5 +1,4 @@ 
-// { dg-do compile { xfail *-*-* } }
-// { dg-excess-errors "" }
+// { dg-do compile }
 // { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
 
 // Copyright (C) 2016 Free Software Foundation, Inc.
Index: testsuite/special_functions/21_sph_neumann/compile_2.cc
===================================================================
--- testsuite/special_functions/21_sph_neumann/compile_2.cc	(revision 232600)
+++ testsuite/special_functions/21_sph_neumann/compile_2.cc	(working copy)
@@ -1,5 +1,4 @@ 
-// { dg-do compile { xfail *-*-* } }
-// { dg-excess-errors "" }
+// { dg-do compile }
 // { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
 
 // Copyright (C) 2016 Free Software Foundation, Inc.