hare

[hare] The Hare programming language
git clone https://git.torresjrjr.com/hare.git
Log | Files | Refs | README | LICENSE

commit aa397f7164e12ed4e6ef67528b5700b9c4d894f5
parent af3f91dfe92a1f144cf9307c9b234acb14fd9d82
Author: Sebastian <sebastian@sebsite.pw>
Date:   Sun, 27 Aug 2023 03:08:18 -0400

types::c: add more static assert tests

Signed-off-by: Sebastian <sebastian@sebsite.pw>

Diffstat:
Mtypes/c/+test.ha | 10++++++++++
1 file changed, 10 insertions(+), 0 deletions(-)

diff --git a/types/c/+test.ha b/types/c/+test.ha @@ -1,4 +1,7 @@ @test fn sizes() void = { + static assert(size(char) == size(schar)); + static assert(size(char) == size(uchar)); + static assert(size(char) == 1); static assert(size(short) == size(ushort)); static assert(size(long) == size(ulong)); static assert(size(longlong) == size(ulonglong)); @@ -8,7 +11,14 @@ static assert(size(short) <= size(int)); static assert(size(long) >= 4); static assert(size(longlong) >= 8); + static assert(size(short) >= size(char)); + static assert(size(int) >= size(short)); + static assert(size(long) >= size(int)); + static assert(size(longlong) >= size(long)); + static assert(align(char) == align(schar)); + static assert(align(char) == align(uchar)); + static assert(align(char) == 1); static assert(align(short) == align(ushort)); static assert(align(long) == align(ulong)); static assert(align(longlong) == align(ulonglong));