Primitive function calls
This commit is contained in:
parent
226de05c6d
commit
f7fee02256
1
.gitignore
vendored
1
.gitignore
vendored
@ -1 +1,2 @@
|
|||||||
build/
|
build/
|
||||||
|
*.data
|
||||||
|
1397
bootstrap/main.cpp
1397
bootstrap/main.cpp
File diff suppressed because it is too large
Load Diff
@ -9,7 +9,7 @@ function compile()
|
|||||||
|
|
||||||
mkdir -p $build_dir
|
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
|
case "$OSTYPE" in
|
||||||
darwin*) ;;
|
darwin*) ;;
|
||||||
@ -18,6 +18,6 @@ function compile()
|
|||||||
esac
|
esac
|
||||||
|
|
||||||
compile_command="$compile_command bootstrap/main.cpp"
|
compile_command="$compile_command bootstrap/main.cpp"
|
||||||
echo $compile_command
|
echo -e "\x1b[36m$compile_command\x1b[0m"
|
||||||
eval $compile_command
|
eval "time $compile_command"
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
set -ex
|
set -e
|
||||||
source ./compile.sh
|
source ./compile.sh
|
||||||
compile "build" "nest" "-g" "";
|
compile "build" "nest" "-g" "";
|
||||||
build/nest
|
build/nest
|
||||||
|
10
tests/function_call_args/main.nat
Normal file
10
tests/function_call_args/main.nat
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
fn foo(arg: s32) s32
|
||||||
|
{
|
||||||
|
return arg;
|
||||||
|
}
|
||||||
|
|
||||||
|
fn[cc(.c)] main [export] () s32
|
||||||
|
{
|
||||||
|
>arg: s32 = 6;
|
||||||
|
return foo(arg) - arg;
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user