aboutsummaryrefslogtreecommitdiffstats
path: root/test/regression/init2.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/regression/init2.c')
-rw-r--r--test/regression/init2.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/regression/init2.c b/test/regression/init2.c
new file mode 100644
index 00000000..400bd94c
--- /dev/null
+++ b/test/regression/init2.c
@@ -0,0 +1,8 @@
+/* Initialization of local const array */
+
+int f(int x)
+{
+ const int dfl = 2;
+ const int tbl[3] = { 12, 34, 56 };
+ return tbl[x >= 0 && x < 3 ? x : dfl];
+}