svn commit: r271336 - head/tools/regression/lib/msun
Garrett Cooper
ngie at FreeBSD.org
Tue Sep 9 22:14:16 UTC 2014
Author: ngie
Date: Tue Sep 9 22:14:15 2014
New Revision: 271336
URL: http://svnweb.freebsd.org/changeset/base/271336
Log:
Expand the tests structure in test_small(..) to workaround the
"initializer not constant" warning with gcc
Approved by: jmmv (mentor)
MFC after: 3 days
Phabric: D744
Sponsored by: EMC / Isilon Storage Division
Modified:
head/tools/regression/lib/msun/test-invctrig.c
Modified: head/tools/regression/lib/msun/test-invctrig.c
==============================================================================
--- head/tools/regression/lib/msun/test-invctrig.c Tue Sep 9 21:13:47 2014 (r271335)
+++ head/tools/regression/lib/msun/test-invctrig.c Tue Sep 9 22:14:15 2014 (r271336)
@@ -315,25 +315,20 @@ test_small(void)
* asin(z) = Pi/4 + i ln(2)/2
* atan(z) = atan(4)/2 + i ln(17/9)/4
*/
- static const struct {
- complex long double z;
- complex long double acos_z;
- complex long double asin_z;
- complex long double atan_z;
- } tests[] = {
- { CMPLXL(0.75L, 0.25L),
- CMPLXL(pi / 4, -0.34657359027997265470861606072908828L),
- CMPLXL(pi / 4, 0.34657359027997265470861606072908828L),
- CMPLXL(0.66290883183401623252961960521423782L,
- 0.15899719167999917436476103600701878L) },
- };
- int i;
-
- for (i = 0; i < sizeof(tests) / sizeof(tests[0]); i++) {
- testall_tol(cacos, tests[i].z, tests[i].acos_z, 2);
- testall_odd_tol(casin, tests[i].z, tests[i].asin_z, 2);
- testall_odd_tol(catan, tests[i].z, tests[i].atan_z, 2);
- }
+ complex long double z;
+ complex long double acos_z;
+ complex long double asin_z;
+ complex long double atan_z;
+
+ z = CMPLXL(0.75L, 0.25L);
+ acos_z = CMPLXL(pi / 4, -0.34657359027997265470861606072908828L);
+ asin_z = CMPLXL(pi / 4, 0.34657359027997265470861606072908828L);
+ atan_z = CMPLXL(0.66290883183401623252961960521423782L,
+ 0.15899719167999917436476103600701878L);
+
+ testall_tol(cacos, z, acos_z, 2);
+ testall_odd_tol(casin, z, asin_z, 2);
+ testall_odd_tol(catan, z, atan_z, 2);
}
/* Test inputs that might cause overflow in a sloppy implementation. */
More information about the svn-src-all
mailing list