aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/compat/struct-align-1_x.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_x.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_x.c')
-rw-r--r--gcc/testsuite/gcc.dg/compat/struct-align-1_x.c91
1 files changed, 91 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/compat/struct-align-1_x.c b/gcc/testsuite/gcc.dg/compat/struct-align-1_x.c
new file mode 100644
index 0000000..1500fa7
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/compat/struct-align-1_x.c
@@ -0,0 +1,91 @@
+#include "compat-common.h"
+#include "struct-align-1.h"
+
+#define SETUP(NAME,V1,V2,V3) \
+char v1_##NAME = V1; \
+double v2_##NAME = V2; \
+int v3_##NAME = V3; \
+ \
+struct B1_##NAME b1_##NAME = { V1, V2 }; \
+struct B2_##NAME b2_##NAME = { V1, { V2 } }; \
+struct B3_##NAME b3_##NAME = { V1, { V2, V3 } }; \
+ \
+struct B1_##NAME ab1_##NAME[2] = \
+ { { V1, V2 }, { V1, V2 } }; \
+struct B2_##NAME ab2_##NAME[2] = \
+ { { V1, { V2 } }, { V1, { V2 } } }; \
+struct B3_##NAME ab3_##NAME[2] = \
+ { { V1, { V2, V3 } }, { V1, { V2, V3 } } }; \
+ \
+extern void test_##NAME (void); \
+extern void checkp1_##NAME (struct B1_##NAME *); \
+extern void checkp2_##NAME (struct B2_##NAME *); \
+extern void checkp3_##NAME (struct B3_##NAME *); \
+extern void checkg1_##NAME (void); \
+extern void checkg2_##NAME (void); \
+extern void checkg3_##NAME (void); \
+ \
+void \
+pass1_##NAME (struct B1_##NAME s) \
+{ \
+ checkp1_##NAME (&s); \
+} \
+ \
+void \
+pass2_##NAME (struct B2_##NAME s) \
+{ \
+ checkp2_##NAME (&s); \
+} \
+ \
+void \
+pass3_##NAME (struct B3_##NAME s) \
+{ \
+ checkp3_##NAME (&s); \
+} \
+ \
+struct B1_##NAME \
+return1_##NAME (void) \
+{ \
+ return ab1_##NAME[0]; \
+} \
+ \
+struct B2_##NAME \
+return2_##NAME (void) \
+{ \
+ return ab2_##NAME[0]; \
+} \
+ \
+struct B3_##NAME \
+return3_##NAME (void) \
+{ \
+ return ab3_##NAME[0]; \
+}
+
+#define CHECK(NAME) test_##NAME()
+
+SETUP (orig, 49, 1.0, 111111)
+SETUP (p_all, 50, 2.0, 222222)
+SETUP (p_inner, 51, 3.0, 333333)
+SETUP (p_outer, 52, 4.0, 444444)
+SETUP (a_max, 53, 5.0, 555555)
+SETUP (m_outer_p_inner, 54, 6.0, 666666)
+SETUP (m_inner_p_outer, 55, 7.0, 777777)
+
+void
+struct_align_1_x (void)
+{
+ DEBUG_INIT
+
+ CHECK (orig);
+ CHECK (p_all);
+ CHECK (p_inner);
+ CHECK (p_outer);
+ CHECK (a_max);
+ CHECK (m_outer_p_inner);
+ CHECK (m_inner_p_outer);
+
+ DEBUG_FINI
+
+ if (fails != 0)
+ abort ();
+}