summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr56341-2.c
diff options
context:
space:
mode:
authormrs <mrs@138bc75d-0d04-0410-961f-82ee72b054a4>2013-12-13 17:31:30 +0000
committermrs <mrs@138bc75d-0d04-0410-961f-82ee72b054a4>2013-12-13 17:31:30 +0000
commit3dd775fb895cffb77ac74098a74e9fca28edaf79 (patch)
treef68062e9cfe09046337dc976767a5f7938462868 /gcc/testsuite/gcc.dg/pr56341-2.c
parent84014c53e113ab540befd1eceb8598d28a323ab3 (diff)
parent34a5d2a56d4b0a0ea74339c985c919aabfc530a4 (diff)
downloadgcc-3dd775fb895cffb77ac74098a74e9fca28edaf79.tar.gz
Merge in trunk.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/wide-int@205966 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg/pr56341-2.c')
-rw-r--r--gcc/testsuite/gcc.dg/pr56341-2.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/pr56341-2.c b/gcc/testsuite/gcc.dg/pr56341-2.c
new file mode 100644
index 00000000000..e6f6569f089
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr56341-2.c
@@ -0,0 +1,40 @@
+/* { dg-do run } */
+/* { dg-options "-fno-strict-volatile-bitfields" } */
+
+extern void abort (void);
+
+struct test0
+{
+ unsigned char b1[2];
+} __attribute__((packed, aligned(2)));
+
+struct test1
+{
+ volatile unsigned long a1;
+ unsigned char b1[4];
+} __attribute__((packed, aligned(2)));
+
+struct test2
+{
+ struct test0 t0;
+ struct test1 t1;
+ struct test0 t2;
+} __attribute__((packed, aligned(2)));
+
+struct test2 xx;
+struct test2 *x1 = &xx;
+
+#define MAGIC 0x12345678
+
+void test0 (struct test2* x1)
+{
+ x1->t1.a1 = MAGIC;
+}
+
+int main()
+{
+ test0 (x1);
+ if (xx.t1.a1 != MAGIC)
+ abort ();
+ return 0;
+}