diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2018-01-25 08:49:33 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2018-01-25 08:49:33 +0000 |
commit | 8bbc33baa40010c8f5ca1af9b8bfffd67ae654ad (patch) | |
tree | c5e2748190eff9453ae08b9117c4c546c48cc539 /gcc/testsuite/gcc.dg/compat/struct-by-value-19_y.c | |
parent | 03ac50856c9fc8c96b7a17239ee40a10397750a7 (diff) | |
download | gcc-tarball-8bbc33baa40010c8f5ca1af9b8bfffd67ae654ad.tar.gz |
Diffstat (limited to 'gcc/testsuite/gcc.dg/compat/struct-by-value-19_y.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/compat/struct-by-value-19_y.c | 104 |
1 files changed, 104 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/compat/struct-by-value-19_y.c b/gcc/testsuite/gcc.dg/compat/struct-by-value-19_y.c new file mode 100644 index 0000000000..036c6b618d --- /dev/null +++ b/gcc/testsuite/gcc.dg/compat/struct-by-value-19_y.c @@ -0,0 +1,104 @@ +#include <stdarg.h> + +#include "compat-common.h" + +#ifdef SKIP_VA +const int test_va = 0; +#else +const int test_va = 1; +#endif + +#include "mixed-struct-defs.h" + +extern void checkScd (Scd x, int i); +extern void checkScdc (Scdc x, int i); +extern void checkSd (Sd x, int i); +extern void checkSdi (Sdi x, int i); +extern void checkScsds (Scsds x, int i); +extern void checkScsdsc (Scsdsc x, int i); +extern void checkScsdis (Scsdis x, int i); +extern void checkScsdisc (Scsdisc x, int i); +extern void checkSsds (Ssds x, int i); +extern void checkSsdsc (Ssdsc x, int i); +extern void checkScssdss (Scssdss x, int i); +extern void checkScssdssc (Scssdssc x, int i); + +#include "mixed-struct-init.h" + +#define T(TYPE) \ +extern TYPE g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE; \ +extern TYPE g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE; \ +extern TYPE g9s##TYPE, g10s##TYPE, g11s##TYPE, g12s##TYPE; \ +extern TYPE g13s##TYPE, g14s##TYPE, g15s##TYPE, g16s##TYPE; \ + \ +void \ +checkg##TYPE (void) \ +{ \ + check##TYPE ( g1s##TYPE, 1); \ + check##TYPE ( g2s##TYPE, 2); \ + check##TYPE ( g3s##TYPE, 3); \ + check##TYPE ( g4s##TYPE, 4); \ + check##TYPE ( g5s##TYPE, 5); \ + check##TYPE ( g6s##TYPE, 6); \ + check##TYPE ( g7s##TYPE, 7); \ + check##TYPE ( g8s##TYPE, 8); \ + check##TYPE ( g9s##TYPE, 9); \ + check##TYPE ( g10s##TYPE, 10); \ + check##TYPE ( g11s##TYPE, 11); \ + check##TYPE ( g12s##TYPE, 12); \ + check##TYPE ( g13s##TYPE, 13); \ + check##TYPE ( g14s##TYPE, 14); \ + check##TYPE ( g15s##TYPE, 15); \ + check##TYPE ( g16s##TYPE, 16); \ +} \ + \ +void \ +test##TYPE (TYPE s1, TYPE s2, TYPE s3, TYPE s4, \ + TYPE s5, TYPE s6, TYPE s7, TYPE s8, \ + TYPE s9, TYPE s10, TYPE s11, TYPE s12, \ + TYPE s13, TYPE s14, TYPE s15, TYPE s16) \ +{ \ + check##TYPE (s1, 1); \ + check##TYPE (s2, 2); \ + check##TYPE (s3, 3); \ + check##TYPE (s4, 4); \ + check##TYPE (s5, 5); \ + check##TYPE (s6, 6); \ + check##TYPE (s7, 7); \ + check##TYPE (s8, 8); \ + check##TYPE (s9, 9); \ + check##TYPE (s10, 10); \ + check##TYPE (s11, 11); \ + check##TYPE (s12, 12); \ + check##TYPE (s13, 13); \ + check##TYPE (s14, 14); \ + check##TYPE (s15, 15); \ + check##TYPE (s16, 16); \ +} \ + \ +void \ +testva##TYPE (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##TYPE (t, i+1); \ + } \ + va_end (ap); \ + } \ +} + +T(Scdc) +T(Sd) +T(Sdi) +T(Scsdsc) +T(Scsdis) +T(Scsdisc) +T(Ssds) +T(Ssdsc) +T(Scssdssc) |