diff mbox series

[1/6] add testcase for comma in array declarator

Message ID 20200723234641.78462-2-luc.vanoostenryck@gmail.com (mailing list archive)
State Mainlined, archived
Headers show
Series fix parsing of C99's array declarators | expand

Commit Message

Luc Van Oostenryck July 23, 2020, 11:46 p.m. UTC
Comma expressions are not allowed for the size in an array
declarator. Add a testcase for this.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
---
 validation/abstract-array-declarator.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
 create mode 100644 validation/abstract-array-declarator.c
diff mbox series

Patch

diff --git a/validation/abstract-array-declarator.c b/validation/abstract-array-declarator.c
new file mode 100644
index 000000000000..f230e5862ae9
--- /dev/null
+++ b/validation/abstract-array-declarator.c
@@ -0,0 +1,12 @@ 
+void f77(int a[1, 2]);
+void c99(int a[(1, 2)]);
+
+/*
+ * check-name: abstract-array-declarator
+ * check-known-to-fail
+ *
+ * check-error-start
+abstract-array-declarator.c:1:17: error: Expected ] in abstract_array_declarator
+abstract-array-declarator.c:1:17: error: got ,
+ * check-error-end
+ */