refactored the testing system, fixed fput and removed arr_asm.sl
This commit is contained in:
1
extra_tests/args.args
Normal file
1
extra_tests/args.args
Normal file
@@ -0,0 +1 @@
|
||||
foo bar
|
||||
3
extra_tests/args.expected
Normal file
3
extra_tests/args.expected
Normal file
@@ -0,0 +1,3 @@
|
||||
./build/args
|
||||
foo
|
||||
bar
|
||||
10
extra_tests/args.sl
Normal file
10
extra_tests/args.sl
Normal file
@@ -0,0 +1,10 @@
|
||||
import stdlib/stdlib.sl
|
||||
|
||||
word main
|
||||
0 argc for
|
||||
dup
|
||||
argv@ dup strlen puts
|
||||
1 +
|
||||
end
|
||||
0
|
||||
end
|
||||
3
extra_tests/c_extern.expected
Normal file
3
extra_tests/c_extern.expected
Normal file
@@ -0,0 +1,3 @@
|
||||
10
|
||||
4.000000
|
||||
3.141593
|
||||
4
extra_tests/c_extern.meta.json
Normal file
4
extra_tests/c_extern.meta.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"description": "C-style extern demo against libc/libm",
|
||||
"libs": ["libc.so.6", "m"]
|
||||
}
|
||||
23
extra_tests/c_extern.sl
Normal file
23
extra_tests/c_extern.sl
Normal file
@@ -0,0 +1,23 @@
|
||||
import stdlib.sl
|
||||
import float.sl
|
||||
|
||||
# C-style externs (auto ABI handling)
|
||||
extern long labs(long n)
|
||||
extern void exit(int status)
|
||||
extern double atan2(double y, double x)
|
||||
|
||||
word main
|
||||
# Test C-style extern with implicit ABI handling
|
||||
-10 labs puti cr
|
||||
|
||||
1.5 2.5 f+ # 4.0
|
||||
fputln
|
||||
|
||||
# External math library (libm)
|
||||
10.0 10.0 atan2 # Result is pi/4
|
||||
4.0 f* # Approx pi
|
||||
fputln
|
||||
|
||||
# Test extern void
|
||||
0 exit
|
||||
end
|
||||
2
extra_tests/ct_test.compile.expected
Normal file
2
extra_tests/ct_test.compile.expected
Normal file
@@ -0,0 +1,2 @@
|
||||
hello world
|
||||
[info] built /home/igor/programming/IgorCielniak/l2/build/ct_test
|
||||
1
extra_tests/ct_test.expected
Normal file
1
extra_tests/ct_test.expected
Normal file
@@ -0,0 +1 @@
|
||||
hello world
|
||||
4
extra_tests/ct_test.meta.json
Normal file
4
extra_tests/ct_test.meta.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"description": "compile-time hello world demo",
|
||||
"requires": ["keystone"]
|
||||
}
|
||||
7
extra_tests/ct_test.sl
Normal file
7
extra_tests/ct_test.sl
Normal file
@@ -0,0 +1,7 @@
|
||||
import stdlib/stdlib.sl
|
||||
import stdlib/io.sl
|
||||
|
||||
word main
|
||||
"hello world" puts
|
||||
end
|
||||
compile-time main
|
||||
3
extra_tests/fn_test.expected
Normal file
3
extra_tests/fn_test.expected
Normal file
@@ -0,0 +1,3 @@
|
||||
1
|
||||
5
|
||||
3
|
||||
4
extra_tests/fn_test.meta.json
Normal file
4
extra_tests/fn_test.meta.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"description": "fn DSL lowering smoke test",
|
||||
"requires": ["keystone"]
|
||||
}
|
||||
21
extra_tests/fn_test.sl
Normal file
21
extra_tests/fn_test.sl
Normal file
@@ -0,0 +1,21 @@
|
||||
import stdlib/stdlib.sl
|
||||
import stdlib/io.sl
|
||||
import libs/fn.sl
|
||||
|
||||
fn foo(int a, int b){
|
||||
1
|
||||
puti cr
|
||||
return a b +;
|
||||
}
|
||||
|
||||
fn bar(int a, int b){
|
||||
return a + b;
|
||||
}
|
||||
|
||||
word main
|
||||
extend-syntax
|
||||
foo(3, 2)
|
||||
puti cr
|
||||
bar(1, 2)
|
||||
puti cr
|
||||
end
|
||||
4
extra_tests/nob_test.meta.json
Normal file
4
extra_tests/nob_test.meta.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"description": "shell wrapper demo; compile-only to avoid nondeterministic ls output",
|
||||
"compile_only": true
|
||||
}
|
||||
5
extra_tests/nob_test.sl
Normal file
5
extra_tests/nob_test.sl
Normal file
@@ -0,0 +1,5 @@
|
||||
import libs/nob.sl
|
||||
|
||||
word main
|
||||
"ls" sh
|
||||
end
|
||||
Reference in New Issue
Block a user