OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /openrisc/tags/gnu-src/gcc-4.5.1/gcc-4.5.1-or32-1.0rc1/gcc/testsuite/g++.dg/compat/decimal
    from Rev 301 to Rev 338
    Reverse comparison

Rev 301 → Rev 338

/pass-3_y.C
0,0 → 1,7
#include "decimal-dummy.h"
 
#define dec32 std::decimal::decimal32
#define dec64 std::decimal::decimal64
#define dec128 std::decimal::decimal128
 
#include "pass_y.h"
pass-3_y.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pass-4_x.C =================================================================== --- pass-4_x.C (nonexistent) +++ pass-4_x.C (revision 338) @@ -0,0 +1,32 @@ +#include "decimal-dummy.h" + +#define dec32 std::decimal::decimal32 +#define dec64 std::decimal::decimal64 +#define dec128 std::decimal::decimal128 + +#include "pass_x.h" + +void +pass_4_x (void) +{ +DEBUG_INIT + +#define T(NAME) testit##NAME (); + +#ifndef SKIP_DECIMAL32 +T(d32) +#endif +#ifndef SKIP_DECIMAL64 +T(d64) +#endif +#ifndef SKIP_DECIMAL128 +T(d128) +#endif + +DEBUG_FINI + +if (fails != 0) + abort (); + +#undef T +}
pass-4_x.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pass-4_y.C =================================================================== --- pass-4_y.C (nonexistent) +++ pass-4_y.C (revision 338) @@ -0,0 +1,5 @@ +typedef float dec32 __attribute__((mode(SD))); +typedef float dec64 __attribute__((mode(DD))); +typedef float dec128 __attribute__((mode(TD))); + +#include "pass_y.h"
pass-4_y.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pass-5_x.C =================================================================== --- pass-5_x.C (nonexistent) +++ pass-5_x.C (revision 338) @@ -0,0 +1,30 @@ +typedef float dec32 __attribute__((mode(SD))); +typedef float dec64 __attribute__((mode(DD))); +typedef float dec128 __attribute__((mode(TD))); + +#include "pass_x.h" + +void +pass_5_x (void) +{ +DEBUG_INIT + +#define T(NAME) testit##NAME (); + +#ifndef SKIP_DECIMAL32 +T(d32) +#endif +#ifndef SKIP_DECIMAL64 +T(d64) +#endif +#ifndef SKIP_DECIMAL128 +T(d128) +#endif + +DEBUG_FINI + +if (fails != 0) + abort (); + +#undef T +}
pass-5_x.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pass-6_x.C =================================================================== --- pass-6_x.C (nonexistent) +++ pass-6_x.C (revision 338) @@ -0,0 +1,32 @@ +#include "decimal-dummy.h" + +typedef std::decimal::decimal32 dec32; +typedef std::decimal::decimal64 dec64; +typedef std::decimal::decimal128 dec128; + +#include "pass_x.h" + +void +pass_6_x (void) +{ +DEBUG_INIT + +#define T(NAME) testit##NAME (); + +#ifndef SKIP_DECIMAL32 +T(d32) +#endif +#ifndef SKIP_DECIMAL64 +T(d64) +#endif +#ifndef SKIP_DECIMAL128 +T(d128) +#endif + +DEBUG_FINI + +if (fails != 0) + abort (); + +#undef T +}
pass-6_x.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pass-5_y.C =================================================================== --- pass-5_y.C (nonexistent) +++ pass-5_y.C (revision 338) @@ -0,0 +1,7 @@ +#include "decimal-dummy.h" + +typedef std::decimal::decimal32 dec32; +typedef std::decimal::decimal64 dec64; +typedef std::decimal::decimal128 dec128; + +#include "pass_y.h"
pass-5_y.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pass-6_y.C =================================================================== --- pass-6_y.C (nonexistent) +++ pass-6_y.C (revision 338) @@ -0,0 +1,5 @@ +typedef float dec32 __attribute__((mode(SD))); +typedef float dec64 __attribute__((mode(DD))); +typedef float dec128 __attribute__((mode(TD))); + +#include "pass_y.h"
pass-6_y.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: return-1_x.C =================================================================== --- return-1_x.C (nonexistent) +++ return-1_x.C (revision 338) @@ -0,0 +1,24 @@ +typedef float dec32 __attribute__((mode(SD))); +typedef float dec64 __attribute__((mode(DD))); +typedef float dec128 __attribute__((mode(TD))); + +#include "return_x.h" + +void +return_1_x (void) +{ +DEBUG_INIT + +#define T(NAME) testit##NAME (); + +T(d32) +T(d64) +T(d128) + +DEBUG_FINI + +if (fails != 0) + abort (); + +#undef T +}
return-1_x.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: return-2_x.C =================================================================== --- return-2_x.C (nonexistent) +++ return-2_x.C (revision 338) @@ -0,0 +1,26 @@ +#include "decimal-dummy.h" + +#define dec32 std::decimal::decimal32 +#define dec64 std::decimal::decimal64 +#define dec128 std::decimal::decimal128 + +#include "return_x.h" + +void +return_2_x (void) +{ +DEBUG_INIT + +#define T(NAME) testit##NAME (); + +T(d32) +T(d64) +T(d128) + +DEBUG_FINI + +if (fails != 0) + abort (); + +#undef T +}
return-2_x.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: return-1_y.C =================================================================== --- return-1_y.C (nonexistent) +++ return-1_y.C (revision 338) @@ -0,0 +1,5 @@ +typedef float dec32 __attribute__((mode(SD))); +typedef float dec64 __attribute__((mode(DD))); +typedef float dec128 __attribute__((mode(TD))); + +#include "return_y.h"
return-1_y.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: return-3_x.C =================================================================== --- return-3_x.C (nonexistent) +++ return-3_x.C (revision 338) @@ -0,0 +1,24 @@ +typedef float dec32 __attribute__((mode(SD))); +typedef float dec64 __attribute__((mode(DD))); +typedef float dec128 __attribute__((mode(TD))); + +#include "return_x.h" + +void +return_3_x (void) +{ +DEBUG_INIT + +#define T(NAME) testit##NAME (); + +T(d32) +T(d64) +T(d128) + +DEBUG_FINI + +if (fails != 0) + abort (); + +#undef T +}
return-3_x.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: return-2_y.C =================================================================== --- return-2_y.C (nonexistent) +++ return-2_y.C (revision 338) @@ -0,0 +1,7 @@ +#include "decimal-dummy.h" + +#define dec32 std::decimal::decimal32 +#define dec64 std::decimal::decimal64 +#define dec128 std::decimal::decimal128 + +#include "return_y.h"
return-2_y.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: return-3_y.C =================================================================== --- return-3_y.C (nonexistent) +++ return-3_y.C (revision 338) @@ -0,0 +1,7 @@ +#include "decimal-dummy.h" + +#define dec32 std::decimal::decimal32 +#define dec64 std::decimal::decimal64 +#define dec128 std::decimal::decimal128 + +#include "return_y.h"
return-3_y.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: return-4_x.C =================================================================== --- return-4_x.C (nonexistent) +++ return-4_x.C (revision 338) @@ -0,0 +1,26 @@ +#include "decimal-dummy.h" + +#define dec32 std::decimal::decimal32 +#define dec64 std::decimal::decimal64 +#define dec128 std::decimal::decimal128 + +#include "return_x.h" + +void +return_4_x (void) +{ +DEBUG_INIT + +#define T(NAME) testit##NAME (); + +T(d32) +T(d64) +T(d128) + +DEBUG_FINI + +if (fails != 0) + abort (); + +#undef T +}
return-4_x.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: return-4_y.C =================================================================== --- return-4_y.C (nonexistent) +++ return-4_y.C (revision 338) @@ -0,0 +1,5 @@ +typedef float dec32 __attribute__((mode(SD))); +typedef float dec64 __attribute__((mode(DD))); +typedef float dec128 __attribute__((mode(TD))); + +#include "return_y.h"
return-4_y.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: return-5_x.C =================================================================== --- return-5_x.C (nonexistent) +++ return-5_x.C (revision 338) @@ -0,0 +1,24 @@ +typedef float dec32 __attribute__((mode(SD))); +typedef float dec64 __attribute__((mode(DD))); +typedef float dec128 __attribute__((mode(TD))); + +#include "return_x.h" + +void +return_5_x (void) +{ +DEBUG_INIT + +#define T(NAME) testit##NAME (); + +T(d32) +T(d64) +T(d128) + +DEBUG_FINI + +if (fails != 0) + abort (); + +#undef T +}
return-5_x.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: return-6_x.C =================================================================== --- return-6_x.C (nonexistent) +++ return-6_x.C (revision 338) @@ -0,0 +1,26 @@ +#include "decimal-dummy.h" + +typedef std::decimal::decimal32 dec32; +typedef std::decimal::decimal64 dec64; +typedef std::decimal::decimal128 dec128; + +#include "return_x.h" + +void +return_6_x (void) +{ +DEBUG_INIT + +#define T(NAME) testit##NAME (); + +T(d32) +T(d64) +T(d128) + +DEBUG_FINI + +if (fails != 0) + abort (); + +#undef T +}
return-6_x.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: return-5_y.C =================================================================== --- return-5_y.C (nonexistent) +++ return-5_y.C (revision 338) @@ -0,0 +1,7 @@ +#include "decimal-dummy.h" + +typedef std::decimal::decimal32 dec32; +typedef std::decimal::decimal64 dec64; +typedef std::decimal::decimal128 dec128; + +#include "return_y.h"
return-5_y.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pass-2_main.C =================================================================== --- pass-2_main.C (nonexistent) +++ pass-2_main.C (revision 338) @@ -0,0 +1,13 @@ +/* { dg-require-effective-target dfp } */ + +/* Test passing decimal classes by value. */ + +extern void pass_2_x (void); +int fails; + +int +main () +{ + pass_2_x (); + return 0; +}
pass-2_main.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: return-6_y.C =================================================================== --- return-6_y.C (nonexistent) +++ return-6_y.C (revision 338) @@ -0,0 +1,5 @@ +typedef float dec32 __attribute__((mode(SD))); +typedef float dec64 __attribute__((mode(DD))); +typedef float dec128 __attribute__((mode(TD))); + +#include "return_y.h"
return-6_y.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pass-4_main.C =================================================================== --- pass-4_main.C (nonexistent) +++ pass-4_main.C (revision 338) @@ -0,0 +1,13 @@ +/* { dg-require-effective-target dfp } */ + +/* Test passing decimal classes and scalars by value. */ + +extern void pass_4_x (void); +int fails; + +int +main () +{ + pass_4_x (); + return 0; +}
pass-4_main.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pass-6_main.C =================================================================== --- pass-6_main.C (nonexistent) +++ pass-6_main.C (revision 338) @@ -0,0 +1,13 @@ +/* { dg-require-effective-target dfp } */ + +/* Test passing typedef'd decimal classes and scalars by value. */ + +extern void pass_6_x (void); +int fails; + +int +main () +{ + pass_6_x (); + return 0; +}
pass-6_main.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: compat-common.h =================================================================== --- compat-common.h (nonexistent) +++ compat-common.h (revision 338) @@ -0,0 +1,55 @@ +/* Several of the binary compatibility tests use these macros to + allow debugging the test or tracking down a failure by getting an + indication of whether each individual check passed or failed. + When DBG is defined, each check is shown by a dot (pass) or 'F' + (fail) rather than aborting as soon as a failure is detected. */ + +#ifdef DBG +#include +#define DEBUG_INIT setbuf (stdout, NULL); +#define DEBUG_FPUTS(x) fputs (x, stdout); +#define DEBUG_DOT putc ('.', stdout); +#define DEBUG_NL putc ('\n', stdout); +#define DEBUG_FAIL putc ('F', stdout); fails++; +#define DEBUG_CHECK { DEBUG_FAIL } else { DEBUG_DOT } +#define DEBUG_FINI if (fails) DEBUG_FPUTS ("failed\n") \ + else DEBUG_FPUTS ("passed\n") +#else +#define DEBUG_INIT +#define DEBUG_FPUTS(x) +#define DEBUG_DOT +#define DEBUG_NL +#define DEBUG_FAIL abort (); +#define DEBUG_CHECK abort (); +#define DEBUG_FINI +#endif + +#ifdef SKIP_COMPLEX +#ifndef SKIP_COMPLEX_INT +#define SKIP_COMPLEX_INT +#endif +#endif + +#ifndef SKIP_COMPLEX +#ifdef __GNUC__ +#define CINT(x, y) (x + y * __extension__ 1i) +#define CDBL(x, y) (x + y * __extension__ 1i) +#else +#ifdef __SUNPRO_C +/* ??? Complex support without . */ +#else +#include +#endif +#ifndef SKIP_COMPLEX_INT +#define CINT(x, y) ((_Complex int) (x + y * _Complex_I)) +#endif +#define CDBL(x, y) (x + y * _Complex_I) +#endif +#endif + +#ifdef __cplusplus +extern "C" void abort (void); +#else +extern void abort (void); +#endif +extern int fails;
compat-common.h Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: return-1_main.C =================================================================== --- return-1_main.C (nonexistent) +++ return-1_main.C (revision 338) @@ -0,0 +1,13 @@ +/* { dg-require-effective-target dfp } */ + +/* Test function return values for decimal float scalars. */ + +extern void return_1_x (void); +int fails; + +int +main () +{ + return_1_x (); + return 0; +}
return-1_main.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: return-3_main.C =================================================================== --- return-3_main.C (nonexistent) +++ return-3_main.C (revision 338) @@ -0,0 +1,13 @@ +/* { dg-require-effective-target dfp } */ + +/* Test function return values for decimal float scalars and classes. */ + +extern void return_3_x (void); +int fails; + +int +main () +{ + return_3_x (); + return 0; +}
return-3_main.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: return-5_main.C =================================================================== --- return-5_main.C (nonexistent) +++ return-5_main.C (revision 338) @@ -0,0 +1,14 @@ +/* { dg-require-effective-target dfp } */ + +/* Test function return values for decimal float scalars and typedef'd + classes. */ + +extern void return_5_x (void); +int fails; + +int +main () +{ + return_5_x (); + return 0; +}
return-5_main.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pass_x.h =================================================================== --- pass_x.h (nonexistent) +++ pass_x.h (revision 338) @@ -0,0 +1,151 @@ +#include "compat-common.h" + +#define T(NAME, TYPE, INITVAL) \ +TYPE g01##NAME, g02##NAME, g03##NAME, g04##NAME; \ +TYPE g05##NAME, g06##NAME, g07##NAME, g08##NAME; \ +TYPE g09##NAME, g10##NAME, g11##NAME, g12##NAME; \ +TYPE g13##NAME, g14##NAME, g15##NAME, g16##NAME; \ + \ +extern void init##NAME (TYPE *p, TYPE v); \ +extern void checkg##NAME (void); \ +extern void \ +test##NAME (TYPE x01, TYPE x02, TYPE x03, TYPE x04, \ + TYPE x05, TYPE x06, TYPE x07, TYPE x08, \ + TYPE x09, TYPE x10, TYPE x11, TYPE x12, \ + TYPE x13, TYPE x14, TYPE x15, TYPE x16); \ +extern void testva##NAME (int n, ...); \ + \ +extern void \ +check##NAME (TYPE x, TYPE v) \ +{ \ + if (x != v + INITVAL) \ + DEBUG_CHECK \ +} \ + \ +extern void \ +test2_##NAME (TYPE x01, TYPE x02, TYPE x03, TYPE x04, \ + TYPE x05, TYPE x06, TYPE x07, TYPE x08) \ +{ \ + test##NAME (x01, g02##NAME, x02, g04##NAME, \ + x03, g06##NAME, x04, g08##NAME, \ + x05, g10##NAME, x06, g12##NAME, \ + x07, g14##NAME, x08, g16##NAME); \ +} \ + \ +extern void \ +testit##NAME (void) \ +{ \ + DEBUG_FPUTS (#NAME) \ + DEBUG_FPUTS (" init: ") \ + init##NAME (&g01##NAME, 1); \ + init##NAME (&g02##NAME, 2); \ + init##NAME (&g03##NAME, 3); \ + init##NAME (&g04##NAME, 4); \ + init##NAME (&g05##NAME, 5); \ + init##NAME (&g06##NAME, 6); \ + init##NAME (&g07##NAME, 7); \ + init##NAME (&g08##NAME, 8); \ + init##NAME (&g09##NAME, 9); \ + init##NAME (&g10##NAME, 10); \ + init##NAME (&g11##NAME, 11); \ + init##NAME (&g12##NAME, 12); \ + init##NAME (&g13##NAME, 13); \ + init##NAME (&g14##NAME, 14); \ + init##NAME (&g15##NAME, 15); \ + init##NAME (&g16##NAME, 16); \ + checkg##NAME (); \ + DEBUG_NL \ + DEBUG_FPUTS (#NAME) \ + DEBUG_FPUTS (" test: ") \ + test##NAME (g01##NAME, g02##NAME, g03##NAME, g04##NAME, \ + g05##NAME, g06##NAME, g07##NAME, g08##NAME, \ + g09##NAME, g10##NAME, g11##NAME, g12##NAME, \ + g13##NAME, g14##NAME, g15##NAME, g16##NAME); \ + DEBUG_NL \ + DEBUG_FPUTS (#NAME) \ + DEBUG_FPUTS (" testva: ") \ + DEBUG_NL \ + testva##NAME (1, \ + g01##NAME); \ + DEBUG_NL \ + testva##NAME (2, \ + g01##NAME, g02##NAME); \ + DEBUG_NL \ + testva##NAME (3, \ + g01##NAME, g02##NAME, g03##NAME); \ + DEBUG_NL \ + testva##NAME (4, \ + g01##NAME, g02##NAME, g03##NAME, g04##NAME); \ + DEBUG_NL \ + testva##NAME (5, \ + g01##NAME, g02##NAME, g03##NAME, g04##NAME, \ + g05##NAME); \ + DEBUG_NL \ + testva##NAME (6, \ + g01##NAME, g02##NAME, g03##NAME, g04##NAME, \ + g05##NAME, g06##NAME); \ + DEBUG_NL \ + testva##NAME (7, \ + g01##NAME, g02##NAME, g03##NAME, g04##NAME, \ + g05##NAME, g06##NAME, g07##NAME); \ + DEBUG_NL \ + testva##NAME (8, \ + g01##NAME, g02##NAME, g03##NAME, g04##NAME, \ + g05##NAME, g06##NAME, g07##NAME, g08##NAME); \ + DEBUG_NL \ + testva##NAME (9, \ + g01##NAME, g02##NAME, g03##NAME, g04##NAME, \ + g05##NAME, g06##NAME, g07##NAME, g08##NAME, \ + g09##NAME); \ + DEBUG_NL \ + testva##NAME (10, \ + g01##NAME, g02##NAME, g03##NAME, g04##NAME, \ + g05##NAME, g06##NAME, g07##NAME, g08##NAME, \ + g09##NAME, g10##NAME); \ + DEBUG_NL \ + testva##NAME (11, \ + g01##NAME, g02##NAME, g03##NAME, g04##NAME, \ + g05##NAME, g06##NAME, g07##NAME, g08##NAME, \ + g09##NAME, g10##NAME, g11##NAME); \ + DEBUG_NL \ + testva##NAME (12, \ + g01##NAME, g02##NAME, g03##NAME, g04##NAME, \ + g05##NAME, g06##NAME, g07##NAME, g08##NAME, \ + g09##NAME, g10##NAME, g11##NAME, g12##NAME); \ + DEBUG_NL \ + testva##NAME (13, \ + g01##NAME, g02##NAME, g03##NAME, g04##NAME, \ + g05##NAME, g06##NAME, g07##NAME, g08##NAME, \ + g09##NAME, g10##NAME, g11##NAME, g12##NAME, \ + g13##NAME); \ + DEBUG_NL \ + testva##NAME (14, \ + g01##NAME, g02##NAME, g03##NAME, g04##NAME, \ + g05##NAME, g06##NAME, g07##NAME, g08##NAME, \ + g09##NAME, g10##NAME, g11##NAME, g12##NAME, \ + g13##NAME, g14##NAME); \ + DEBUG_NL \ + testva##NAME (15, \ + g01##NAME, g02##NAME, g03##NAME, g04##NAME, \ + g05##NAME, g06##NAME, g07##NAME, g08##NAME, \ + g09##NAME, g10##NAME, g11##NAME, g12##NAME, \ + g13##NAME, g14##NAME, g15##NAME); \ + DEBUG_NL \ + testva##NAME (16, \ + g01##NAME, g02##NAME, g03##NAME, g04##NAME, \ + g05##NAME, g06##NAME, g07##NAME, g08##NAME, \ + g09##NAME, g10##NAME, g11##NAME, g12##NAME, \ + g13##NAME, g14##NAME, g15##NAME, g16##NAME); \ + DEBUG_NL \ + DEBUG_FPUTS (#NAME) \ + DEBUG_FPUTS (" test2: ") \ + test2_##NAME (g01##NAME, g03##NAME, g05##NAME, g07##NAME, \ + g09##NAME, g11##NAME, g13##NAME, g15##NAME); \ + DEBUG_NL \ +} + +T(d32, dec32, (dec32)1.5DF) +T(d64, dec64, (dec64)2.5DD) +T(d128, dec128, (dec128)3.5DL) + +#undef T
pass_x.h Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pass_y.h =================================================================== --- pass_y.h (nonexistent) +++ pass_y.h (revision 338) @@ -0,0 +1,89 @@ +#include + +#include "compat-common.h" + +#ifdef SKIP_VA +const int test_va = 0; +#else +const int test_va = 1; +#endif + +#define T(NAME, TYPE, INITVAL) \ +extern TYPE g01##NAME, g02##NAME, g03##NAME, g04##NAME; \ +extern TYPE g05##NAME, g06##NAME, g07##NAME, g08##NAME; \ +extern TYPE g09##NAME, g10##NAME, g11##NAME, g12##NAME; \ +extern TYPE g13##NAME, g14##NAME, g15##NAME, g16##NAME; \ + \ +extern void check##NAME (TYPE x, TYPE v); \ + \ +extern void \ +init##NAME (TYPE *p, TYPE v) \ +{ \ + *p = v + INITVAL; \ +} \ + \ +extern void \ +checkg##NAME (void) \ +{ \ + check##NAME (g01##NAME, 1); \ + check##NAME (g02##NAME, 2); \ + check##NAME (g03##NAME, 3); \ + check##NAME (g04##NAME, 4); \ + check##NAME (g05##NAME, 5); \ + check##NAME (g06##NAME, 6); \ + check##NAME (g07##NAME, 7); \ + check##NAME (g08##NAME, 8); \ + check##NAME (g09##NAME, 9); \ + check##NAME (g10##NAME, 10); \ + check##NAME (g11##NAME, 11); \ + check##NAME (g12##NAME, 12); \ + check##NAME (g13##NAME, 13); \ + check##NAME (g14##NAME, 14); \ + check##NAME (g15##NAME, 15); \ + check##NAME (g16##NAME, 16); \ +} \ + \ +extern void \ +test##NAME (TYPE x01, TYPE x02, TYPE x03, TYPE x04, \ + TYPE x05, TYPE x06, TYPE x07, TYPE x08, \ + TYPE x09, TYPE x10, TYPE x11, TYPE x12, \ + TYPE x13, TYPE x14, TYPE x15, TYPE x16) \ +{ \ + check##NAME (x01, 1); \ + check##NAME (x02, 2); \ + check##NAME (x03, 3); \ + check##NAME (x04, 4); \ + check##NAME (x05, 5); \ + check##NAME (x06, 6); \ + check##NAME (x07, 7); \ + check##NAME (x08, 8); \ + check##NAME (x09, 9); \ + check##NAME (x10, 10); \ + check##NAME (x11, 11); \ + check##NAME (x12, 12); \ + check##NAME (x13, 13); \ + check##NAME (x14, 14); \ + check##NAME (x15, 15); \ + check##NAME (x16, 16); \ +} \ + \ +extern void \ +testva##NAME (int n, ...) \ +{ \ + int i; \ + va_list ap; \ + if (test_va) \ + { \ + va_start (ap, n); \ + for (i = 0; i < n; i++) \ + { \ + TYPE t = va_arg (ap, TYPE); \ + check##NAME (t, i+1); \ + } \ + va_end (ap); \ + } \ +} + +T(d32, dec32, (dec32)1.5DF) +T(d64, dec64, (dec64)2.5DD) +T(d128, dec128, (dec128)3.5DL)
pass_y.h Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pass-1_main.C =================================================================== --- pass-1_main.C (nonexistent) +++ pass-1_main.C (revision 338) @@ -0,0 +1,13 @@ +/* { dg-require-effective-target dfp } */ + +/* Test passing decimal scalars by value. */ + +extern void pass_1_x (void); +int fails; + +int +main () +{ + pass_1_x (); + return 0; +}
pass-1_main.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pass-3_main.C =================================================================== --- pass-3_main.C (nonexistent) +++ pass-3_main.C (revision 338) @@ -0,0 +1,13 @@ +/* { dg-require-effective-target dfp } */ + +/* Test passing decimal scalars and classes by value. */ + +extern void pass_3_x (void); +int fails; + +int +main () +{ + pass_3_x (); + return 0; +}
pass-3_main.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: return_x.h =================================================================== --- return_x.h (nonexistent) +++ return_x.h (revision 338) @@ -0,0 +1,90 @@ +#include "compat-common.h" + +#ifdef SKIP_VA +const int test_va = 0; +#else +const int test_va = 1; +#endif + +#define T(NAME, TYPE, INITVAL) \ +TYPE g01##NAME, g02##NAME, g03##NAME, g04##NAME; \ +TYPE g05##NAME, g06##NAME, g07##NAME, g08##NAME; \ +TYPE g09##NAME, g10##NAME, g11##NAME, g12##NAME; \ +TYPE g13##NAME, g14##NAME, g15##NAME, g16##NAME; \ + \ +extern void init##NAME (TYPE *p, TYPE v); \ +extern void checkg##NAME (void); \ +extern TYPE test0##NAME (void); \ +extern TYPE test1##NAME (TYPE); \ +extern TYPE testva##NAME (int n, ...); \ + \ +extern void \ +check##NAME (TYPE x, TYPE v) \ +{ \ + if (x != v) \ + DEBUG_CHECK \ +} \ + \ +extern void \ +testit##NAME (void) \ +{ \ + TYPE rslt; \ + DEBUG_FPUTS (#NAME) \ + DEBUG_FPUTS (" init: ") \ + init##NAME (&g01##NAME, 1); \ + init##NAME (&g02##NAME, 2); \ + init##NAME (&g03##NAME, 3); \ + init##NAME (&g04##NAME, 4); \ + init##NAME (&g05##NAME, 5); \ + init##NAME (&g06##NAME, 6); \ + init##NAME (&g07##NAME, 7); \ + init##NAME (&g08##NAME, 8); \ + init##NAME (&g09##NAME, 9); \ + init##NAME (&g10##NAME, 10); \ + init##NAME (&g11##NAME, 11); \ + init##NAME (&g12##NAME, 12); \ + init##NAME (&g13##NAME, 13); \ + init##NAME (&g14##NAME, 14); \ + init##NAME (&g15##NAME, 15); \ + init##NAME (&g16##NAME, 16); \ + checkg##NAME (); \ + DEBUG_NL \ + DEBUG_FPUTS (#NAME) \ + DEBUG_FPUTS (" test0: ") \ + rslt = test0##NAME (); \ + check##NAME (rslt, g01##NAME); \ + DEBUG_NL \ + DEBUG_FPUTS (#NAME) \ + DEBUG_FPUTS (" test1: ") \ + rslt = test1##NAME (g01##NAME); \ + check##NAME (rslt, g01##NAME); \ + if (test_va) \ + { \ + DEBUG_NL \ + DEBUG_FPUTS (#NAME) \ + DEBUG_FPUTS (" testva: ") \ + rslt = testva##NAME (1, g01##NAME); \ + check##NAME (rslt, g01##NAME); \ + rslt = testva##NAME (5, g01##NAME, g02##NAME, g03##NAME, \ + g04##NAME, g05##NAME); \ + check##NAME (rslt, g05##NAME); \ + rslt = testva##NAME (9, g01##NAME, g02##NAME, g03##NAME, \ + g04##NAME, g05##NAME, g06##NAME, \ + g07##NAME, g08##NAME, g09##NAME); \ + check##NAME (rslt, g09##NAME); \ + rslt = testva##NAME (16, g01##NAME, g02##NAME, g03##NAME, \ + g04##NAME, g05##NAME, g06##NAME, \ + g07##NAME, g08##NAME, g09##NAME, \ + g10##NAME, g11##NAME, g12##NAME, \ + g13##NAME, g14##NAME, g15##NAME, \ + g16##NAME); \ + check##NAME (rslt, g16##NAME); \ + } \ + DEBUG_NL \ +} + +T(d32, dec32, (dec32)1.5DF); +T(d64, dec64, (dec64)2.5DD); +T(d128, dec128, (dec128)3.5DL); + +#undef T
return_x.h Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pass-5_main.C =================================================================== --- pass-5_main.C (nonexistent) +++ pass-5_main.C (revision 338) @@ -0,0 +1,13 @@ +/* { dg-require-effective-target dfp } */ + +/* Test passing decimal scalars and typedef'd classes by value. */ + +extern void pass_5_x (void); +int fails; + +int +main () +{ + pass_5_x (); + return 0; +}
pass-5_main.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: return_y.h =================================================================== --- return_y.h (nonexistent) +++ return_y.h (revision 338) @@ -0,0 +1,67 @@ +#include + +#include "compat-common.h" + +#define T(NAME, TYPE, INITVAL) \ +extern TYPE g01##NAME, g02##NAME, g03##NAME, g04##NAME; \ +extern TYPE g05##NAME, g06##NAME, g07##NAME, g08##NAME; \ +extern TYPE g09##NAME, g10##NAME, g11##NAME, g12##NAME; \ +extern TYPE g13##NAME, g14##NAME, g15##NAME, g16##NAME; \ + \ +extern void check##NAME (TYPE x, TYPE v); \ + \ +extern void \ +init##NAME (TYPE *p, TYPE v) \ +{ \ + *p = v + INITVAL; \ +} \ + \ +extern void \ +checkg##NAME (void) \ +{ \ + check##NAME (g01##NAME, 1+INITVAL); \ + check##NAME (g02##NAME, 2+INITVAL); \ + check##NAME (g03##NAME, 3+INITVAL); \ + check##NAME (g04##NAME, 4+INITVAL); \ + check##NAME (g05##NAME, 5+INITVAL); \ + check##NAME (g06##NAME, 6+INITVAL); \ + check##NAME (g07##NAME, 7+INITVAL); \ + check##NAME (g08##NAME, 8+INITVAL); \ + check##NAME (g09##NAME, 9+INITVAL); \ + check##NAME (g10##NAME, 10+INITVAL); \ + check##NAME (g11##NAME, 11+INITVAL); \ + check##NAME (g12##NAME, 12+INITVAL); \ + check##NAME (g13##NAME, 13+INITVAL); \ + check##NAME (g14##NAME, 14+INITVAL); \ + check##NAME (g15##NAME, 15+INITVAL); \ + check##NAME (g16##NAME, 16+INITVAL); \ +} \ + \ +extern TYPE \ +test0##NAME (void) \ +{ \ + return g01##NAME; \ +} \ + \ +extern TYPE \ +test1##NAME (TYPE x01) \ +{ \ + return x01; \ +} \ + \ +extern TYPE \ +testva##NAME (int n, ...) \ +{ \ + int i; \ + TYPE rslt; \ + va_list ap; \ + va_start (ap, n); \ + for (i = 0; i < n; i++) \ + rslt = va_arg (ap, TYPE); \ + va_end (ap); \ + return rslt; \ +} + +T(d32, dec32, (dec32)1.5) +T(d64, dec64, (dec64)2.5) +T(d128, dec128, (dec128)3.5)
return_y.h Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: return-2_main.C =================================================================== --- return-2_main.C (nonexistent) +++ return-2_main.C (revision 338) @@ -0,0 +1,13 @@ +/* { dg-require-effective-target dfp } */ + +/* Test function return values for decimal classes. */ + +extern void return_2_x (void); +int fails; + +int +main () +{ + return_2_x (); + return 0; +}
return-2_main.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: return-4_main.C =================================================================== --- return-4_main.C (nonexistent) +++ return-4_main.C (revision 338) @@ -0,0 +1,13 @@ +/* { dg-require-effective-target dfp } */ + +/* Test function return values for decimal float classes and scalars. */ + +extern void return_4_x (void); +int fails; + +int +main () +{ + return_4_x (); + return 0; +}
return-4_main.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: return-6_main.C =================================================================== --- return-6_main.C (nonexistent) +++ return-6_main.C (revision 338) @@ -0,0 +1,14 @@ +/* { dg-require-effective-target dfp } */ + +/* Test function return values for typedef'd decimal float classes + and scalars. */ + +extern void return_6_x (void); +int fails; + +int +main () +{ + return_6_x (); + return 0; +}
return-6_main.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pass-1_x.C =================================================================== --- pass-1_x.C (nonexistent) +++ pass-1_x.C (revision 338) @@ -0,0 +1,30 @@ +typedef float dec32 __attribute__((mode(SD))); +typedef float dec64 __attribute__((mode(DD))); +typedef float dec128 __attribute__((mode(TD))); + +#include "pass_x.h" + +void +pass_1_x (void) +{ +DEBUG_INIT + +#define T(NAME) testit##NAME (); + +#ifndef SKIP_DECIMAL32 +T(d32) +#endif +#ifndef SKIP_DECIMAL64 +T(d64) +#endif +#ifndef SKIP_DECIMAL128 +T(d128) +#endif + +DEBUG_FINI + +if (fails != 0) + abort (); + +#undef T +}
pass-1_x.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: decimal-dummy.h =================================================================== --- decimal-dummy.h (nonexistent) +++ decimal-dummy.h (revision 338) @@ -0,0 +1,67 @@ +namespace std { +namespace decimal { + + class decimal32 + { + public: + typedef float __dec32 __attribute__((mode(SD))); + decimal32 () : __val(0.e-101DF) {} + decimal32 (__dec32 x) : __val(x) {} + __dec32 __val; + }; + + class decimal64 + { + public: + typedef float __dec64 __attribute__((mode(DD))); + decimal64 () : __val(0.e-398dd) {} + decimal64 (__dec64 x) : __val(x) {} + __dec64 __val; + }; + + class decimal128 + { + public: + typedef float __dec128 __attribute__((mode(TD))); + decimal128 () : __val(0.e-6176DL) {} + decimal128 (__dec128 x) : __val(x) {} + __dec128 __val; + }; + + inline decimal32 operator+ (decimal32 lhs, decimal32 rhs) + { + decimal32 tmp; + tmp.__val = lhs.__val + rhs.__val; + return tmp; + } + + inline decimal64 operator+ (decimal64 lhs, decimal64 rhs) + { + decimal64 tmp; + tmp.__val = lhs.__val + rhs.__val; + return tmp; + } + + inline decimal128 operator+ (decimal128 lhs, decimal128 rhs) + { + decimal128 tmp; + tmp.__val = lhs.__val + rhs.__val; + return tmp; + } + + inline bool operator!= (decimal32 lhs, decimal32 rhs) + { + return lhs.__val != rhs.__val; + } + + inline bool operator!= (decimal64 lhs, decimal64 rhs) + { + return lhs.__val != rhs.__val; + } + + inline bool operator!= (decimal128 lhs, decimal128 rhs) + { + return lhs.__val != rhs.__val; + } +} +}
decimal-dummy.h Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pass-1_y.C =================================================================== --- pass-1_y.C (nonexistent) +++ pass-1_y.C (revision 338) @@ -0,0 +1,5 @@ +typedef float dec32 __attribute__((mode(SD))); +typedef float dec64 __attribute__((mode(DD))); +typedef float dec128 __attribute__((mode(TD))); + +#include "pass_y.h"
pass-1_y.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pass-2_x.C =================================================================== --- pass-2_x.C (nonexistent) +++ pass-2_x.C (revision 338) @@ -0,0 +1,32 @@ +#include "decimal-dummy.h" + +#define dec32 std::decimal::decimal32 +#define dec64 std::decimal::decimal64 +#define dec128 std::decimal::decimal128 + +#include "pass_x.h" + +void +pass_2_x (void) +{ +DEBUG_INIT + +#define T(NAME) testit##NAME (); + +#ifndef SKIP_DECIMAL32 +T(d32) +#endif +#ifndef SKIP_DECIMAL64 +T(d64) +#endif +#ifndef SKIP_DECIMAL128 +T(d128) +#endif + +DEBUG_FINI + +if (fails != 0) + abort (); + +#undef T +}
pass-2_x.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pass-2_y.C =================================================================== --- pass-2_y.C (nonexistent) +++ pass-2_y.C (revision 338) @@ -0,0 +1,7 @@ +#include "decimal-dummy.h" + +#define dec32 std::decimal::decimal32 +#define dec64 std::decimal::decimal64 +#define dec128 std::decimal::decimal128 + +#include "pass_y.h"
pass-2_y.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pass-3_x.C =================================================================== --- pass-3_x.C (nonexistent) +++ pass-3_x.C (revision 338) @@ -0,0 +1,30 @@ +typedef float dec32 __attribute__((mode(SD))); +typedef float dec64 __attribute__((mode(DD))); +typedef float dec128 __attribute__((mode(TD))); + +#include "pass_x.h" + +void +pass_3_x (void) +{ +DEBUG_INIT + +#define T(NAME) testit##NAME (); + +#ifndef SKIP_DECIMAL32 +T(d32) +#endif +#ifndef SKIP_DECIMAL64 +T(d64) +#endif +#ifndef SKIP_DECIMAL128 +T(d128) +#endif + +DEBUG_FINI + +if (fails != 0) + abort (); + +#undef T +}
pass-3_x.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.