diff mbox

[PATCHv2,7/7] gcc/arc: Add an nps400 specific testcase

Message ID 8e641c75960596f23d72b205aa3952e5b032d06b.1461238348.git.andrew.burgess@embecosm.com
State New
Headers show

Commit Message

Andrew Burgess April 21, 2016, 11:39 a.m. UTC
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

Comments

Joern Wolfgang Rennecke April 28, 2016, 7:14 p.m. UTC | #1
On 21/04/16 12:39, Andrew Burgess wrote:
> * gcc.target/arc/nps400-1.c: New file.
Thanks.  I have applied this patch.
diff mbox

Patch

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..f3d6271
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arc/nps400-1.c
@@ -0,0 +1,23 @@ 
+/* { dg-do compile } */
+/* { dg-options "-mcpu=nps400 -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)
+    ;
+}