Merge pull request from birth-software/arguments

Primitive function calls
This commit is contained in:
David 2024-07-06 16:18:20 +02:00 committed by GitHub
commit f6ddf827f2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 991 additions and 425 deletions
.gitignore
bootstrap
compile.shrun_tests.sh
tests/function_call_args

1
.gitignore vendored

@ -1 +1,2 @@
build/
*.data

File diff suppressed because it is too large Load Diff

@ -9,7 +9,7 @@ function compile()
mkdir -p $build_dir
compile_command="time clang++ -o $build_dir/$exe_name $debug_info $optimizations -std=gnu++20 -Wall -Wextra -Wpedantic -Wno-nested-anon-types -pedantic -fno-exceptions -fno-stack-protector -ferror-limit=1 -MJ $build_dir/compile_commands.json"
compile_command="clang++ -o $build_dir/$exe_name $debug_info $optimizations -std=gnu++20 -Wall -Wextra -Wpedantic -Wno-nested-anon-types -pedantic -fno-exceptions -fno-stack-protector -ferror-limit=1 -MJ $build_dir/compile_commands.json"
case "$OSTYPE" in
darwin*) ;;
@ -18,6 +18,6 @@ function compile()
esac
compile_command="$compile_command bootstrap/main.cpp"
echo $compile_command
eval $compile_command
echo -e "\x1b[36m$compile_command\x1b[0m"
eval "time $compile_command"
}

@ -1,6 +1,6 @@
#!/bin/bash
set -ex
set -e
source ./compile.sh
compile "build" "nest" "-g" "";
build/nest

@ -0,0 +1,10 @@
fn foo(arg: s32) s32
{
return arg;
}
fn[cc(.c)] main [export] () s32
{
>arg: s32 = 6;
return foo(arg) - arg;
}