summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorngie <ngie@FreeBSD.org>2014-09-09 22:14:15 +0000
committerngie <ngie@FreeBSD.org>2014-09-09 22:14:15 +0000
commit10e2253fbd09244e446cf78b6aeb9c8f7569634a (patch)
tree6a6b5b6ffa7e8072cf54c9b2f0dd53960d4ef26c /tools
parentcea3546fa658b67a734126228e4f7a6579203b40 (diff)
downloadFreeBSD-src-10e2253fbd09244e446cf78b6aeb9c8f7569634a.zip
FreeBSD-src-10e2253fbd09244e446cf78b6aeb9c8f7569634a.tar.gz
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
Diffstat (limited to 'tools')
-rw-r--r--tools/regression/lib/msun/test-invctrig.c33
1 files changed, 14 insertions, 19 deletions
diff --git a/tools/regression/lib/msun/test-invctrig.c b/tools/regression/lib/msun/test-invctrig.c
index e78c26b..78b1119 100644
--- a/tools/regression/lib/msun/test-invctrig.c
+++ b/tools/regression/lib/msun/test-invctrig.c
@@ -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. */
OpenPOWER on IntegriCloud