aboutsummaryrefslogtreecommitdiff
path: root/tests/xok/superval.c
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2025-07-18 22:11:12 +0300
committerKimplul <kimi.h.kuparinen@gmail.com>2025-07-18 22:11:12 +0300
commit09e6cad37d4559f83cd27075f0c7c1524d502321 (patch)
tree9a167ce876a537bab9008377821a3f7ce92f71a7 /tests/xok/superval.c
parent94b767679fc68c51aa0c80bdada35b9978989199 (diff)
downloadngc-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/superval.c')
-rw-r--r--tests/xok/superval.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/xok/superval.c b/tests/xok/superval.c
new file mode 100644
index 0000000..f6903c2
--- /dev/null
+++ b/tests/xok/superval.c
@@ -0,0 +1,24 @@
+#include <stdio.h>
+
+typedef tmpl[](int v){
+ int <>_ok()
+ {
+ return v;
+ }
+};
+
+typedef supertmpl[](int v) = tmpl[](v) {
+ int <>_superok()
+ {
+ return <>_ok();
+ }
+}
+
+typedef inst = supertmpl[](20);
+
+int main()
+{
+ int ok = inst_superok();
+ if (ok == 20)
+ puts("OK");
+}