]> git.draconx.ca Git - cdecl99.git/commitdiff
tests: Add sanity test for variable-length arrays.
authorNick Bowler <nbowler@draconx.ca>
Fri, 21 Jul 2023 03:55:46 +0000 (23:55 -0400)
committerNick Bowler <nbowler@draconx.ca>
Fri, 21 Jul 2023 03:57:58 +0000 (23:57 -0400)
The random crossparse test generates these quite frequently but
it's nice to have the basics covered by simpler inputs.

tests/decl-good.at

index e06fb76c036b65e8e42b1770471cac16ad289a1b..79cc6f9187739f57de263a9da8d7c13908857360 100644 (file)
@@ -96,6 +96,12 @@ SIMPLE_DECLS(
   [[int x@<:@@:>@], [declare x as array of int]],
   [[int @<:@@:>@],  [type array of int]])
 
+SIMPLE_DECLS(
+  [[int x@<:@n@:>@], [declare x as variable-length array n of int]],
+  [[int x@<:@*@:>@], [declare x as variable-length array of int]],
+  [[int @<:@n@:>@],  [type variable-length array n of int]],
+  [[int @<:@*@:>@],  [type variable-length array of int]])
+
 SIMPLE_DECLS_EXPLAIN(
   [[int ((int))], [type function (int) returning int], [int (int)]],
   [[int (x(int))], [declare x as function (int) returning int], [int x(int)]],