From cf7d0320af9d8e58848fff3b6640c7c4474b8f85 Mon Sep 17 00:00:00 2001 From: Ethan Girouard Date: Mon, 1 Sep 2025 15:57:39 -0400 Subject: [PATCH] Add sizeof test --- test/sizeof.w12 | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 test/sizeof.w12 diff --git a/test/sizeof.w12 b/test/sizeof.w12 new file mode 100644 index 0000000..1b056b5 --- /dev/null +++ b/test/sizeof.w12 @@ -0,0 +1,33 @@ +struct BigStruct { + name: [char], + number: int, + number2: int, +} + +struct BiggerStruct { + character: char, + big: BigStruct, +} + +struct SmallStruct { + value: int, +} + + +fn main() -> int { + printf("Size of int: %u\n", sizeof int); + printf("Size of uint: %u\n", sizeof uint); + printf("Size of float: %u\n", sizeof float); + printf("Size of [char]: %u\n", sizeof [char]); + printf("Size of [int]: %u\n", sizeof [int]); + printf("Size of bool: %u\n", sizeof bool); + printf("Size of int*: %u\n", sizeof int*); + printf("Size of bool*: %u\n", sizeof bool*); + printf("Size of BigStruct*: %u\n", sizeof BigStruct*); + printf("Size of SmallStruct*: %u\n", sizeof SmallStruct*); + printf("Size of BigStruct: %u\n", sizeof BigStruct); + printf("Size of BiggerStruct: %u\n", sizeof BiggerStruct); + printf("Size of SmallStruct: %u\n", sizeof SmallStruct); + + return 0; +}