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; +}