summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Kaivo <jkk@ung.org>2020-08-15 14:33:56 -0400
committerJakob Kaivo <jkk@ung.org>2020-08-15 14:33:56 -0400
commit21de485738381f5e326b92a14c9c5c96f0462a0c (patch)
treee23953562cf1dc319aedba17d754651f336b886b
parentb3a808e5018bade1674a8078d6beffb55953fcd7 (diff)
only declare variables for testing C99 features when testing C99 features
-rw-r--r--math.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/math.c b/math.c
index b170c4d..1f37355 100644
--- a/math.c
+++ b/math.c
@@ -7,13 +7,6 @@ void test_math_h(void)
int iexp = 1;
double iptr = 0;
- long double ldm1 = -1.0;
- double dm1 = -1.0;
- float fm1 = -1.0;
- long double ld1 = 1.0;
- double d1 = 1.0;
- float f1 = 1.0;
-
testing_header("math.h");
test_double(acos(1), 0);
@@ -41,6 +34,13 @@ void test_math_h(void)
test_double(fmod(1, 1), 0);
#if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
+ long double ldm1 = -1.0;
+ double dm1 = -1.0;
+ float fm1 = -1.0;
+ long double ld1 = 1.0;
+ double d1 = 1.0;
+ float f1 = 1.0;
+
test_int_equals(signbit(ldm1), 1);
test_int_equals(signbit(dm1), 1);
test_int_equals(signbit(fm1), 1);