aboutsummaryrefslogtreecommitdiff
path: root/test/func-array-param.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/func-array-param.c')
-rw-r--r--test/func-array-param.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/func-array-param.c b/test/func-array-param.c
new file mode 100644
index 0000000..f57b8bd
--- /dev/null
+++ b/test/func-array-param.c
@@ -0,0 +1,9 @@
+typedef int T1[];
+typedef const int T2[];
+void f(int a[const], const int b[], const T1 c, T2 d) {
+ /* check type of address, since __builtin_types_compatible_p ignores top-level qualifiers */
+ static_assert(__builtin_types_compatible_p(typeof(&a), int *const*));
+ static_assert(__builtin_types_compatible_p(typeof(&b), const int **));
+ static_assert(__builtin_types_compatible_p(typeof(&c), const int **));
+ static_assert(__builtin_types_compatible_p(typeof(&d), const int **));
+}