about summary refs log tree commit diff
path: root/examples/17.src
diff options
context:
space:
mode:
Diffstat (limited to 'examples/17.src')
-rw-r--r--examples/17.src12
1 files changed, 12 insertions, 0 deletions
diff --git a/examples/17.src b/examples/17.src
new file mode 100644
index 0000000..0e73fae
--- /dev/null
+++ b/examples/17.src
@@ -0,0 +1,12 @@
+extern printf = (*i64, varargs) => void;
+extern malloc = (i64) => *i64;
+extern free = (*i64) => void;
+
+let main = () => i64 {
+	let x = malloc(8);
+	*x = 10;
+	printf("%p\n", x);
+	printf("%d\n", *x);
+	free(x);
+	return 0;
+};