From: Andrew Pinski Date: Mon, 6 Jan 2020 01:08:21 +0000 (+0000) Subject: New bitfield testcases. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8f50e25f38c136f2cb73703efccbc175813d960c;p=gcc.git New bitfield testcases. 2020-01-05 Andrew Pinski * gcc.c-torture/compile/20200105-1.c: New testcase. * gcc.c-torture/compile/20200105-2.c: New testcase. * gcc.c-torture/compile/20200105-3.c: New testcase. From-SVN: r279893 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 81ede35bff5..01d4022b693 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2020-01-05 Andrew Pinski + + * gcc.c-torture/compile/20200105-1.c: New testcase. + * gcc.c-torture/compile/20200105-2.c: New testcase. + * gcc.c-torture/compile/20200105-3.c: New testcase. + 2020-01-05 Iain Sandoe * gcc.dg/darwin-version-1.c: Adjust test to use different diff --git a/gcc/testsuite/gcc.c-torture/compile/20200105-1.c b/gcc/testsuite/gcc.c-torture/compile/20200105-1.c new file mode 100644 index 00000000000..8716b6ae65a --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/20200105-1.c @@ -0,0 +1,12 @@ +struct mouse_button_str { + unsigned char left : 1; + unsigned char right : 1; + unsigned char middle : 1; + }; +int g(void) +{ + signed char a = 0; + struct mouse_button_str *newbutton1 = (struct mouse_button_str*)&a; + newbutton1->left = 1; + return a; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/20200105-2.c b/gcc/testsuite/gcc.c-torture/compile/20200105-2.c new file mode 100644 index 00000000000..53294111e1b --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/20200105-2.c @@ -0,0 +1,12 @@ +struct mouse_button_str { + signed char left : 1; + signed char right : 1; + signed char middle : 1; +}; +int g(void) +{ + unsigned char a = 0; + struct mouse_button_str *newbutton1 = (struct mouse_button_str*)&a; + newbutton1->left = 1; + return a; +} diff --git a/gcc/testsuite/gcc.c-torture/compile/20200105-3.c b/gcc/testsuite/gcc.c-torture/compile/20200105-3.c new file mode 100644 index 00000000000..8b55171218e --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/20200105-3.c @@ -0,0 +1,12 @@ +struct mouse_button_str { + unsigned char left : 1; + unsigned char right : 1; + unsigned char middle : 1; +}; +int g(void) +{ + unsigned char a = 0; + struct mouse_button_str *newbutton1 = (struct mouse_button_str*)&a; + newbutton1->left = 1; + return a; +}