mirror of
https://github.com/ProgramSnail/Lama.git
synced 2025-12-05 22:38:44 +00:00
Moved x86only tests into stdlib/regression
This commit is contained in:
parent
e4b34a3ec1
commit
eeab48ed33
39 changed files with 10 additions and 59 deletions
|
|
@ -16,4 +16,3 @@ clean:
|
|||
$(RM) test*.log *.s *~ $(TESTS) *.i
|
||||
$(MAKE) clean -C expressions
|
||||
$(MAKE) clean -C deep-expressions
|
||||
$(MAKE) clean -C x86only
|
||||
|
|
|
|||
|
|
@ -1,5 +0,0 @@
|
|||
public fun from_test005 (s) {
|
||||
printf ("called with %s\n", s)
|
||||
}
|
||||
|
||||
printf ("Init Lib01...\n")
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
import Lib01;
|
||||
|
||||
printf ("Init Lib02...\n")
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
import Lib01;
|
||||
import Lib02;
|
||||
|
||||
printf ("Init Lib03...\n")
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
TESTS=$(sort $(basename $(wildcard test*.lama)))
|
||||
LIBS=$(patsubst %.lama,%.o, $(sort $(wildcard Lib*.lama)))
|
||||
|
||||
LAMAC=../../src/lamac
|
||||
|
||||
.PHONY: check $(TESTS)
|
||||
|
||||
check: $(TESTS)
|
||||
|
||||
%.o: %.lama
|
||||
LAMA=../../runtime $(LAMAC) -c -I . $<
|
||||
|
||||
$(TESTS): %: %.lama $(LIBS)
|
||||
LAMA=../../runtime $(LAMAC) -I . $< && cat $@.input | ./$@ > $@.log && diff -u $@.log orig/$@.log
|
||||
|
||||
clean:
|
||||
rm -f test*.log *.i *.o *.s *~ $(TESTS)
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
Empty
|
||||
Node (0, Empty, Empty)
|
||||
Node (0, Empty, Node (1, Empty, Empty))
|
||||
Node (0, Empty, Node (1, Empty, Node (2, Empty, Empty)))
|
||||
Node (0, Empty, Node (1, Empty, Node (2, Empty, Node (3, Empty, Empty))))
|
||||
Node (0, Empty, Node (1, Empty, Node (2, Empty, Node (3, Empty, Node (4, Empty, Empty)))))
|
||||
Node (0, Empty, Node (1, Empty, Node (2, Empty, Node (3, Empty, Node (4, Empty, Node (5, Empty, Empty))))))
|
||||
Node (0, Empty, Node (1, Empty, Node (2, Empty, Node (3, Empty, Node (4, Empty, Node (5, Empty, Node (6, Empty, Empty)))))))
|
||||
Node (0, Empty, Node (1, Empty, Node (2, Empty, Node (3, Empty, Node (4, Empty, Node (5, Empty, Node (6, Empty, Node (7, Empty, Empty))))))))
|
||||
Node (0, Empty, Node (1, Empty, Node (2, Empty, Node (3, Empty, Node (4, Empty, Node (5, Empty, Node (6, Empty, Node (7, Empty, Node (8, Empty, Empty)))))))))
|
||||
Node (0, Empty, Node (1, Empty, Node (2, Empty, Node (3, Empty, Node (4, Empty, Node (5, Empty, Node (6, Empty, Node (7, Empty, Node (8, Empty, Node (9, Empty, Empty))))))))))
|
||||
Node (0, Empty, Node (1, Empty, Node (2, Empty, Node (3, Empty, Node (4, Empty, Node (5, Empty, Node (6, Empty, Node (7, Empty, Node (8, Empty, Node (9, Empty, Node (10, Empty, Empty)))))))))))
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
2
|
||||
3
|
||||
100
|
||||
Cons (3, Cons (2, Cons (1, Cons (6, Cons (5, Cons (4, Cons (3, Cons (2, Cons (1, Nil)))))))))
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
0
|
||||
{1, 2, 3, 4}
|
||||
{{1}, {2, 3}, {4, {5, 6}}}
|
||||
{1, 2, 3, 4}
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
1
|
||||
{2, 3, 4}
|
||||
2
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
Init Lib01...
|
||||
called with that one
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
3
|
||||
{1}
|
||||
{1}
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
Cloning int: 5
|
||||
Cloning string: abc
|
||||
Cloning array: [1, 2, 3, 4, 5]
|
||||
Cloning sexp: A (1, 2, 3, 4, 5)
|
||||
Cloning closure: address ok, 5, 6
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
Init Lib01...
|
||||
Init Lib02...
|
||||
Init Lib03...
|
||||
main dish.
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
Number of commands-line arguments: 1
|
||||
arg [0 ] = "./test009"
|
||||
|
|
@ -1 +0,0 @@
|
|||
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
fun insert (tree, value) {
|
||||
case tree of
|
||||
Empty -> return Node (value, Empty, Empty)
|
||||
| Node (x, left, right) ->
|
||||
if x > value
|
||||
then return Node (x, insert (left, value), right)
|
||||
else return Node (x, left, insert (right, value))
|
||||
fi
|
||||
esac
|
||||
}
|
||||
|
||||
local i, tree = Empty;
|
||||
|
||||
for i := 0, i <= 10, i := i+1 do
|
||||
printf ("%s\n", tree.string);
|
||||
tree := insert (tree, i)
|
||||
od;
|
||||
|
||||
printf ("%s\n", tree.string)
|
||||
|
|
@ -1 +0,0 @@
|
|||
0
|
||||
|
|
@ -1,65 +0,0 @@
|
|||
fun collect_ints_acc (v, tail) {
|
||||
local i;
|
||||
|
||||
case v of
|
||||
a@#unboxed -> return Cons (a, tail)
|
||||
| #string -> return tail
|
||||
| _ ->
|
||||
for i := 0, i < v.length, i := i + 1 do
|
||||
tail := collect_ints_acc (v[i], tail)
|
||||
od;
|
||||
return tail
|
||||
esac
|
||||
}
|
||||
|
||||
fun collect_ints (v) {
|
||||
return collect_ints_acc (v, Nil)
|
||||
}
|
||||
|
||||
case 1 of
|
||||
5 -> write (5)
|
||||
| 4 -> write (4)
|
||||
| 3 -> write (3)
|
||||
| 2 -> write (2)
|
||||
| 1 -> write (1)
|
||||
| 0 -> write (0)
|
||||
esac;
|
||||
|
||||
case 1 of
|
||||
a@5 -> write (a)
|
||||
| a@4 -> write (a)
|
||||
| a@3 -> write (a)
|
||||
| a@2 -> write (a)
|
||||
| a@1 -> write (a)
|
||||
| a@0 -> write (a)
|
||||
esac;
|
||||
|
||||
case A (1, 2, 3) of
|
||||
A (1, 3, 5) -> write (0)
|
||||
| A (3, 4, 5) -> write (0)
|
||||
| A (1, 2, 3) -> write (1)
|
||||
| A (6, 7, 8) -> write (0)
|
||||
esac;
|
||||
|
||||
case "abc" of
|
||||
"def" -> write (0)
|
||||
| "ab" -> write (0)
|
||||
| "abc" -> write (1)
|
||||
| "" -> write (0)
|
||||
esac;
|
||||
|
||||
case [1, 2, 3] of
|
||||
[] -> write (0)
|
||||
| [a, b] -> write (0)
|
||||
| [a, b, c] -> write (a); write (b); write (c)
|
||||
| [_, _, _] -> write (0)
|
||||
esac;
|
||||
|
||||
case [1, 2, 3] of
|
||||
[] -> write (0)
|
||||
| [a, b] -> write (0)
|
||||
| [_, _, _] -> write (100)
|
||||
| [a, b, c] -> write (a); write (b); write (c)
|
||||
esac;
|
||||
|
||||
printf ("%s\n", collect_ints ([1, 2, 3, [4, 5, 6, Cons (1, 2, 3)]]).string)
|
||||
|
|
@ -1 +0,0 @@
|
|||
0
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
local lists = [
|
||||
{},
|
||||
{1, 2, 3, 4},
|
||||
{1 : {}, {2, 3}, {4, {5, 6}}},
|
||||
1 : 2 : 3 : 4 : {}
|
||||
], i;
|
||||
|
||||
for i := 0, i<lists.length, i:=i+1 do
|
||||
printf ("%s\n", lists[i].string)
|
||||
od
|
||||
|
|
@ -1 +0,0 @@
|
|||
0
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
fun hd (l) {
|
||||
case l of
|
||||
h : _ -> return h
|
||||
esac
|
||||
}
|
||||
|
||||
fun tl (l) {
|
||||
case l of
|
||||
_ : t -> return t
|
||||
esac
|
||||
}
|
||||
|
||||
printf ("%s\n", {1, 2, 3}.hd.string);
|
||||
printf ("%s\n", {1, 2, 3, 4}.tl.string);
|
||||
printf ("%s\n", {1, {2, 3, 4}, 5, 6}.tl.hd.hd.string)
|
||||
|
|
@ -1 +0,0 @@
|
|||
0
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
import Lib01;
|
||||
|
||||
from_test005 ("that one")
|
||||
|
|
@ -1 +0,0 @@
|
|||
0
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
printf ("%d\n", infix + (1, 2));
|
||||
printf ("%s\n", (1 : 2).string);
|
||||
printf ("%s\n", (infix : (1, 2)).string)
|
||||
|
|
@ -1 +0,0 @@
|
|||
0
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
fun f (x, y) {
|
||||
fun () {x+y}
|
||||
}
|
||||
|
||||
printf ("Cloning int: %d\n", clone (5));
|
||||
printf ("Cloning string: %s\n", clone ("abc"));
|
||||
printf ("Cloning array: %s\n", clone ([1, 2, 3, 4, 5]).string);
|
||||
printf ("Cloning sexp: %s\n", clone (A (1, 2, 3, 4, 5)).string);
|
||||
|
||||
{
|
||||
local c = f (5, 6), cc = clone (c);
|
||||
|
||||
printf ("Cloning closure: address %s, %d, %d\n", if cc[0] == c[0] then "ok" else "fail" fi, c[1], c[2])
|
||||
}
|
||||
|
|
@ -1 +0,0 @@
|
|||
0
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
import Lib03;
|
||||
import Lib02;
|
||||
|
||||
printf ("main dish.\n")
|
||||
|
|
@ -1 +0,0 @@
|
|||
0
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
local i;
|
||||
|
||||
printf ("Number of commands-line arguments: %d\n", sysargs.length);
|
||||
|
||||
for i := 0, i < sysargs.length, i := i + 1 do
|
||||
printf (" arg [%-2d] = %s\n", i, sysargs[i].string)
|
||||
od
|
||||
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue