From 0ca4524aa485b47f736b8d61e5a1921b4c503d32 Mon Sep 17 00:00:00 2001
From: Virgile Prevosto <virgile.prevosto@m4x.org>
Date: Fri, 9 Sep 2022 11:03:11 +0200
Subject: [PATCH] [tests] reproduce crash of #1164

---
 tests/syntax/ast_diff_1.i | 9 +++++++++
 tests/syntax/ast_diff_2.i | 9 +++++++++
 2 files changed, 18 insertions(+)

diff --git a/tests/syntax/ast_diff_1.i b/tests/syntax/ast_diff_1.i
index 35289597937..7b64586683d 100644
--- a/tests/syntax/ast_diff_1.i
+++ b/tests/syntax/ast_diff_1.i
@@ -94,3 +94,12 @@ void with_goto_unchanged(int c) {
   L1: X++;
   L2: X++;
 }
+
+enum e { t = 1 };
+
+struct s { char c[t]; };
+
+void se() {
+  struct s S;
+  S.c[0] = 1;
+}
diff --git a/tests/syntax/ast_diff_2.i b/tests/syntax/ast_diff_2.i
index 9f6b60d8dce..9ef726b37e4 100644
--- a/tests/syntax/ast_diff_2.i
+++ b/tests/syntax/ast_diff_2.i
@@ -87,3 +87,12 @@ void with_goto_unchanged(int c) {
   L1: X++;
   L2: X++;
 }
+
+enum e { t = 1 };
+
+struct s { char c[t]; };
+
+void se() {
+  struct s S;
+  S.c[0] = 1;
+}
-- 
GitLab