diff options
author | Kimplul <kimi.h.kuparinen@gmail.com> | 2025-07-18 22:11:12 +0300 |
---|---|---|
committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2025-07-18 22:11:12 +0300 |
commit | 09e6cad37d4559f83cd27075f0c7c1524d502321 (patch) | |
tree | 9a167ce876a537bab9008377821a3f7ce92f71a7 /tests/xok/val.c | |
parent | 94b767679fc68c51aa0c80bdada35b9978989199 (diff) | |
download | ngc-09e6cad37d4559f83cd27075f0c7c1524d502321.tar.gz ngc-09e6cad37d4559f83cd27075f0c7c1524d502321.zip |
add initial value handling
+ No type checking, shouldn't be too tricky to add in though
Diffstat (limited to 'tests/xok/val.c')
-rw-r--r-- | tests/xok/val.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/xok/val.c b/tests/xok/val.c new file mode 100644 index 0000000..9518d40 --- /dev/null +++ b/tests/xok/val.c @@ -0,0 +1,17 @@ +#include <stdio.h> + +typedef tmpl[](int v){ + int <>_ok() + { + return v; + } +}; + +typedef inst = tmpl[](20); + +int main() +{ + int ok = inst_ok(); + if (ok == 20) + puts("OK"); +} |