Changeset 2a7b823 in rtems


Ignore:
Timestamp:
May 24, 2012, 5:16:22 AM (8 years ago)
Author:
Ralf Corsépius <ralf.corsepius@…>
Branches:
4.11, master
Children:
daffa60
Parents:
1831fd12
Message:

Revert "Revert "libtests/complex: Avoid generated files""

This reverts commit 0c2d8ec48a116cadb86564bc1226e308e197d4c1.

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

Legend:

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

    r1831fd12 r2a7b823  
    33complex_SOURCES = init.c docomplex.c docomplexf.c docomplexl.c
    44endif
    5 EXTRA_DIST = docomplex.in
    65
    76# FIXME: Skip long double, not yet supported in newlib
    87complex_CPPFLAGS = $(AM_CPPFLAGS) -DNO_LONG_DOUBLE
    9 
    10 docomplex.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 
    16 docomplexf.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 
    22 docomplexl.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
    288
    299dist_rtems_tests_DATA = complex.scn
  • testsuites/libtests/complex/docomplex.c

    r1831fd12 r2a7b823  
    1212
    1313#ifdef HAVE_CONFIG_H
    14 #include "config.h"
     14  #include "config.h"
    1515#endif
    1616
    17 #include <complex.h>
    18 #include <stdio.h>
     17#ifdef NO_DOUBLE
     18  #define PROVIDE_EMPTY_FUNC
     19#endif
    1920
    20 extern void docomplex  (void);
     21#define FTYPE double
     22#define PRI "%f"
    2123
    22 void
    23 docomplex  (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));
    115 #endif
    116 }
     24#include "docomplex.h"
  • testsuites/libtests/complex/docomplexf.c

    r1831fd12 r2a7b823  
    1212
    1313#ifdef HAVE_CONFIG_H
    14 #include "config.h"
     14  #include "config.h"
    1515#endif
    1616
    17 #include <complex.h>
    18 #include <stdio.h>
     17#ifdef NO_FLOAT
     18  #define PROVIDE_EMPTY_FUNC
     19#endif
    1920
    20 extern void docomplexf (void);
     21#define SUFFIX f
     22#define FTYPE float
     23#define PRI "%f"
    2124
    22 void
    23 docomplexf (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));
    115 #endif
    116 }
     25#include "docomplex.h"
  • testsuites/libtests/complex/docomplexl.c

    r1831fd12 r2a7b823  
    1212
    1313#ifdef HAVE_CONFIG_H
    14 #include "config.h"
     14  #include "config.h"
    1515#endif
    1616
    17 #include <complex.h>
    18 #include <stdio.h>
     17#ifdef NO_LONG_DOUBLE
     18  #define PROVIDE_EMPTY_FUNC
     19#endif
    1920
    20 extern void docomplexl (void);
     21#define SUFFIX l
     22#define FTYPE long double
     23#define PRI "%Lf"
    2124
    22 void
    23 docomplexl (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));
    115 #endif
    116 }
     25#include "docomplex.h"
  • testsuites/libtests/complex/init.c

    r1831fd12 r2a7b823  
    3232extern void docomplex(void);
    3333extern void docomplexf(void);
    34 #ifndef NO_LONG_DOUBLE
    3534extern void docomplexl(void);
    36 #endif
    3735
    3836#if __rtems__
     
    6159  docomplex();
    6260  docomplexf(); 
    63 #ifndef NO_LONG_DOUBLE
    6461  docomplexl();
    65 #endif
    6662  fprintf( stdout, "*** END OF COMPLEX MATH TEST ***\n" );
    6763  exit( 0 );
Note: See TracChangeset for help on using the changeset viewer.