Changeset 5e707bc in rtems


Ignore:
Timestamp:
05/23/12 14:45:01 (11 years ago)
Author:
Ralf Corsépius <ralf.corsepius@…>
Branches:
4.11, 5, master
Children:
61d2fb4d
Parents:
b824fb8
git-author:
Ralf Corsépius <ralf.corsepius@…> (05/23/12 14:45:01)
git-committer:
Joel Sherrill <joel.sherrill@…> (05/31/12 15:06:14)
Message:

Revert "libtests/math*: Avoid generated files"

This reverts commit 6a5bd1c65c005457455db344f2ee831d7a5cf99b.

Location:
testsuites/libtests
Files:
1 added
1 deleted
6 edited

Legend:

Unmodified
Added
Removed
  • testsuites/libtests/math/Makefile.am

    rb824fb8 r5e707bc  
    11rtems_tests_PROGRAMS = math
    22math_SOURCES = init.c domath.c
     3EXTRA_DIST = $(srcdir)/../math/domath.in
     4
     5$(srcdir)/domath.c: $(srcdir)/../math/domath.in
     6        sed -e 's,[@]FTYPE[@],double,' \
     7        -e 's,[@]FSUFFIX[@], ,g' \
     8        -e 's,[@]FGUARD[@],NO_DOUBLE,' \
     9        $(srcdir)/../math/domath.in > $(srcdir)/domath.c
    310
    411dist_rtems_tests_DATA = math.scn
     
    815include $(top_srcdir)/../automake/leaf.am
    916
    10 math_CPPFLAGS = $(AM_CPPFLAGS) -I$(top_srcdir)/math
    1117math_LDADD = -lm
    1218
  • testsuites/libtests/math/domath.c

    rb824fb8 r5e707bc  
    1212
    1313#ifdef HAVE_CONFIG_H
    14   #include "config.h"
    15 #endif
    16 
    17 #ifdef NO_DOUBLE
    18   #define PROVIDE_EMPTY_FUNC
    19 #endif
    20 
    21 #define FTYPE double
    22 #define PRI "%f"
    23 
    24 #include <domath.h>
     14#include "config.h"
     15#endif
     16
     17#include <math.h>
     18#include <stdio.h>
     19
     20#ifndef M_PI_2
     21#define M_PI_2 1.57079632679489661923
     22#endif
     23
     24#ifndef M_PI_4
     25#define M_PI_4 0.78539816339744830962
     26#endif
     27
     28extern void domath  (void);
     29
     30void
     31domath  (void)
     32{
     33#ifndef NO_DOUBLE
     34  double f1;
     35  double f2;
     36
     37  int i1;
     38
     39  f1 = acos (0.0);
     40  fprintf( stdout, "acos           : %f\n", f1);
     41
     42  f1 = acosh (0.0);
     43  fprintf( stdout, "acosh          : %f\n", f1);
     44
     45  f1 = asin (1.0);
     46  fprintf( stdout, "asin           : %f\n", f1);
     47
     48  f1 = asinh (1.0);
     49  fprintf( stdout, "asinh          : %f\n", f1);
     50
     51  f1 = atan (M_PI_4);
     52  fprintf( stdout, "atan           : %f\n", f1);
     53
     54  f1 = atan2 (2.3, 2.3);
     55  fprintf( stdout, "atan2          : %f\n", f1);
     56
     57  f1 = atanh (1.0);
     58  fprintf( stdout, "atanh          : %f\n", f1);
     59
     60  f1 = cbrt (27.0);
     61  fprintf( stdout, "cbrt           : %f\n", f1);
     62
     63  f1 = ceil (3.5);
     64  fprintf( stdout, "ceil           : %f\n", f1);
     65
     66  f1 = copysign (3.5, -2.5);
     67  fprintf( stdout, "copysign       : %f\n", f1);
     68
     69  f1 = cos (M_PI_2);
     70  fprintf( stdout, "cos            : %f\n", f1);
     71
     72  f1 = cosh (M_PI_2);
     73  fprintf( stdout, "cosh           : %f\n", f1);
     74
     75  f1 = erf (42.0);
     76  fprintf( stdout, "erf            : %f\n", f1);
     77
     78  f1 = erfc (42.0);
     79  fprintf( stdout, "erfc           : %f\n", f1);
     80
     81  f1 = exp (0.42);
     82  fprintf( stdout, "exp            : %f\n", f1);
     83
     84  f1 = exp2 (0.42);
     85  fprintf( stdout, "exp2           : %f\n", f1);
     86
     87  f1 = expm1 (0.00042);
     88  fprintf( stdout, "expm1          : %f\n", f1);
     89
     90  f1 = fabs (-1.123);
     91  fprintf( stdout, "fabs           : %f\n", f1);
     92
     93  f1 = fdim (1.123, 2.123);
     94  fprintf( stdout, "fdim           : %f\n", f1);
     95
     96  f1 = floor (0.5);
     97  fprintf( stdout, "floor          : %f\n", f1);
     98  f1 = floor (-0.5);
     99  fprintf( stdout, "floor          : %f\n", f1);
     100
     101  f1 = fma (2.1, 2.2, 3.01);
     102  fprintf( stdout, "fma            : %f\n", f1);
     103
     104  f1 = fmax (-0.42, 0.42);
     105  fprintf( stdout, "fmax           : %f\n", f1);
     106
     107  f1 = fmin (-0.42, 0.42);
     108  fprintf( stdout, "fmin           : %f\n", f1);
     109
     110  f1 = fmod (42.0, 3.0);
     111  fprintf( stdout, "fmod           : %f\n", f1);
     112
     113  /* no type-specific variant */
     114  i1 = fpclassify(1.0);
     115  fprintf( stdout, "fpclassify     : %d\n", i1);
     116
     117  f1 = frexp (42.0, &i1);
     118  fprintf( stdout, "frexp          : %f\n", f1);
     119
     120  f1 = hypot (42.0, 42.0);
     121  fprintf( stdout, "hypot          : %f\n", f1);
     122
     123  i1 = ilogb (42.0);
     124  fprintf( stdout, "ilogb          : %d\n", i1);
     125
     126  /* no type-specific variant */
     127  i1 = isfinite(3.0);
     128  fprintf( stdout, "isfinite       : %d\n", i1);
     129
     130  /* no type-specific variant */
     131  i1 = isgreater(3.0, 3.1);
     132  fprintf( stdout, "isgreater      : %d\n", i1);
     133
     134  /* no type-specific variant */
     135  i1 = isgreaterequal(3.0, 3.1);
     136  fprintf( stdout, "isgreaterequal : %d\n", i1);
     137
     138  /* no type-specific variant */
     139  i1 = isinf(3.0);
     140  fprintf( stdout, "isinf          : %d\n", i1);
     141
     142  /* no type-specific variant */
     143  i1 = isless(3.0, 3.1);
     144  fprintf( stdout, "isless         : %d\n", i1);
     145
     146  /* no type-specific variant */
     147  i1 = islessequal(3.0, 3.1);
     148  fprintf( stdout, "islessequal    : %d\n", i1);
     149
     150  /* no type-specific variant */
     151  i1 = islessgreater(3.0, 3.1);
     152  fprintf( stdout, "islessgreater  : %d\n", i1);
     153
     154  /* no type-specific variant */
     155  i1 = isnan(0.0);
     156  fprintf( stdout, "isnan          : %d\n", i1);
     157
     158  /* no type-specific variant */
     159  i1 = isnormal(3.0);
     160  fprintf( stdout, "isnormal       : %d\n", i1);
     161
     162  /* no type-specific variant */
     163  f1 = isunordered(1.0, 2.0);
     164  fprintf( stdout, "isunordered    : %d\n", i1);
     165
     166  f1 = j0 (1.2);
     167  fprintf( stdout, "j0             : %f\n", f1);
     168
     169  f1 = j1 (1.2);
     170  fprintf( stdout, "j1             : %f\n", f1);
     171
     172  f1 = jn (2,1.2);
     173  fprintf( stdout, "jn             : %f\n", f1);
     174
     175  f1 = ldexp (1.2,3);
     176  fprintf( stdout, "ldexp          : %f\n", f1);
     177
     178  f1 = lgamma (42.0);
     179  fprintf( stdout, "lgamma         : %f\n", f1);
     180
     181  f1 = llrint (-0.5);
     182  fprintf( stdout, "llrint         : %f\n", f1);
     183  f1 = llrint (0.5);
     184  fprintf( stdout, "llrint         : %f\n", f1);
     185
     186  f1 = llround (-0.5);
     187  fprintf( stdout, "lround         : %f\n", f1);
     188  f1 = llround (0.5);
     189  fprintf( stdout, "lround         : %f\n", f1);
     190
     191  f1 = log (42.0);
     192  fprintf( stdout, "log            : %f\n", f1);
     193
     194  f1 = log10 (42.0);
     195  fprintf( stdout, "log10          : %f\n", f1);
     196
     197  f1 = log1p (42.0);
     198  fprintf( stdout, "log1p          : %f\n", f1);
     199
     200  f1 = log2 (42.0);
     201  fprintf( stdout, "log2           : %f\n", f1);
     202
     203  f1 = logb (42.0);
     204  fprintf( stdout, "logb           : %f\n", f1);
     205
     206  f1 = lrint (-0.5);
     207  fprintf( stdout, "lrint          : %f\n", f1);
     208  f1 = lrint (0.5);
     209  fprintf( stdout, "lrint          : %f\n", f1);
     210
     211  f1 = lround (-0.5);
     212  fprintf( stdout, "lround         : %f\n", f1);
     213  f1 = lround (0.5);
     214  fprintf( stdout, "lround         : %f\n", f1);
     215
     216  f1 = modf (42.0,&f2);
     217  fprintf( stdout, "lmodf          : %f\n", f1);
     218
     219  f1 = nan ("");
     220  fprintf( stdout, "nan            : %f\n", f1);
     221
     222  f1 = nearbyint (1.5);
     223  fprintf( stdout, "nearbyint      : %f\n", f1);
     224
     225  f1 = nextafter (1.5,2.0);
     226  fprintf( stdout, "nextafter      : %f\n", f1);
     227
     228  f1 = pow (3.01, 2.0);
     229  fprintf( stdout, "pow            : %f\n", f1);
     230
     231  f1 = remainder (3.01,2.0);
     232  fprintf( stdout, "remainder      : %f\n", f1);
     233
     234  f1 = remquo (29.0,3.0,&i1);
     235  fprintf( stdout, "remquo         : %f\n", f1);
     236
     237  f1 = rint (0.5);
     238  fprintf( stdout, "rint           : %f\n", f1);
     239  f1 = rint (-0.5);
     240  fprintf( stdout, "rint           : %f\n", f1);
     241
     242  f1 = round (0.5);
     243  fprintf( stdout, "round          : %f\n", f1);
     244  f1 = round (-0.5);
     245  fprintf( stdout, "round          : %f\n", f1);
     246
     247  f1 = scalbln (1.2,3);
     248  fprintf( stdout, "scalbln        : %f\n", f1);
     249
     250  f1 = scalbn (1.2,3);
     251  fprintf( stdout, "scalbn         : %f\n", f1);
     252
     253  /* no type-specific variant */
     254  i1 = signbit(1.0);
     255  fprintf( stdout, "signbit        : %i\n", i1);
     256
     257  f1 = sin (M_PI_4);
     258  fprintf( stdout, "sin            : %f\n", f1);
     259
     260  f1 = sinh (M_PI_4);
     261  fprintf( stdout, "sinh           : %f\n", f1);
     262
     263  f1 = sqrt (9.0);
     264  fprintf( stdout, "sqrt           : %f\n", f1);
     265
     266  f1 = tan (M_PI_4);
     267  fprintf( stdout, "tan            : %f\n", f1);
     268
     269  f1 = tanh (M_PI_4);
     270  fprintf( stdout, "tanh           : %f\n", f1);
     271
     272  f1 = tgamma (2.1);
     273  fprintf( stdout, "tgamma         : %f\n", f1);
     274
     275  f1 = trunc (3.5);
     276  fprintf( stdout, "trunc          : %f\n", f1);
     277
     278  f1 = y0 (1.2);
     279  fprintf( stdout, "y0             : %f\n", f1);
     280
     281  f1 = y1 (1.2);
     282  fprintf( stdout, "y1             : %f\n", f1);
     283
     284  f1 = yn (3,1.2);
     285  fprintf( stdout, "yn             : %f\n", f1);
     286#endif
     287}
  • testsuites/libtests/mathf/Makefile.am

    rb824fb8 r5e707bc  
    11rtems_tests_PROGRAMS = mathf
    22mathf_SOURCES = init.c domathf.c
     3EXTRA_DIST = $(srcdir)/../math/domath.in
     4
     5$(srcdir)/domathf.c: $(srcdir)/../math/domath.in
     6        sed -e 's,[@]FTYPE[@],float,' \
     7        -e 's,[@]FSUFFIX[@],f,g' \
     8        -e 's,[@]FGUARD[@],NO_FLOAT,' \
     9        $(srcdir)/../math/domath.in > $(srcdir)/domathf.c
    310
    411dist_rtems_tests_DATA = mathf.scn
     
    815include $(top_srcdir)/../automake/leaf.am
    916
    10 mathf_CPPFLAGS = $(AM_CPPFLAGS) -I$(top_srcdir)/math
    1117mathf_LDADD = -lm
    1218
  • testsuites/libtests/mathf/domathf.c

    rb824fb8 r5e707bc  
    1212
    1313#ifdef HAVE_CONFIG_H
    14   #include "config.h"
    15 #endif
    16 
    17 #ifdef NO_FLOAT
    18   #define PROVIDE_EMPTY_FUNC
    19 #endif
    20 
    21 #define SUFFIX f
    22 #define FTYPE float
    23 #define PRI "%f"
    24 
    25 #include <domath.h>
     14#include "config.h"
     15#endif
     16
     17#include <math.h>
     18#include <stdio.h>
     19
     20#ifndef M_PI_2
     21#define M_PI_2 1.57079632679489661923
     22#endif
     23
     24#ifndef M_PI_4
     25#define M_PI_4 0.78539816339744830962
     26#endif
     27
     28extern void domathf (void);
     29
     30void
     31domathf (void)
     32{
     33#ifndef NO_FLOAT
     34  float f1;
     35  float f2;
     36
     37  int i1;
     38
     39  f1 = acosf(0.0);
     40  fprintf( stdout, "acosf          : %f\n", f1);
     41
     42  f1 = acoshf(0.0);
     43  fprintf( stdout, "acoshf         : %f\n", f1);
     44
     45  f1 = asinf(1.0);
     46  fprintf( stdout, "asinf          : %f\n", f1);
     47
     48  f1 = asinhf(1.0);
     49  fprintf( stdout, "asinhf         : %f\n", f1);
     50
     51  f1 = atanf(M_PI_4);
     52  fprintf( stdout, "atanf          : %f\n", f1);
     53
     54  f1 = atan2f(2.3, 2.3);
     55  fprintf( stdout, "atan2f         : %f\n", f1);
     56
     57  f1 = atanhf(1.0);
     58  fprintf( stdout, "atanhf         : %f\n", f1);
     59
     60  f1 = cbrtf(27.0);
     61  fprintf( stdout, "cbrtf          : %f\n", f1);
     62
     63  f1 = ceilf(3.5);
     64  fprintf( stdout, "ceilf          : %f\n", f1);
     65
     66  f1 = copysignf(3.5, -2.5);
     67  fprintf( stdout, "copysignf      : %f\n", f1);
     68
     69  f1 = cosf(M_PI_2);
     70  fprintf( stdout, "cosf           : %f\n", f1);
     71
     72  f1 = coshf(M_PI_2);
     73  fprintf( stdout, "coshf          : %f\n", f1);
     74
     75  f1 = erff(42.0);
     76  fprintf( stdout, "erff           : %f\n", f1);
     77
     78  f1 = erfcf(42.0);
     79  fprintf( stdout, "erfcf          : %f\n", f1);
     80
     81  f1 = expf(0.42);
     82  fprintf( stdout, "expf           : %f\n", f1);
     83
     84  f1 = exp2f(0.42);
     85  fprintf( stdout, "exp2f          : %f\n", f1);
     86
     87  f1 = expm1f(0.00042);
     88  fprintf( stdout, "expm1f         : %f\n", f1);
     89
     90  f1 = fabsf(-1.123);
     91  fprintf( stdout, "fabsf          : %f\n", f1);
     92
     93  f1 = fdimf(1.123, 2.123);
     94  fprintf( stdout, "fdimf          : %f\n", f1);
     95
     96  f1 = floorf(0.5);
     97  fprintf( stdout, "floorf         : %f\n", f1);
     98  f1 = floorf(-0.5);
     99  fprintf( stdout, "floorf         : %f\n", f1);
     100
     101  f1 = fmaf(2.1, 2.2, 3.01);
     102  fprintf( stdout, "fmaf           : %f\n", f1);
     103
     104  f1 = fmaxf(-0.42, 0.42);
     105  fprintf( stdout, "fmaxf          : %f\n", f1);
     106
     107  f1 = fminf(-0.42, 0.42);
     108  fprintf( stdout, "fminf          : %f\n", f1);
     109
     110  f1 = fmodf(42.0, 3.0);
     111  fprintf( stdout, "fmodf          : %f\n", f1);
     112
     113  /* no type-specific variant */
     114  i1 = fpclassify(1.0);
     115  fprintf( stdout, "fpclassify     : %d\n", i1);
     116
     117  f1 = frexpf(42.0, &i1);
     118  fprintf( stdout, "frexpf         : %f\n", f1);
     119
     120  f1 = hypotf(42.0, 42.0);
     121  fprintf( stdout, "hypotf         : %f\n", f1);
     122
     123  i1 = ilogbf(42.0);
     124  fprintf( stdout, "ilogbf         : %d\n", i1);
     125
     126  /* no type-specific variant */
     127  i1 = isfinite(3.0);
     128  fprintf( stdout, "isfinite       : %d\n", i1);
     129
     130  /* no type-specific variant */
     131  i1 = isgreater(3.0, 3.1);
     132  fprintf( stdout, "isgreater      : %d\n", i1);
     133
     134  /* no type-specific variant */
     135  i1 = isgreaterequal(3.0, 3.1);
     136  fprintf( stdout, "isgreaterequal : %d\n", i1);
     137
     138  /* no type-specific variant */
     139  i1 = isinf(3.0);
     140  fprintf( stdout, "isinf          : %d\n", i1);
     141
     142  /* no type-specific variant */
     143  i1 = isless(3.0, 3.1);
     144  fprintf( stdout, "isless         : %d\n", i1);
     145
     146  /* no type-specific variant */
     147  i1 = islessequal(3.0, 3.1);
     148  fprintf( stdout, "islessequal    : %d\n", i1);
     149
     150  /* no type-specific variant */
     151  i1 = islessgreater(3.0, 3.1);
     152  fprintf( stdout, "islessgreater  : %d\n", i1);
     153
     154  /* no type-specific variant */
     155  i1 = isnan(0.0);
     156  fprintf( stdout, "isnan          : %d\n", i1);
     157
     158  /* no type-specific variant */
     159  i1 = isnormal(3.0);
     160  fprintf( stdout, "isnormal       : %d\n", i1);
     161
     162  /* no type-specific variant */
     163  f1 = isunordered(1.0, 2.0);
     164  fprintf( stdout, "isunordered    : %d\n", i1);
     165
     166  f1 = j0f(1.2);
     167  fprintf( stdout, "j0f            : %f\n", f1);
     168
     169  f1 = j1f(1.2);
     170  fprintf( stdout, "j1f            : %f\n", f1);
     171
     172  f1 = jnf(2,1.2);
     173  fprintf( stdout, "jnf            : %f\n", f1);
     174
     175  f1 = ldexpf(1.2,3);
     176  fprintf( stdout, "ldexpf         : %f\n", f1);
     177
     178  f1 = lgammaf(42.0);
     179  fprintf( stdout, "lgammaf        : %f\n", f1);
     180
     181  f1 = llrintf(-0.5);
     182  fprintf( stdout, "llrintf        : %f\n", f1);
     183  f1 = llrintf(0.5);
     184  fprintf( stdout, "llrintf        : %f\n", f1);
     185
     186  f1 = llroundf(-0.5);
     187  fprintf( stdout, "lroundf        : %f\n", f1);
     188  f1 = llroundf(0.5);
     189  fprintf( stdout, "lroundf        : %f\n", f1);
     190
     191  f1 = logf(42.0);
     192  fprintf( stdout, "logf           : %f\n", f1);
     193
     194  f1 = log10f(42.0);
     195  fprintf( stdout, "log10f         : %f\n", f1);
     196
     197  f1 = log1pf(42.0);
     198  fprintf( stdout, "log1pf         : %f\n", f1);
     199
     200  f1 = log2f(42.0);
     201  fprintf( stdout, "log2f          : %f\n", f1);
     202
     203  f1 = logbf(42.0);
     204  fprintf( stdout, "logbf          : %f\n", f1);
     205
     206  f1 = lrintf(-0.5);
     207  fprintf( stdout, "lrintf         : %f\n", f1);
     208  f1 = lrintf(0.5);
     209  fprintf( stdout, "lrintf         : %f\n", f1);
     210
     211  f1 = lroundf(-0.5);
     212  fprintf( stdout, "lroundf        : %f\n", f1);
     213  f1 = lroundf(0.5);
     214  fprintf( stdout, "lroundf        : %f\n", f1);
     215
     216  f1 = modff(42.0,&f2);
     217  fprintf( stdout, "lmodff         : %f\n", f1);
     218
     219  f1 = nanf("");
     220  fprintf( stdout, "nanf           : %f\n", f1);
     221
     222  f1 = nearbyintf(1.5);
     223  fprintf( stdout, "nearbyintf     : %f\n", f1);
     224
     225  f1 = nextafterf(1.5,2.0);
     226  fprintf( stdout, "nextafterf     : %f\n", f1);
     227
     228  f1 = powf(3.01, 2.0);
     229  fprintf( stdout, "powf           : %f\n", f1);
     230
     231  f1 = remainderf(3.01,2.0);
     232  fprintf( stdout, "remainderf     : %f\n", f1);
     233
     234  f1 = remquof(29.0,3.0,&i1);
     235  fprintf( stdout, "remquof        : %f\n", f1);
     236
     237  f1 = rintf(0.5);
     238  fprintf( stdout, "rintf          : %f\n", f1);
     239  f1 = rintf(-0.5);
     240  fprintf( stdout, "rintf          : %f\n", f1);
     241
     242  f1 = roundf(0.5);
     243  fprintf( stdout, "roundf         : %f\n", f1);
     244  f1 = roundf(-0.5);
     245  fprintf( stdout, "roundf         : %f\n", f1);
     246
     247  f1 = scalblnf(1.2,3);
     248  fprintf( stdout, "scalblnf       : %f\n", f1);
     249
     250  f1 = scalbnf(1.2,3);
     251  fprintf( stdout, "scalbnf        : %f\n", f1);
     252
     253  /* no type-specific variant */
     254  i1 = signbit(1.0);
     255  fprintf( stdout, "signbit        : %i\n", i1);
     256
     257  f1 = sinf(M_PI_4);
     258  fprintf( stdout, "sinf           : %f\n", f1);
     259
     260  f1 = sinhf(M_PI_4);
     261  fprintf( stdout, "sinhf          : %f\n", f1);
     262
     263  f1 = sqrtf(9.0);
     264  fprintf( stdout, "sqrtf          : %f\n", f1);
     265
     266  f1 = tanf(M_PI_4);
     267  fprintf( stdout, "tanf           : %f\n", f1);
     268
     269  f1 = tanhf(M_PI_4);
     270  fprintf( stdout, "tanhf          : %f\n", f1);
     271
     272  f1 = tgammaf(2.1);
     273  fprintf( stdout, "tgammaf        : %f\n", f1);
     274
     275  f1 = truncf(3.5);
     276  fprintf( stdout, "truncf         : %f\n", f1);
     277
     278  f1 = y0f(1.2);
     279  fprintf( stdout, "y0f            : %f\n", f1);
     280
     281  f1 = y1f(1.2);
     282  fprintf( stdout, "y1f            : %f\n", f1);
     283
     284  f1 = ynf(3,1.2);
     285  fprintf( stdout, "ynf            : %f\n", f1);
     286#endif
     287}
  • testsuites/libtests/mathl/Makefile.am

    rb824fb8 r5e707bc  
    55# FIXME: Skip long double, not yet supported in newlib
    66# => This test currently is a nop
    7 mathl_CPPFLAGS = $(AM_CPPFLAGS) -I$(top_srcdir)/math -DNO_LONG_DOUBLE
     7mathl_CPPFLAGS = $(AM_CPPFLAGS) -DNO_LONG_DOUBLE
     8
     9$(srcdir)/domathl.c: $(srcdir)/../math/domath.in
     10        sed -e 's,[@]FTYPE[@],long double,' \
     11        -e 's,[@]FSUFFIX[@],l,g' \
     12        -e 's,%f,%Lf,g' \
     13        -e 's,[@]FGUARD[@],NO_LONG_DOUBLE,' \
     14        $(srcdir)/../math/domath.in > $(srcdir)/domathl.c
    815
    916dist_rtems_tests_DATA = mathl.scn
  • testsuites/libtests/mathl/domathl.c

    rb824fb8 r5e707bc  
    1212
    1313#ifdef HAVE_CONFIG_H
    14   #include "config.h"
    15 #endif
    16 
    17 #ifdef NO_LONG_DOUBLE
    18   #define PROVIDE_EMPTY_FUNC
    19 #endif
    20 
    21 #define SUFFIX l
    22 #define FTYPE long double
    23 #define PRI "%Lf"
    24 
    25 #include <domath.h>
     14#include "config.h"
     15#endif
     16
     17#include <math.h>
     18#include <stdio.h>
     19
     20#ifndef M_PI_2
     21#define M_PI_2 1.57079632679489661923
     22#endif
     23
     24#ifndef M_PI_4
     25#define M_PI_4 0.78539816339744830962
     26#endif
     27
     28extern void domathl (void);
     29
     30void
     31domathl (void)
     32{
     33#ifndef NO_LONG_DOUBLE
     34  long double f1;
     35  long double f2;
     36
     37  int i1;
     38
     39  f1 = acosl(0.0);
     40  fprintf( stdout, "acosl          : %Lf\n", f1);
     41
     42  f1 = acoshl(0.0);
     43  fprintf( stdout, "acoshl         : %Lf\n", f1);
     44
     45  f1 = asinl(1.0);
     46  fprintf( stdout, "asinl          : %Lf\n", f1);
     47
     48  f1 = asinhl(1.0);
     49  fprintf( stdout, "asinhl         : %Lf\n", f1);
     50
     51  f1 = atanl(M_PI_4);
     52  fprintf( stdout, "atanl          : %Lf\n", f1);
     53
     54  f1 = atan2l(2.3, 2.3);
     55  fprintf( stdout, "atan2l         : %Lf\n", f1);
     56
     57  f1 = atanhl(1.0);
     58  fprintf( stdout, "atanhl         : %Lf\n", f1);
     59
     60  f1 = cbrtl(27.0);
     61  fprintf( stdout, "cbrtl          : %Lf\n", f1);
     62
     63  f1 = ceill(3.5);
     64  fprintf( stdout, "ceill          : %Lf\n", f1);
     65
     66  f1 = copysignl(3.5, -2.5);
     67  fprintf( stdout, "copysignl      : %Lf\n", f1);
     68
     69  f1 = cosl(M_PI_2);
     70  fprintf( stdout, "cosl           : %Lf\n", f1);
     71
     72  f1 = coshl(M_PI_2);
     73  fprintf( stdout, "coshl          : %Lf\n", f1);
     74
     75  f1 = erfl(42.0);
     76  fprintf( stdout, "erfl           : %Lf\n", f1);
     77
     78  f1 = erfcl(42.0);
     79  fprintf( stdout, "erfcl          : %Lf\n", f1);
     80
     81  f1 = expl(0.42);
     82  fprintf( stdout, "expl           : %Lf\n", f1);
     83
     84  f1 = exp2l(0.42);
     85  fprintf( stdout, "exp2l          : %Lf\n", f1);
     86
     87  f1 = expm1l(0.00042);
     88  fprintf( stdout, "expm1l         : %Lf\n", f1);
     89
     90  f1 = fabsl(-1.123);
     91  fprintf( stdout, "fabsl          : %Lf\n", f1);
     92
     93  f1 = fdiml(1.123, 2.123);
     94  fprintf( stdout, "fdiml          : %Lf\n", f1);
     95
     96  f1 = floorl(0.5);
     97  fprintf( stdout, "floorl         : %Lf\n", f1);
     98  f1 = floorl(-0.5);
     99  fprintf( stdout, "floorl         : %Lf\n", f1);
     100
     101  f1 = fmal(2.1, 2.2, 3.01);
     102  fprintf( stdout, "fmal           : %Lf\n", f1);
     103
     104  f1 = fmaxl(-0.42, 0.42);
     105  fprintf( stdout, "fmaxl          : %Lf\n", f1);
     106
     107  f1 = fminl(-0.42, 0.42);
     108  fprintf( stdout, "fminl          : %Lf\n", f1);
     109
     110  f1 = fmodl(42.0, 3.0);
     111  fprintf( stdout, "fmodl          : %Lf\n", f1);
     112
     113  /* no type-specific variant */
     114  i1 = fpclassify(1.0);
     115  fprintf( stdout, "fpclassify     : %d\n", i1);
     116
     117  f1 = frexpl(42.0, &i1);
     118  fprintf( stdout, "frexpl         : %Lf\n", f1);
     119
     120  f1 = hypotl(42.0, 42.0);
     121  fprintf( stdout, "hypotl         : %Lf\n", f1);
     122
     123  i1 = ilogbl(42.0);
     124  fprintf( stdout, "ilogbl         : %d\n", i1);
     125
     126  /* no type-specific variant */
     127  i1 = isfinite(3.0);
     128  fprintf( stdout, "isfinite       : %d\n", i1);
     129
     130  /* no type-specific variant */
     131  i1 = isgreater(3.0, 3.1);
     132  fprintf( stdout, "isgreater      : %d\n", i1);
     133
     134  /* no type-specific variant */
     135  i1 = isgreaterequal(3.0, 3.1);
     136  fprintf( stdout, "isgreaterequal : %d\n", i1);
     137
     138  /* no type-specific variant */
     139  i1 = isinf(3.0);
     140  fprintf( stdout, "isinf          : %d\n", i1);
     141
     142  /* no type-specific variant */
     143  i1 = isless(3.0, 3.1);
     144  fprintf( stdout, "isless         : %d\n", i1);
     145
     146  /* no type-specific variant */
     147  i1 = islessequal(3.0, 3.1);
     148  fprintf( stdout, "islessequal    : %d\n", i1);
     149
     150  /* no type-specific variant */
     151  i1 = islessgreater(3.0, 3.1);
     152  fprintf( stdout, "islessgreater  : %d\n", i1);
     153
     154  /* no type-specific variant */
     155  i1 = isnan(0.0);
     156  fprintf( stdout, "isnan          : %d\n", i1);
     157
     158  /* no type-specific variant */
     159  i1 = isnormal(3.0);
     160  fprintf( stdout, "isnormal       : %d\n", i1);
     161
     162  /* no type-specific variant */
     163  f1 = isunordered(1.0, 2.0);
     164  fprintf( stdout, "isunordered    : %d\n", i1);
     165
     166  f1 = j0l(1.2);
     167  fprintf( stdout, "j0l            : %Lf\n", f1);
     168
     169  f1 = j1l(1.2);
     170  fprintf( stdout, "j1l            : %Lf\n", f1);
     171
     172  f1 = jnl(2,1.2);
     173  fprintf( stdout, "jnl            : %Lf\n", f1);
     174
     175  f1 = ldexpl(1.2,3);
     176  fprintf( stdout, "ldexpl         : %Lf\n", f1);
     177
     178  f1 = lgammal(42.0);
     179  fprintf( stdout, "lgammal        : %Lf\n", f1);
     180
     181  f1 = llrintl(-0.5);
     182  fprintf( stdout, "llrintl        : %Lf\n", f1);
     183  f1 = llrintl(0.5);
     184  fprintf( stdout, "llrintl        : %Lf\n", f1);
     185
     186  f1 = llroundl(-0.5);
     187  fprintf( stdout, "lroundl        : %Lf\n", f1);
     188  f1 = llroundl(0.5);
     189  fprintf( stdout, "lroundl        : %Lf\n", f1);
     190
     191  f1 = logl(42.0);
     192  fprintf( stdout, "logl           : %Lf\n", f1);
     193
     194  f1 = log10l(42.0);
     195  fprintf( stdout, "log10l         : %Lf\n", f1);
     196
     197  f1 = log1pl(42.0);
     198  fprintf( stdout, "log1pl         : %Lf\n", f1);
     199
     200  f1 = log2l(42.0);
     201  fprintf( stdout, "log2l          : %Lf\n", f1);
     202
     203  f1 = logbl(42.0);
     204  fprintf( stdout, "logbl          : %Lf\n", f1);
     205
     206  f1 = lrintl(-0.5);
     207  fprintf( stdout, "lrintl         : %Lf\n", f1);
     208  f1 = lrintl(0.5);
     209  fprintf( stdout, "lrintl         : %Lf\n", f1);
     210
     211  f1 = lroundl(-0.5);
     212  fprintf( stdout, "lroundl        : %Lf\n", f1);
     213  f1 = lroundl(0.5);
     214  fprintf( stdout, "lroundl        : %Lf\n", f1);
     215
     216  f1 = modfl(42.0,&f2);
     217  fprintf( stdout, "lmodfl         : %Lf\n", f1);
     218
     219  f1 = nanl("");
     220  fprintf( stdout, "nanl           : %Lf\n", f1);
     221
     222  f1 = nearbyintl(1.5);
     223  fprintf( stdout, "nearbyintl     : %Lf\n", f1);
     224
     225  f1 = nextafterl(1.5,2.0);
     226  fprintf( stdout, "nextafterl     : %Lf\n", f1);
     227
     228  f1 = powl(3.01, 2.0);
     229  fprintf( stdout, "powl           : %Lf\n", f1);
     230
     231  f1 = remainderl(3.01,2.0);
     232  fprintf( stdout, "remainderl     : %Lf\n", f1);
     233
     234  f1 = remquol(29.0,3.0,&i1);
     235  fprintf( stdout, "remquol        : %Lf\n", f1);
     236
     237  f1 = rintl(0.5);
     238  fprintf( stdout, "rintl          : %Lf\n", f1);
     239  f1 = rintl(-0.5);
     240  fprintf( stdout, "rintl          : %Lf\n", f1);
     241
     242  f1 = roundl(0.5);
     243  fprintf( stdout, "roundl         : %Lf\n", f1);
     244  f1 = roundl(-0.5);
     245  fprintf( stdout, "roundl         : %Lf\n", f1);
     246
     247  f1 = scalblnl(1.2,3);
     248  fprintf( stdout, "scalblnl       : %Lf\n", f1);
     249
     250  f1 = scalbnl(1.2,3);
     251  fprintf( stdout, "scalbnl        : %Lf\n", f1);
     252
     253  /* no type-specific variant */
     254  i1 = signbit(1.0);
     255  fprintf( stdout, "signbit        : %i\n", i1);
     256
     257  f1 = sinl(M_PI_4);
     258  fprintf( stdout, "sinl           : %Lf\n", f1);
     259
     260  f1 = sinhl(M_PI_4);
     261  fprintf( stdout, "sinhl          : %Lf\n", f1);
     262
     263  f1 = sqrtl(9.0);
     264  fprintf( stdout, "sqrtl          : %Lf\n", f1);
     265
     266  f1 = tanl(M_PI_4);
     267  fprintf( stdout, "tanl           : %Lf\n", f1);
     268
     269  f1 = tanhl(M_PI_4);
     270  fprintf( stdout, "tanhl          : %Lf\n", f1);
     271
     272  f1 = tgammal(2.1);
     273  fprintf( stdout, "tgammal        : %Lf\n", f1);
     274
     275  f1 = truncl(3.5);
     276  fprintf( stdout, "truncl         : %Lf\n", f1);
     277
     278  f1 = y0l(1.2);
     279  fprintf( stdout, "y0l            : %Lf\n", f1);
     280
     281  f1 = y1l(1.2);
     282  fprintf( stdout, "y1l            : %Lf\n", f1);
     283
     284  f1 = ynl(3,1.2);
     285  fprintf( stdout, "ynl            : %Lf\n", f1);
     286#endif
     287}
Note: See TracChangeset for help on using the changeset viewer.