diff options
author | Kyle Gunger <kgunger12@gmail.com> | 2024-03-17 02:37:39 -0400 |
---|---|---|
committer | Kyle Gunger <kgunger12@gmail.com> | 2024-03-17 02:37:39 -0400 |
commit | d618ab0fb5e083dd9880f22b7bdc43be4a3c0327 (patch) | |
tree | 59548909be587a96b02f023e16dbf56b288c082e /tests | |
parent | 9385eaa149fae5d3c793f154611518342b7f3e9e (diff) | |
parent | f80bb4fd79f27210b606966c421ff3104ad0c959 (diff) |
Merge branch 'main' of git.cshift.net:CircleShift/ctc
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/run.sh | 9 | ||||
-rw-r--r-- | tests/test_controll.tnsl | 12 | ||||
-rw-r--r-- | tests/test_funcall_5.tnsl | 12 | ||||
-rw-r--r-- | tests/test_method_2.tnsl | 2 |
4 files changed, 22 insertions, 13 deletions
diff --git a/tests/run.sh b/tests/run.sh new file mode 100755 index 0000000..136dac1 --- /dev/null +++ b/tests/run.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +mkdir -p ./out/artifact +filename=$1 +filename="${filename%.*}" +../ctc $1 out/artifact/$filename.asm +nasm -f elf64 -o ./out/artifact/$filename.o ./out/artifact/$filename.asm +gcc -o ./out/$filename ./out/artifact/$filename.o + diff --git a/tests/test_controll.tnsl b/tests/test_controll.tnsl deleted file mode 100644 index 47ff241..0000000 --- a/tests/test_controll.tnsl +++ /dev/null @@ -1,12 +0,0 @@ -/; main [int] - - /; if (false) - return 1 - ;; else if (1 == 0) - return 2 - ;; else - return 69 - ;/ - - return 0 -;/ diff --git a/tests/test_funcall_5.tnsl b/tests/test_funcall_5.tnsl new file mode 100644 index 0000000..48bd4fe --- /dev/null +++ b/tests/test_funcall_5.tnsl @@ -0,0 +1,12 @@ +/; f_a (int a) [int] + return a +;/ + +/; f_b (int a, ~int b) [int] + return a + b` +;/ + +/; main [int] + int a = 60 + return f_b(f_a(1) * 9, ~a) +;/ diff --git a/tests/test_method_2.tnsl b/tests/test_method_2.tnsl index 899cdcb..56b3419 100644 --- a/tests/test_method_2.tnsl +++ b/tests/test_method_2.tnsl @@ -12,6 +12,6 @@ struct Vector { /; main [int] Vector a - a.init(1) + a.init(69) return a._elsz ;/ |