commit aae32c7523883c103a8bdb847549345388563c54
parent 33787455afaea0e22d89176ede170941766a9bd4
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Mon, 11 May 2026 21:01:27 +0200
tests/cc: Add execute/0041-iconst
Diffstat:
1 file changed, 17 insertions(+), 0 deletions(-)
diff --git a/tests/cc/error/0041-iconst.c b/tests/cc/error/0041-iconst.c
@@ -0,0 +1,17 @@
+/*
+PATTERN:
+0041-iconst.c:16: error: 'POS2' undeclared
+0041-iconst.c:16: error: array index in initializer not of integer type
+.
+*/
+
+enum {
+ POS0,
+ POS1,
+};
+
+int a[] = {
+ [POS0] = 1,
+ [POS1] = 2,
+ [POS2] = 3,
+};