Changeset b824fb8 in rtems


Ignore:
Timestamp:
May 23, 2012, 2:44:33 PM (8 years ago)
Author:
Ralf Corsépius <ralf.corsepius@…>
Branches:
4.11, master
Children:
5e707bc
Parents:
53f2ca3
git-author:
Ralf Corsépius <ralf.corsepius@…> (05/23/12 14:44:33)
git-committer:
Joel Sherrill <joel.sherrill@…> (05/31/12 15:06:14)
Message:

Revert "libtests/complex: Avoid generated files"

This reverts commit a80a108d447d596e476611108cd468ec993be4a6.

Location:
testsuites/libtests/complex
Files:
1 added
1 deleted
5 edited

Legend:

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

    r53f2ca3 rb824fb8  
    33complex_SOURCES = init.c docomplex.c docomplexf.c docomplexl.c
    44endif
     5EXTRA_DIST = docomplex.in
    56
    67# FIXME: Skip long double, not yet supported in newlib
    78complex_CPPFLAGS = $(AM_CPPFLAGS) -DNO_LONG_DOUBLE
     9
     10docomplex.c: $(srcdir)/docomplex.in
     11        sed -e 's,[@]FTYPE[@],double,' \
     12        -e 's,[@]FSUFFIX[@], ,g' \
     13        -e 's,[@]FGUARD[@],NO_DOUBLE,' \
     14        $(srcdir)/docomplex.in > $(srcdir)/docomplex.c
     15
     16docomplexf.c: $(srcdir)/docomplex.in
     17        sed -e 's,[@]FTYPE[@],float,' \
     18        -e 's,[@]FSUFFIX[@],f,g' \
     19        -e 's,[@]FGUARD[@],NO_FLOAT,' \
     20        $(srcdir)/docomplex.in > $(srcdir)/docomplexf.c
     21
     22docomplexl.c: $(srcdir)/docomplex.in
     23        sed -e 's,[@]FTYPE[@],long double,' \
     24        -e 's,[@]FSUFFIX[@],l,g' \
     25        -e 's,%f,%Lf,g' \
     26        -e 's,[@]FGUARD[@],NO_LONG_DOUBLE,' \
     27        $(srcdir)/docomplex.in > $(srcdir)/docomplexl.c
    828
    929dist_rtems_tests_DATA = complex.scn
  • testsuites/libtests/complex/docomplex.c

    r53f2ca3 rb824fb8  
    1212
    1313#ifdef HAVE_CONFIG_H
    14   #include "config.h"
     14#include "config.h"
    1515#endif
    1616
    17 #ifdef NO_DOUBLE
    18   #define PROVIDE_EMPTY_FUNC
     17#include <complex.h>
     18#include <stdio.h>
     19
     20extern void docomplex  (void);
     21
     22void
     23docomplex  (void)
     24{
     25#ifndef NO_DOUBLE
     26  complex double ca, cb, cc;
     27  double f1;
     28
     29  ca = 1.0 + 1.0 * I;
     30  cb = 1.0 - 1.0 * I;
     31
     32  f1 = cabs  (ca);
     33  fprintf (stdout, "cabs   : %f\n", f1);
     34
     35  cc = cacos  (ca);
     36  fprintf (stdout, "cacos  : %f %fi\n", creal  (cc),
     37           cimag  (cc));
     38
     39  cc = cacosh  (ca);
     40  fprintf (stdout, "cacosh : %f %fi\n", creal  (cc),
     41           cimag  (cc));
     42
     43  f1 = carg  (ca);
     44  fprintf (stdout, "carg   : %f\n", f1);
     45
     46  cc = casin  (ca);
     47  fprintf (stdout, "casin  : %f %fi\n", creal  (cc),
     48           cimag  (cc));
     49
     50  cc = casinh  (ca);
     51  fprintf (stdout, "casinh : %f %fi\n", creal  (cc),
     52           cimag  (cc));
     53
     54  cc = catan  (ca);
     55  fprintf (stdout, "catan  : %f %fi\n", creal  (cc),
     56           cimag  (cc));
     57
     58  cc = catanh  (ca);
     59  fprintf (stdout, "catanh : %f %fi\n", creal  (cc),
     60           cimag  (cc));
     61
     62  cc = ccos  (ca);
     63  fprintf (stdout, "ccos   : %f %fi\n", creal  (cc),
     64           cimag  (cc));
     65
     66  cc = ccosh  (ca);
     67  fprintf (stdout, "ccosh  : %f %fi\n", creal  (cc),
     68           cimag  (cc));
     69
     70  cc = cexp  (ca);
     71  fprintf (stdout, "cexp   : %f %fi\n", creal  (cc),
     72           cimag  (cc));
     73
     74  f1 = cimag  (ca);
     75  fprintf (stdout, "cimag  : %f\n", f1);
     76
     77  cc = clog  (ca);
     78  fprintf (stdout, "clog   : %f %fi\n", creal  (cc),
     79           cimag  (cc));
     80
     81  cc = conj  (ca);
     82  fprintf (stdout, "conj   : %f %fi\n", creal  (cc),
     83           cimag  (cc));
     84
     85  cc = cpow  (ca, cb);
     86  fprintf (stdout, "cpow   : %f %fi\n", creal  (cc),
     87           cimag  (cc));
     88
     89  cc = cproj  (ca);
     90  fprintf (stdout, "cproj  : %f %fi\n", creal  (cc),
     91           cimag  (cc));
     92
     93  f1 = creal  (ca);
     94  fprintf (stdout, "creal  : %f\n", f1);
     95
     96  cc = csin  (ca);
     97  fprintf (stdout, "csin   : %f %fi\n", creal  (cc),
     98           cimag  (cc));
     99
     100  cc = csinh  (ca);
     101  fprintf (stdout, "csinh  : %f %fi\n", creal  (cc),
     102           cimag  (cc));
     103
     104  cc = csqrt  (ca);
     105  fprintf (stdout, "csqrt  : %f %fi\n", creal  (cc),
     106           cimag  (cc));
     107
     108  cc = ctan  (ca);
     109  fprintf (stdout, "ctan   : %f %fi\n", creal  (cc),
     110           cimag  (cc));
     111
     112  cc = ctanh  (ca);
     113  fprintf (stdout, "ctanh  : %f %fi\n", creal  (cc),
     114           cimag  (cc));
    19115#endif
    20 
    21 #define FTYPE double
    22 #define PRI "%f"
    23 
    24 #include "docomplex.h"
     116}
  • testsuites/libtests/complex/docomplexf.c

    r53f2ca3 rb824fb8  
    1212
    1313#ifdef HAVE_CONFIG_H
    14   #include "config.h"
     14#include "config.h"
    1515#endif
    1616
    17 #ifdef NO_FLOAT
    18   #define PROVIDE_EMPTY_FUNC
     17#include <complex.h>
     18#include <stdio.h>
     19
     20extern void docomplexf (void);
     21
     22void
     23docomplexf (void)
     24{
     25#ifndef NO_FLOAT
     26  complex float ca, cb, cc;
     27  float f1;
     28
     29  ca = 1.0 + 1.0 * I;
     30  cb = 1.0 - 1.0 * I;
     31
     32  f1 = cabsf (ca);
     33  fprintf (stdout, "cabsf  : %f\n", f1);
     34
     35  cc = cacosf (ca);
     36  fprintf (stdout, "cacosf : %f %fi\n", crealf (cc),
     37           cimagf (cc));
     38
     39  cc = cacoshf (ca);
     40  fprintf (stdout, "cacoshf: %f %fi\n", crealf (cc),
     41           cimagf (cc));
     42
     43  f1 = cargf (ca);
     44  fprintf (stdout, "cargf  : %f\n", f1);
     45
     46  cc = casinf (ca);
     47  fprintf (stdout, "casinf : %f %fi\n", crealf (cc),
     48           cimagf (cc));
     49
     50  cc = casinhf (ca);
     51  fprintf (stdout, "casinhf: %f %fi\n", crealf (cc),
     52           cimagf (cc));
     53
     54  cc = catanf (ca);
     55  fprintf (stdout, "catanf : %f %fi\n", crealf (cc),
     56           cimagf (cc));
     57
     58  cc = catanhf (ca);
     59  fprintf (stdout, "catanhf: %f %fi\n", crealf (cc),
     60           cimagf (cc));
     61
     62  cc = ccosf (ca);
     63  fprintf (stdout, "ccosf  : %f %fi\n", crealf (cc),
     64           cimagf (cc));
     65
     66  cc = ccoshf (ca);
     67  fprintf (stdout, "ccoshf : %f %fi\n", crealf (cc),
     68           cimagf (cc));
     69
     70  cc = cexpf (ca);
     71  fprintf (stdout, "cexpf  : %f %fi\n", crealf (cc),
     72           cimagf (cc));
     73
     74  f1 = cimagf (ca);
     75  fprintf (stdout, "cimagf : %f\n", f1);
     76
     77  cc = clogf (ca);
     78  fprintf (stdout, "clogf  : %f %fi\n", crealf (cc),
     79           cimagf (cc));
     80
     81  cc = conjf (ca);
     82  fprintf (stdout, "conjf  : %f %fi\n", crealf (cc),
     83           cimagf (cc));
     84
     85  cc = cpowf (ca, cb);
     86  fprintf (stdout, "cpowf  : %f %fi\n", crealf (cc),
     87           cimagf (cc));
     88
     89  cc = cprojf (ca);
     90  fprintf (stdout, "cprojf : %f %fi\n", crealf (cc),
     91           cimagf (cc));
     92
     93  f1 = crealf (ca);
     94  fprintf (stdout, "crealf : %f\n", f1);
     95
     96  cc = csinf (ca);
     97  fprintf (stdout, "csinf  : %f %fi\n", crealf (cc),
     98           cimagf (cc));
     99
     100  cc = csinhf (ca);
     101  fprintf (stdout, "csinhf : %f %fi\n", crealf (cc),
     102           cimagf (cc));
     103
     104  cc = csqrtf (ca);
     105  fprintf (stdout, "csqrtf : %f %fi\n", crealf (cc),
     106           cimagf (cc));
     107
     108  cc = ctanf (ca);
     109  fprintf (stdout, "ctanf  : %f %fi\n", crealf (cc),
     110           cimagf (cc));
     111
     112  cc = ctanhf (ca);
     113  fprintf (stdout, "ctanhf : %f %fi\n", crealf (cc),
     114           cimagf (cc));
    19115#endif
    20 
    21 #define SUFFIX f
    22 #define FTYPE float
    23 #define PRI "%f"
    24 
    25 #include "docomplex.h"
     116}
  • testsuites/libtests/complex/docomplexl.c

    r53f2ca3 rb824fb8  
    1212
    1313#ifdef HAVE_CONFIG_H
    14   #include "config.h"
     14#include "config.h"
    1515#endif
    1616
    17 #ifdef NO_LONG_DOUBLE
    18   #define PROVIDE_EMPTY_FUNC
     17#include <complex.h>
     18#include <stdio.h>
     19
     20extern void docomplexl (void);
     21
     22void
     23docomplexl (void)
     24{
     25#ifndef NO_LONG_DOUBLE
     26  complex long double ca, cb, cc;
     27  long double f1;
     28
     29  ca = 1.0 + 1.0 * I;
     30  cb = 1.0 - 1.0 * I;
     31
     32  f1 = cabsl (ca);
     33  fprintf (stdout, "cabsl  : %Lf\n", f1);
     34
     35  cc = cacosl (ca);
     36  fprintf (stdout, "cacosl : %Lf %Lfi\n", creall (cc),
     37           cimagl (cc));
     38
     39  cc = cacoshl (ca);
     40  fprintf (stdout, "cacoshl: %Lf %Lfi\n", creall (cc),
     41           cimagl (cc));
     42
     43  f1 = cargl (ca);
     44  fprintf (stdout, "cargl  : %Lf\n", f1);
     45
     46  cc = casinl (ca);
     47  fprintf (stdout, "casinl : %Lf %Lfi\n", creall (cc),
     48           cimagl (cc));
     49
     50  cc = casinhl (ca);
     51  fprintf (stdout, "casinhl: %Lf %Lfi\n", creall (cc),
     52           cimagl (cc));
     53
     54  cc = catanl (ca);
     55  fprintf (stdout, "catanl : %Lf %Lfi\n", creall (cc),
     56           cimagl (cc));
     57
     58  cc = catanhl (ca);
     59  fprintf (stdout, "catanhl: %Lf %Lfi\n", creall (cc),
     60           cimagl (cc));
     61
     62  cc = ccosl (ca);
     63  fprintf (stdout, "ccosl  : %Lf %Lfi\n", creall (cc),
     64           cimagl (cc));
     65
     66  cc = ccoshl (ca);
     67  fprintf (stdout, "ccoshl : %Lf %Lfi\n", creall (cc),
     68           cimagl (cc));
     69
     70  cc = cexpl (ca);
     71  fprintf (stdout, "cexpl  : %Lf %Lfi\n", creall (cc),
     72           cimagl (cc));
     73
     74  f1 = cimagl (ca);
     75  fprintf (stdout, "cimagl : %Lf\n", f1);
     76
     77  cc = clogl (ca);
     78  fprintf (stdout, "clogl  : %Lf %Lfi\n", creall (cc),
     79           cimagl (cc));
     80
     81  cc = conjl (ca);
     82  fprintf (stdout, "conjl  : %Lf %Lfi\n", creall (cc),
     83           cimagl (cc));
     84
     85  cc = cpowl (ca, cb);
     86  fprintf (stdout, "cpowl  : %Lf %Lfi\n", creall (cc),
     87           cimagl (cc));
     88
     89  cc = cprojl (ca);
     90  fprintf (stdout, "cprojl : %Lf %Lfi\n", creall (cc),
     91           cimagl (cc));
     92
     93  f1 = creall (ca);
     94  fprintf (stdout, "creall : %Lf\n", f1);
     95
     96  cc = csinl (ca);
     97  fprintf (stdout, "csinl  : %Lf %Lfi\n", creall (cc),
     98           cimagl (cc));
     99
     100  cc = csinhl (ca);
     101  fprintf (stdout, "csinhl : %Lf %Lfi\n", creall (cc),
     102           cimagl (cc));
     103
     104  cc = csqrtl (ca);
     105  fprintf (stdout, "csqrtl : %Lf %Lfi\n", creall (cc),
     106           cimagl (cc));
     107
     108  cc = ctanl (ca);
     109  fprintf (stdout, "ctanl  : %Lf %Lfi\n", creall (cc),
     110           cimagl (cc));
     111
     112  cc = ctanhl (ca);
     113  fprintf (stdout, "ctanhl : %Lf %Lfi\n", creall (cc),
     114           cimagl (cc));
    19115#endif
    20 
    21 #define SUFFIX l
    22 #define FTYPE long double
    23 #define PRI "%Lf"
    24 
    25 #include "docomplex.h"
     116}
  • testsuites/libtests/complex/init.c

    r53f2ca3 rb824fb8  
    3232extern void docomplex(void);
    3333extern void docomplexf(void);
     34#ifndef NO_LONG_DOUBLE
    3435extern void docomplexl(void);
     36#endif
    3537
    3638#if __rtems__
     
    5961  docomplex();
    6062  docomplexf(); 
     63#ifndef NO_LONG_DOUBLE
    6164  docomplexl();
     65#endif
    6266  fprintf( stdout, "*** END OF COMPLEX MATH TEST ***\n" );
    6367  exit( 0 );
Note: See TracChangeset for help on using the changeset viewer.