New bitfield testcases.
authorAndrew Pinski <apinski@marvell.com>
Mon, 6 Jan 2020 01:08:21 +0000 (01:08 +0000)
committerAndrew Pinski <pinskia@gcc.gnu.org>
Mon, 6 Jan 2020 01:08:21 +0000 (17:08 -0800)
2020-01-05  Andrew Pinski  <apinski@marvell.com>

        * 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

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/20200105-1.c [new file with mode: 0644]
gcc/testsuite/gcc.c-torture/compile/20200105-2.c [new file with mode: 0644]
gcc/testsuite/gcc.c-torture/compile/20200105-3.c [new file with mode: 0644]

index 81ede35..01d4022 100644 (file)
@@ -1,3 +1,9 @@
+2020-01-05  Andrew Pinski  <apinski@marvell.com>
+
+       * 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  <iain@sandoe.co.uk>
 
        * 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 (file)
index 0000000..8716b6a
--- /dev/null
@@ -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 (file)
index 0000000..5329411
--- /dev/null
@@ -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 (file)
index 0000000..8b55171
--- /dev/null
@@ -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;
+}