[PATCH 3/6] add testcases for C99 array declarators

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



C99 introduced some funky new array declarators, those with
'restrict' or 'static' inside the brackets.

Add some testcases for them.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx>
---
 validation/abstract-array-declarator-quals.c | 22 ++++++++++++++++++++
 validation/abstract-array-declarator-star.c  |  9 ++++++++
 2 files changed, 31 insertions(+)
 create mode 100644 validation/abstract-array-declarator-quals.c
 create mode 100644 validation/abstract-array-declarator-star.c

diff --git a/validation/abstract-array-declarator-quals.c b/validation/abstract-array-declarator-quals.c
new file mode 100644
index 000000000000..85a35a2aca7c
--- /dev/null
+++ b/validation/abstract-array-declarator-quals.c
@@ -0,0 +1,22 @@
+#define N 2
+
+void ok1(int []);
+void ok2(int [N]);
+void ok3(int [const volatile restrict]);
+void ok4(int [const volatile restrict N]);
+void ok5(int [static N]);
+void ok6(int [static const volatile restrict N]);
+void ok7(int [const volatile restrict static N]);
+
+void ok1(int a[]);
+void ok2(int a[N]);
+void ok3(int a[const volatile restrict]);
+void ok4(int a[const volatile restrict N]);
+void ok5(int a[static N]);
+void ok6(int a[static const volatile restrict N]);
+void ok7(int a[const volatile restrict static N]);
+
+/*
+ * check-name: abstract-array-declarator-quals
+ * check-known-to-fail
+ */
diff --git a/validation/abstract-array-declarator-star.c b/validation/abstract-array-declarator-star.c
new file mode 100644
index 000000000000..fdbdff19840d
--- /dev/null
+++ b/validation/abstract-array-declarator-star.c
@@ -0,0 +1,9 @@
+void ok8(int [*]);
+
+void ok8(int a[*]);
+void ok9(int a[const volatile restrict *]);
+
+/*
+ * check-name: abstract-array-declarator-star
+ * check-known-to-fail
+ */
-- 
2.27.0




[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux