aboutsummaryrefslogtreecommitdiff
path: root/tinycc/tests/tests2/100_c99array-decls.c
diff options
context:
space:
mode:
authorUneven Prankster <unevenprankster@protonmail.com>2023-07-12 13:22:29 -0300
committerUneven Prankster <unevenprankster@protonmail.com>2023-07-12 13:22:29 -0300
commitfa2bdd711212ba6b7a94a20971e8bfa281e73296 (patch)
tree6713b3c0379507d49558287b71dd360ce188a2f0 /tinycc/tests/tests2/100_c99array-decls.c
lol
Diffstat (limited to 'tinycc/tests/tests2/100_c99array-decls.c')
-rw-r--r--tinycc/tests/tests2/100_c99array-decls.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/tinycc/tests/tests2/100_c99array-decls.c b/tinycc/tests/tests2/100_c99array-decls.c
new file mode 100644
index 0000000..46950aa
--- /dev/null
+++ b/tinycc/tests/tests2/100_c99array-decls.c
@@ -0,0 +1,34 @@
+void foo(int [5]);
+void fooc(int x[const 5]);
+void foos(int x[static 5]);
+void foov(int x[volatile 5]);
+void foor(int x[restrict 5]);
+void fooc(int [const 5]);
+void foos(int [static 5]);
+void foov(int [volatile 5]);
+void foor(int [restrict 5]);
+void fooc(int (* const x));
+void foos(int *x);
+void foov(int * volatile x);
+void foor(int * restrict x);
+void fooc(int x[volatile 5])
+{
+ x[3] = 42;
+#ifdef INVALID
+ x = 0;
+#endif
+}
+void foovm(int x[const *]);
+void foovm(int * const x);
+#ifdef INVALID
+void wrongc(int x[3][const 4]);
+void wrongvm(int x[static *]);
+void foovm(int x[const *])
+{
+ x[2] = 1;
+}
+#endif
+int main()
+{
+ return 0;
+}