diff options
| author | Kimplul <kimi.h.kuparinen@gmail.com> | 2024-08-18 00:07:56 +0300 |
|---|---|---|
| committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2024-08-18 00:07:56 +0300 |
| commit | 33fcf676128426f2ac9a4730d63fa481bb351518 (patch) | |
| tree | fb8553e58fb3553e1b1da334b5a4d54e254f2340 /tests/struct_call/struct_call.ek | |
| parent | 0d4e9292d85a169f881926556992d4ae12dcb6f4 (diff) | |
| download | ek-33fcf676128426f2ac9a4730d63fa481bb351518.tar.gz ek-33fcf676128426f2ac9a4730d63fa481bb351518.zip | |
make check works again
Diffstat (limited to 'tests/struct_call/struct_call.ek')
| -rw-r--r-- | tests/struct_call/struct_call.ek | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/struct_call/struct_call.ek b/tests/struct_call/struct_call.ek new file mode 100644 index 0000000..7d2559b --- /dev/null +++ b/tests/struct_call/struct_call.ek @@ -0,0 +1,25 @@ +typedef i27 {} +typedef i9 {} + +typedef int_pair { + i27 a; + i27 b; +} + +extern _putchar(i9 c); + +add_int_pair(int_pair a, int_pair b => int_pair) +{ + return int_pair!{.a = a.a + b.a, .b = a.b + b.b}; +} + +main() +{ + mut a = int_pair!{.a = 1, .b = 2}; + mut b = int_pair!{.a = 3, .b = 4}; + + mut n = add_int_pair(a, b); + _putchar('0' + n.a as i9); + _putchar('0' + n.b as i9); + _putchar('\n'); +} |
