From 68e7678dbab253a5c9be9181427f2aef7afd1861 Mon Sep 17 00:00:00 2001
From: Virgile Prevosto <virgile.prevosto@m4x.org>
Date: Thu, 23 May 2019 18:20:36 +0200
Subject: [PATCH] [tests] add test for RTE issue mentioned in MR !2261

---
 tests/rte/array_index.c                   | 3 +++
 tests/rte/oracle/array_index.0.res.oracle | 4 ++++
 tests/rte/oracle/array_index.1.res.oracle | 2 ++
 3 files changed, 9 insertions(+)

diff --git a/tests/rte/array_index.c b/tests/rte/array_index.c
index 85c8c6bd1dd..b976e42cce8 100644
--- a/tests/rte/array_index.c
+++ b/tests/rte/array_index.c
@@ -44,4 +44,7 @@ void main(int i, int j, unsigned int k) {
   s.t[k] = 0;
   s.s.u[k] = 0;
   s.v[k].t[c[k]] = 0;
+
+  int x;
+  int t[100 / sizeof(x)];
 }
diff --git a/tests/rte/oracle/array_index.0.res.oracle b/tests/rte/oracle/array_index.0.res.oracle
index 6acdd373586..5c3fb974325 100644
--- a/tests/rte/oracle/array_index.0.res.oracle
+++ b/tests/rte/oracle/array_index.0.res.oracle
@@ -20,6 +20,8 @@ ts s;
 unsigned int c[10];
 void main(int i, int j, unsigned int k)
 {
+  int x;
+  int t_0[(unsigned int)100 / sizeof(x)];
   t[0] = 0;
   u[1] = 0;
   v[2][3] = 0;
@@ -89,6 +91,8 @@ ts s;
 unsigned int c[10];
 void main(int i, int j, unsigned int k)
 {
+  int x;
+  int t_0[(unsigned int)100 / sizeof(x)];
   /*@ assert rte: index_bound: 0 ≤ 0; */
   /*@ assert rte: index_bound: 0 < 10; */
   t[0] = 0;
diff --git a/tests/rte/oracle/array_index.1.res.oracle b/tests/rte/oracle/array_index.1.res.oracle
index 31cf7a921b3..79017aa000b 100644
--- a/tests/rte/oracle/array_index.1.res.oracle
+++ b/tests/rte/oracle/array_index.1.res.oracle
@@ -20,6 +20,8 @@ ts s;
 unsigned int c[10];
 void main(int i, int j, unsigned int k)
 {
+  int x;
+  int t_0[(unsigned int)100 / sizeof(x)];
   t[0] = 0;
   u[1] = 0;
   v[2][3] = 0;
-- 
GitLab