aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/compat/struct-align-1_y.c
diff options
context:
space:
mode:
authorJanis Johnson <janis187@us.ibm.com>2003-07-03 20:15:48 +0000
committerJanis Johnson <janis@gcc.gnu.org>2003-07-03 20:15:48 +0000
commit0964c98c4c3e37652497515f187b29da47e3776b (patch)
treea1c5a32eb63210e8677c4860fe70c46dac0d598f /gcc/testsuite/gcc.dg/compat/struct-align-1_y.c
parentc3427c7d9da7c93127f1c37aa57ce32569647af2 (diff)
downloadgcc-0964c98c4c3e37652497515f187b29da47e3776b.zip
gcc-0964c98c4c3e37652497515f187b29da47e3776b.tar.gz
gcc-0964c98c4c3e37652497515f187b29da47e3776b.tar.bz2
fnptr-by-value-1_main.c: New file.
* gcc.dg/compat/fnptr-by-value-1_main.c: New file. * gcc.dg/compat/fnptr-by-value-1_x.c: New file. * gcc.dg/compat/fnptr-by-value-1_y.c: New file. * gcc.dg/compat/struct-align-1.h: New file. * gcc.dg/compat/struct-align-1_main.c: New file. * gcc.dg/compat/struct-align-1_x.c: New file. * gcc.dg/compat/struct-align-1_y.c: New file. * gcc.dg/compat/struct-align-2.h: New file. * gcc.dg/compat/struct-align-2_main.c: New file. * gcc.dg/compat/struct-align-2_x.c: New file. * gcc.dg/compat/struct-align-2_y.c: New file. From-SVN: r68901
Diffstat (limited to 'gcc/testsuite/gcc.dg/compat/struct-align-1_y.c')
-rw-r--r--gcc/testsuite/gcc.dg/compat/struct-align-1_y.c88
1 files changed, 88 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/compat/struct-align-1_y.c b/gcc/testsuite/gcc.dg/compat/struct-align-1_y.c
new file mode 100644
index 0000000..744f4de6
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/compat/struct-align-1_y.c
@@ -0,0 +1,88 @@
+#include "compat-common.h"
+#include "struct-align-1.h"
+
+#define TEST(NAME) \
+extern char v1_##NAME; \
+extern double v2_##NAME; \
+extern int v3_##NAME; \
+ \
+extern struct B1_##NAME b1_##NAME, ab1_##NAME[2]; \
+extern struct B2_##NAME b2_##NAME, ab2_##NAME[2]; \
+extern struct B3_##NAME b3_##NAME, ab3_##NAME[2]; \
+ \
+extern void pass1_##NAME (struct B1_##NAME); \
+extern void pass2_##NAME (struct B2_##NAME); \
+extern void pass3_##NAME (struct B3_##NAME); \
+extern struct B1_##NAME return1_##NAME (void); \
+extern struct B2_##NAME return2_##NAME (void); \
+extern struct B3_##NAME return3_##NAME (void); \
+ \
+void \
+checkp1_##NAME (struct B1_##NAME *p) \
+{ \
+ if (p->c != v1_##NAME) \
+ DEBUG_CHECK; \
+ if (p->d != v2_##NAME) \
+ DEBUG_CHECK; \
+} \
+ \
+void \
+checkp2_##NAME (struct B2_##NAME *p) \
+{ \
+ if (p->c != v1_##NAME) \
+ DEBUG_CHECK; \
+ if (p->a2.d != v2_##NAME) \
+ DEBUG_CHECK; \
+} \
+ \
+void \
+checkp3_##NAME (struct B3_##NAME *p) \
+{ \
+ if (p->c != v1_##NAME) \
+ DEBUG_CHECK; \
+ if (p->a3.d != v2_##NAME) \
+ DEBUG_CHECK; \
+ if (p->a3.i != v3_##NAME) \
+ DEBUG_CHECK; \
+} \
+ \
+void \
+test_##NAME (void) \
+{ \
+ struct B1_##NAME s1; \
+ struct B2_##NAME s2; \
+ struct B3_##NAME s3; \
+ DEBUG_FPUTS (DESC_##NAME); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (" global variable"); \
+ checkp1_##NAME (&b1_##NAME); \
+ checkp2_##NAME (&b2_##NAME); \
+ checkp3_##NAME (&b3_##NAME); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (" global array"); \
+ checkp1_##NAME (&ab1_##NAME[1]); \
+ checkp2_##NAME (&ab2_##NAME[1]); \
+ checkp3_##NAME (&ab3_##NAME[1]); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (" argument"); \
+ pass1_##NAME (b1_##NAME); \
+ pass2_##NAME (b2_##NAME); \
+ pass3_##NAME (b3_##NAME); \
+ DEBUG_NL; \
+ DEBUG_FPUTS (" function result"); \
+ s1 = return1_##NAME (); \
+ checkp1_##NAME (&s1); \
+ s2 = return2_##NAME (); \
+ checkp2_##NAME (&s2); \
+ s3 = return3_##NAME (); \
+ checkp3_##NAME (&s3); \
+ DEBUG_NL; \
+}
+
+TEST (orig)
+TEST (p_all)
+TEST (p_inner)
+TEST (p_outer)
+TEST (a_max)
+TEST (m_outer_p_inner)
+TEST (m_inner_p_outer)