From 70a42a8559e8a73d8aef09c1d938833ffc811aaa Mon Sep 17 00:00:00 2001 From: Andrew Pinski Date: Tue, 15 Oct 2019 21:06:55 +0000 Subject: [PATCH] 20191015-1.c: New test. 2019-10-15 Andrew Pinski * gcc.c-torture/compile/20191015-1.c: New test. * gcc.c-torture/compile/20191015-2.c: New test. From-SVN: r277011 --- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.c-torture/compile/20191015-1.c | 17 +++++++++++++++++ gcc/testsuite/gcc.c-torture/compile/20191015-2.c | 17 +++++++++++++++++ 3 files changed, 39 insertions(+) create mode 100644 gcc/testsuite/gcc.c-torture/compile/20191015-1.c create mode 100644 gcc/testsuite/gcc.c-torture/compile/20191015-2.c diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 730e396..6dc4f00 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2019-10-15 Andrew Pinski + + * gcc.c-torture/compile/20191015-1.c: New test. + * gcc.c-torture/compile/20191015-2.c: New test. + 2019-10-15 Martin Sebor PR testsuite/92016 diff --git a/gcc/testsuite/gcc.c-torture/compile/20191015-1.c b/gcc/testsuite/gcc.c-torture/compile/20191015-1.c new file mode 100644 index 0000000..4f2755d --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/20191015-1.c @@ -0,0 +1,17 @@ +typedef unsigned uint32_t; +typedef unsigned char uint8_t; +typedef unsigned short uint16_t; +typedef struct { + uint32_t mbxOwner:1; + uint32_t mbxHc:1; + uint32_t mbxReserved:6; + uint32_t mbxCommand : 8; + uint32_t mbxStatus : 16; +} MAILBOX_t; +uint32_t f(void) { + uint32_t mbox; + mbox = 0; + ((MAILBOX_t *)&mbox)->mbxCommand = 0x24; + ((MAILBOX_t *)&mbox)->mbxOwner = 1; +return mbox; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/20191015-2.c b/gcc/testsuite/gcc.c-torture/compile/20191015-2.c new file mode 100644 index 0000000..13a2ee7 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/20191015-2.c @@ -0,0 +1,17 @@ +typedef unsigned uint32_t; +typedef unsigned char uint8_t; +typedef unsigned short uint16_t; +typedef struct { + uint8_t mbxOwner:1; + uint8_t mbxHc:1; + uint8_t mbxReserved:6; + uint8_t mbxCommand : 8; + uint16_t mbxStatus : 16; +} MAILBOX_t; +uint32_t f(void) { + uint32_t mbox; + mbox = 0; + ((MAILBOX_t *)&mbox)->mbxCommand = 0x24; + ((MAILBOX_t *)&mbox)->mbxOwner = 1; +return mbox; +} -- 2.7.4