From dfb79891237be767515bcf763af232a8e659c2cc Mon Sep 17 00:00:00 2001 From: Luna Date: Fri, 27 Sep 2019 21:22:03 -0300 Subject: [PATCH] add necessary hello.c code as we dont have linking step --- examples/hello.c | 5 +++++ examples/hello.ry | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 examples/hello.c diff --git a/examples/hello.c b/examples/hello.c new file mode 100644 index 0000000..fff2531 --- /dev/null +++ b/examples/hello.c @@ -0,0 +1,5 @@ +#include + +int main(void) { + printf("add(2, 2) = %d\n", add(2, 2)); +} diff --git a/examples/hello.ry b/examples/hello.ry index 7be6a9a..d3a4e54 100644 --- a/examples/hello.ry +++ b/examples/hello.ry @@ -47,7 +47,7 @@ fn func_refer_param(b: i32) i32 { } fn add(a: i32, b: i32) i32 { - return 69 + 69; + return a + b; } fn and_fn() bool {