This test case triggered a bug caused by VOIDmode not being handled in
proper_comparison_operator, this problem was fixed with a commit on
2016-01-27 by Claudiu Zissulescu, adding this test case for coverage.

gcc/testsuite/ChangeLog:

        * gcc.target/arc/nps400-1.c: New file.
---
 gcc/testsuite/ChangeLog.NPS400          |  4 ++++
 gcc/testsuite/gcc.target/arc/nps400-1.c | 23 +++++++++++++++++++++++
 2 files changed, 27 insertions(+)
 create mode 100644 gcc/testsuite/gcc.target/arc/nps400-1.c

diff --git a/gcc/testsuite/ChangeLog.NPS400 b/gcc/testsuite/ChangeLog.NPS400
index d658bd9..20f88d0 100644
--- a/gcc/testsuite/ChangeLog.NPS400
+++ b/gcc/testsuite/ChangeLog.NPS400
@@ -1,3 +1,7 @@
+2016-02-06  Andrew Burgess  <andrew.burg...@embecosm.com>
+
+       * gcc.target/arc/nps400-1.c: New file.
+
 2016-01-19  Andrew Burgess  <andrew.burg...@embecosm.com>
 
        * gcc.target/arc/movh_cl-1.c: New file.
diff --git a/gcc/testsuite/gcc.target/arc/nps400-1.c 
b/gcc/testsuite/gcc.target/arc/nps400-1.c
new file mode 100644
index 0000000..57d6800
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arc/nps400-1.c
@@ -0,0 +1,23 @@
+/* { dg-do compile { target arc*-mellanox-* } } */
+/* { dg-options "-mq-class -mbitops -munaligned-access -mcmem -O2 
-fno-strict-aliasing" } */
+
+enum npsdp_mem_space_type {
+  NPSDP_EXTERNAL_MS = 1
+};
+struct npsdp_ext_addr {
+  struct {
+    struct {
+      enum npsdp_mem_space_type mem_type : 1;
+      unsigned msid : 5;
+    };
+  };
+  char user_space[];
+} a;
+char b;
+void fn1() {
+  ((struct npsdp_ext_addr *)a.user_space)->mem_type = NPSDP_EXTERNAL_MS;
+  ((struct npsdp_ext_addr *)a.user_space)->msid =
+      ((struct npsdp_ext_addr *)a.user_space)->mem_type ? 1 : 10;
+  while (b)
+    ;
+}
-- 
2.6.4

Reply via email to