summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/compat/union-by-value-1_x.c
diff options
context:
space:
mode:
authorupstream source tree <ports@midipix.org>2015-03-15 20:14:05 -0400
committerupstream source tree <ports@midipix.org>2015-03-15 20:14:05 -0400
commit554fd8c5195424bdbcabf5de30fdc183aba391bd (patch)
tree976dc5ab7fddf506dadce60ae936f43f58787092 /gcc/testsuite/gcc.dg/compat/union-by-value-1_x.c
downloadcbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.bz2
cbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.xz
obtained gcc-4.6.4.tar.bz2 from upstream website;upstream
verified gcc-4.6.4.tar.bz2.sig; imported gcc-4.6.4 source tree from verified upstream tarball. downloading a git-generated archive based on the 'upstream' tag should provide you with a source tree that is binary identical to the one extracted from the above tarball. if you have obtained the source via the command 'git clone', however, do note that line-endings of files in your working directory might differ from line-endings of the respective files in the upstream repository.
Diffstat (limited to 'gcc/testsuite/gcc.dg/compat/union-by-value-1_x.c')
-rw-r--r--gcc/testsuite/gcc.dg/compat/union-by-value-1_x.c180
1 files changed, 180 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/compat/union-by-value-1_x.c b/gcc/testsuite/gcc.dg/compat/union-by-value-1_x.c
new file mode 100644
index 000000000..a3efd4ed7
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/compat/union-by-value-1_x.c
@@ -0,0 +1,180 @@
+#include "compat-common.h"
+
+#define T(TYPE) \
+TYPE g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE; \
+TYPE g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE; \
+TYPE g9s##TYPE, g10s##TYPE, g11s##TYPE, g12s##TYPE; \
+TYPE g13s##TYPE, g14s##TYPE, g15s##TYPE, g16s##TYPE; \
+ \
+extern void init##TYPE (TYPE *p, int i); \
+extern void checkg##TYPE (void); \
+extern 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); \
+extern void testva##TYPE (int n, ...); \
+ \
+void \
+test2_##TYPE (TYPE s1, TYPE s2, TYPE s3, TYPE s4, \
+ TYPE s5, TYPE s6, TYPE s7, TYPE s8) \
+{ \
+ test##TYPE (s1, g2s##TYPE, s2, g4s##TYPE, \
+ s3, g6s##TYPE, s4, g8s##TYPE, \
+ s5, g10s##TYPE, s6, g12s##TYPE, \
+ s7, g14s##TYPE, s8, g16s##TYPE); \
+} \
+ \
+void \
+testit##TYPE (void) \
+{ \
+ DEBUG_FPUTS (#TYPE); \
+ DEBUG_FPUTS (" init: "); \
+ init##TYPE ( &g1s##TYPE, 1); \
+ init##TYPE ( &g2s##TYPE, 2); \
+ init##TYPE ( &g3s##TYPE, 3); \
+ init##TYPE ( &g4s##TYPE, 4); \
+ init##TYPE ( &g5s##TYPE, 5); \
+ init##TYPE ( &g6s##TYPE, 6); \
+ init##TYPE ( &g7s##TYPE, 7); \
+ init##TYPE ( &g8s##TYPE, 8); \
+ init##TYPE ( &g9s##TYPE, 9); \
+ init##TYPE (&g10s##TYPE, 10); \
+ init##TYPE (&g11s##TYPE, 11); \
+ init##TYPE (&g12s##TYPE, 12); \
+ init##TYPE (&g13s##TYPE, 13); \
+ init##TYPE (&g14s##TYPE, 14); \
+ init##TYPE (&g15s##TYPE, 15); \
+ init##TYPE (&g16s##TYPE, 16); \
+ checkg##TYPE (); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (#TYPE); \
+ DEBUG_FPUTS (" test: "); \
+ test##TYPE (g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE, \
+ g9s##TYPE, g10s##TYPE, g11s##TYPE, g12s##TYPE, \
+ g13s##TYPE, g14s##TYPE, g15s##TYPE, g16s##TYPE); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (#TYPE); \
+ DEBUG_FPUTS (" testva:"); \
+ DEBUG_NL; \
+ testva##TYPE (1, \
+ g1s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (2, \
+ g1s##TYPE, g2s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (3, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (4, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (5, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (6, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (7, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (8, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (9, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE, \
+ g9s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (10, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE, \
+ g9s##TYPE, g10s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (11, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE, \
+ g9s##TYPE, g10s##TYPE, g11s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (12, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE, \
+ g9s##TYPE, g10s##TYPE, g11s##TYPE, g12s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (13, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE, \
+ g9s##TYPE, g10s##TYPE, g11s##TYPE, g12s##TYPE, \
+ g13s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (14, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE, \
+ g9s##TYPE, g10s##TYPE, g11s##TYPE, g12s##TYPE, \
+ g13s##TYPE, g14s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (15, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE, \
+ g9s##TYPE, g10s##TYPE, g11s##TYPE, g12s##TYPE, \
+ g13s##TYPE, g14s##TYPE, g15s##TYPE); \
+ DEBUG_NL; \
+ testva##TYPE (16, \
+ g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE, \
+ g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE, \
+ g9s##TYPE, g10s##TYPE, g11s##TYPE, g12s##TYPE, \
+ g13s##TYPE, g14s##TYPE, g15s##TYPE, g16s##TYPE); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (#TYPE); \
+ DEBUG_FPUTS (" test2:"); \
+ test2_##TYPE (g1s##TYPE, g3s##TYPE, g5s##TYPE, g7s##TYPE, \
+ g9s##TYPE, g11s##TYPE, g13s##TYPE, g15s##TYPE); \
+ DEBUG_NL; \
+}
+
+#include "union-defs.h"
+#include "union-check.h"
+
+T(Ucs)
+T(Uci)
+T(Ucl)
+T(Ucll)
+T(Usi)
+T(Usl)
+T(Usll)
+T(Uil)
+T(Uill)
+T(Ulll)
+
+#undef T
+
+void
+union_by_value_1_x ()
+{
+DEBUG_INIT
+
+#define T(TYPE) testit##TYPE ();
+
+T(Ucs)
+T(Uci)
+T(Ucl)
+T(Ucll)
+T(Usi)
+T(Usl)
+T(Usll)
+T(Uil)
+T(Uill)
+T(Ulll)
+
+DEBUG_FINI
+
+if (fails != 0)
+ abort ();
+
+#undef T
+}