mirror of
https://github.com/ProgramSnail/Lama.git
synced 2025-12-05 22:38:44 +00:00
Prototype of X86_64 migration
This commit is contained in:
parent
3fdc3e7f2a
commit
e77433e51c
21 changed files with 599 additions and 7165 deletions
0
regression/new_test001.input
Normal file
0
regression/new_test001.input
Normal file
10
regression/new_test001.lama
Normal file
10
regression/new_test001.lama
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
fun f (a, b, c, d, e) {
|
||||
var i = d / b;
|
||||
write (a);
|
||||
write (b);
|
||||
write (c);
|
||||
write (d);
|
||||
write (e)
|
||||
}
|
||||
|
||||
f (1, 2, 3, 4, 5)
|
||||
0
regression/new_test002.input
Normal file
0
regression/new_test002.input
Normal file
15
regression/new_test002.lama
Normal file
15
regression/new_test002.lama
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
fun f (a, b, c, d, e, f, g, h) {
|
||||
var i = 9, j = 10;
|
||||
write (a);
|
||||
write (b);
|
||||
write (c);
|
||||
write (d);
|
||||
write (e);
|
||||
write (f);
|
||||
write (g);
|
||||
write (h);
|
||||
write (i);
|
||||
write (j)
|
||||
}
|
||||
|
||||
f (1, 2, 3, 4, 5, 6, 7, 8)
|
||||
0
regression/new_test003.input
Normal file
0
regression/new_test003.input
Normal file
18
regression/new_test003.lama
Normal file
18
regression/new_test003.lama
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
fun f (a, b, c, d, e, f, g, h) {
|
||||
fun g (unit) {
|
||||
var tmp1 = 1 + (1 + (1 + (1 + (1 + 1 + (1 + (1 + (1 + (1 + 1 + (1 + (1 + (1 + (1 + 1))))))))))));
|
||||
var tmp2 = (((((((((((((1 + 1) + 1) + 1) + 1) + 1) + 1) + 1) + 1) + 1) + 1) + 1) + 1) + 1) + 1;
|
||||
write (a);
|
||||
write (b);
|
||||
write (c);
|
||||
write (d);
|
||||
write (e);
|
||||
write (f);
|
||||
write (g);
|
||||
write (h)
|
||||
}
|
||||
|
||||
g
|
||||
}
|
||||
|
||||
f (1, 2, 3, 4, 5, 6, 7, 8)(0)
|
||||
5
regression/orig/new_test001.log
Normal file
5
regression/orig/new_test001.log
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
5
|
||||
10
regression/orig/new_test002.log
Normal file
10
regression/orig/new_test002.log
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
5
|
||||
6
|
||||
7
|
||||
8
|
||||
9
|
||||
10
|
||||
10
regression/orig/new_test003.log
Normal file
10
regression/orig/new_test003.log
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
5
|
||||
6
|
||||
7
|
||||
8
|
||||
9
|
||||
10
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
> 0
|
||||
0
|
||||
15
|
||||
15
|
||||
1
|
||||
|
|
|
|||
BIN
regression/t
BIN
regression/t
Binary file not shown.
|
|
@ -1,14 +0,0 @@
|
|||
fun f (a,b,c,d,e,f,g,h,i,j) {
|
||||
write(a);
|
||||
write(b);
|
||||
write(c);
|
||||
write(d);
|
||||
write(e);
|
||||
write(f);
|
||||
write(g);
|
||||
write(h);
|
||||
write(i);
|
||||
write(j)
|
||||
}
|
||||
|
||||
f (1,2,3,4,5,6,7,8,9,10)
|
||||
|
|
@ -10,8 +10,6 @@ fun fact (n) {
|
|||
|
||||
n := read ();
|
||||
|
||||
fun f () {}
|
||||
|
||||
for i := n, i >= 1, i := i-1 do
|
||||
write (i);
|
||||
write (fact (i))
|
||||
|
|
|
|||
|
|
@ -9,14 +9,14 @@ fun sort (x) {
|
|||
for i := 0, i<n, i := i+1 do
|
||||
for j := i+1, j<n, j := j+1 do
|
||||
if x[j] < x[i] then
|
||||
y := x[i];
|
||||
x[i] := x[j];
|
||||
x[j] := y
|
||||
y := x[i];
|
||||
x[i] := x[j];
|
||||
x[j] := y
|
||||
fi
|
||||
od
|
||||
od;
|
||||
|
||||
x
|
||||
x
|
||||
}
|
||||
|
||||
n := read ();
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
var n;
|
||||
|
||||
fun sum (l) {
|
||||
case l of
|
||||
{} -> 0
|
||||
|
|
@ -23,9 +21,7 @@ fun array_to_list (a) {
|
|||
l
|
||||
}
|
||||
|
||||
n := read ();
|
||||
write (sum ({}));
|
||||
write (sum ({1, 2, 3, 4, 5}));
|
||||
write (sum (1:2:3:4:5:{}));
|
||||
print_list (array_to_list ([1, 2, 3, 4, 5]))
|
||||
|
||||
|
|
|
|||
|
|
@ -1,19 +0,0 @@
|
|||
#!/bin/bash
|
||||
for i in {1..9}
|
||||
do
|
||||
make test00$i
|
||||
done
|
||||
|
||||
for i in {0..9}
|
||||
do
|
||||
make test01$i
|
||||
done
|
||||
|
||||
for i in {0..9}
|
||||
do
|
||||
make test02$i
|
||||
done
|
||||
|
||||
make test034
|
||||
make test036
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue