diff options
author | Michael Forney <mforney@mforney.org> | 2024-04-16 14:50:26 -0700 |
---|---|---|
committer | Michael Forney <mforney@mforney.org> | 2024-04-16 14:50:26 -0700 |
commit | d345c729b2418f5f536e7fc401047a9a473bdf01 (patch) | |
tree | c367747a47924631404ef3287940fcd48d8f4291 | |
parent | 2ab99da4111ab827b784b1f627c07a4931f7febd (diff) |
test: Add test for compatible array types
-rw-r--r-- | test/compatible-array-types.c | 9 | ||||
-rw-r--r-- | test/compatible-array-types.qbe | 0 |
2 files changed, 9 insertions, 0 deletions
diff --git a/test/compatible-array-types.c b/test/compatible-array-types.c new file mode 100644 index 0000000..61a6411 --- /dev/null +++ b/test/compatible-array-types.c @@ -0,0 +1,9 @@ +static_assert(__builtin_types_compatible_p(int[2], int[1 + 1])); +static_assert(!__builtin_types_compatible_p(int[2], int[1])); +static_assert(!__builtin_types_compatible_p(int[2], unsigned[2])); +static_assert(!__builtin_types_compatible_p(const int (*)[2], int (*)[2])); +typedef int T[2]; +/* FIXME +static_assert(__builtin_types_compatible_p(const T *, const int (*)[2])); +*/ +static_assert(__builtin_types_compatible_p(float[], float[3])); diff --git a/test/compatible-array-types.qbe b/test/compatible-array-types.qbe new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/test/compatible-array-types.qbe |