Merge branch '1.30' into byterun_dev_1.30

This commit is contained in:
ProgramSnail 2025-03-16 11:23:26 +03:00
commit 67d1a3c135
131 changed files with 905 additions and 364 deletions

View file

@ -10,6 +10,8 @@ on:
- "more-dune" - "more-dune"
permissions: read-all permissions: read-all
env:
OPAMCONFIRMLEVEL: unsafe-yes
jobs: jobs:
build: build:
@ -19,6 +21,8 @@ jobs:
os: os:
- ubuntu-latest - ubuntu-latest
- macos-latest - macos-latest
# intel macos
- macos-13
ocaml-compiler: ocaml-compiler:
- 4.14.2 - 4.14.2
@ -33,9 +37,51 @@ jobs:
with: with:
ocaml-compiler: ${{ matrix.ocaml-compiler }} ocaml-compiler: ${{ matrix.ocaml-compiler }}
- run: gcc --version
- name: Prepare to install cross-compiler (Ubuntu specific)
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
sudo dpkg --add-architecture i386
sudo apt update -y
- run: opam pin add Lama.dev . --no-action - run: opam pin add Lama.dev . --no-action
- run: opam depext Lama.dev --yes --with-test - run: opam depext Lama.dev --yes --with-test
- run: opam install . --deps-only --with-test - run: opam install . --deps-only --with-test
- run: eval $(opam env) - run: eval $(opam env)
- run: opam exec -- make install
- run: opam exec -- make regression - run: rm -fr runtime32
if: ${{ matrix.os == 'macos-latest' || matrix.os == 'macos-13' }}
- run: opam exec -- dune b src runtime runtime32 stdlib tutorial
if: ${{ matrix.os != 'macos-latest' && matrix.os != 'macos-13'}}
- run: opam exec -- dune b src runtime stdlib tutorial
if: ${{ matrix.os == 'macos-latest' || matrix.os == 'macos-13' }}
- run: opam exec -- dune b @install --profile=release
- run: opam exec -- dune install --profile=release
- run: opam exec -- dune test stdlib/regression
- run: opam exec -- dune test regression_long
- run: opam exec -- dune test regression
- run: opam exec -- make regression-all
# fails on mac
# - run: opam exec -- dune b
# - run: opam exec -- dune install --profile=release
# - run: opam exec -- dune test stdlib/regression
# - run: opam exec -- dune test regression
# - run: opam exec -- dune test regression_long
# works
# - run: rm -fr runtime32
# if: ${{ matrix.os == 'macos-latest' }}
# - run: opam exec -- dune b src runtime stdlib tutorial
# if: ${{ matrix.os == 'macos-latest' }}
# - run: opam exec -- make install
# if: ${{ matrix.os != 'macos-latest' }}
# - run: opam exec -- make regression-all
# - run: opam exec -- dune test stdlib/regression -j1
# - run: opam exec -- dune b
# - run: opam exec -- dune b @install
# - run: opam exec -- dune install
# - run: opam exec -- make regression
# - run: opam exec -- dune test regression

38
.github/workflows/docker.yml vendored Normal file
View file

@ -0,0 +1,38 @@
name: Build in docker
on:
push:
branches:
- '1.30'
- 'i686-cross'
env:
OPAMROOT: /home/user/.opam
OPAMCONFIRMLEVEL: unsafe-yes
jobs:
build:
runs-on: ubuntu-24.04
container:
image: kakadu18/ocaml:lama
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
steps:
- run: opam --version
- run: whoami
- run: opam exec -- ocamlopt --version
- name: Checkout code
uses: actions/checkout@v4
- run: |
opam install . --depext-only --with-test --with-doc
opam install . --deps-only --with-test --with-doc
- name: List installed packages
run: opam list
- run: opam exec -- dune build --profile=release
- run: opam exec -- dune test regression/ stdlib/regression

View file

@ -28,3 +28,4 @@ build: [
"@doc" {with-doc} "@doc" {with-doc}
] ]
] ]
depexts: [ [ "gcc-14-multilib" ] {os-distribution = "ubuntu"} ]

1
Lama.opam.template Normal file
View file

@ -0,0 +1 @@
depexts: [ [ "gcc-14-multilib" ] {os-distribution = "ubuntu"} ]

View file

@ -34,3 +34,4 @@
(promote (until-clean))) (promote (until-clean)))
(action (action
(run gcc -Wall -Wextra -O3 -Iinclude/ -DWITH_CHECK -c %{src} -o %{target}))) (run gcc -Wall -Wextra -O3 -Iinclude/ -DWITH_CHECK -c %{src} -o %{target})))

Binary file not shown.

View file

@ -1,8 +1,9 @@
(rule (rule
(targets Sort.x64.exe) (targets Sort.exe)
(deps (deps
(:lama Sort.lama) (:lama Sort.lama)
../runtime/runtime.a) ../runtime/runtime.a
../stdlib/x64/Fun.i)
(mode (mode
(promote (until-clean))) (promote (until-clean)))
(action (action
@ -11,11 +12,11 @@
"../runtime" "../runtime"
(run (run
%{project_root}/src/Driver.exe %{project_root}/src/Driver.exe
-march=x86_64 -64
%{lama} %{lama}
-I -I
../stdlib/x64 ../stdlib/x64
-I -runtime
../runtime ../runtime
-o -o
%{targets})))) %{targets}))))

View file

@ -21,7 +21,7 @@ let () =
let found = let found =
if Sys.file_exists !lama_file then ( if Sys.file_exists !lama_file then (
cram_printfn cram_printfn
" $ ../src/Driver.exe -i test%03d.lama < \ " $ ../src/Driver.exe -runtime ../runtime -I ../stdlib/x64 -i test%03d.lama < \
test%03d.input" test%03d.input"
i i; i i;
true) true)

View file

@ -1,3 +1,2 @@
$ ../src/Driver.exe -i test001.lama < test001.input $ ../src/Driver.exe -runtime ../runtime -I ../stdlib/x64 -i test001.lama < test001.input
Error: could not find an interface file for import "Std" > > 90
[255]

View file

@ -1,3 +1,2 @@
$ ../src/Driver.exe -i test002.lama < test002.input $ ../src/Driver.exe -runtime ../runtime -I ../stdlib/x64 -i test002.lama < test002.input
Error: could not find an interface file for import "Std" > > 41
[255]

View file

@ -1,3 +1,4 @@
$ ../src/Driver.exe -i test003.lama < test003.input $ ../src/Driver.exe -runtime ../runtime -I ../stdlib/x64 -i test003.lama < test003.input
Error: could not find an interface file for import "Std" > > 7
[255] 3
1

View file

@ -1,3 +1,2 @@
$ ../src/Driver.exe -i test004.lama < test004.input $ ../src/Driver.exe -runtime ../runtime -I ../stdlib/x64 -i test004.lama < test004.input
Error: could not find an interface file for import "Std" > > 10
[255]

View file

@ -1,3 +1,2 @@
$ ../src/Driver.exe -i test005.lama < test005.input $ ../src/Driver.exe -runtime ../runtime -I ../stdlib/x64 -i test005.lama < test005.input
Error: could not find an interface file for import "Std" > > 11
[255]

View file

@ -1,3 +1,7 @@
$ ../src/Driver.exe -i test006.lama < test006.input $ ../src/Driver.exe -runtime ../runtime -I ../stdlib/x64 -i test006.lama < test006.input
Error: could not find an interface file for import "Std" > > 1
[255] 1
0
1
0
0

View file

@ -1,3 +1,2 @@
$ ../src/Driver.exe -i test007.lama < test007.input $ ../src/Driver.exe -runtime ../runtime -I ../stdlib/x64 -i test007.lama < test007.input
Error: could not find an interface file for import "Std" -4
[255]

View file

@ -1,3 +1,2 @@
$ ../src/Driver.exe -i test008.lama < test008.input $ ../src/Driver.exe -runtime ../runtime -I ../stdlib/x64 -i test008.lama < test008.input
Error: could not find an interface file for import "Std" -45
[255]

View file

@ -1,3 +1,2 @@
$ ../src/Driver.exe -i test009.lama < test009.input $ ../src/Driver.exe -runtime ../runtime -I ../stdlib/x64 -i test009.lama < test009.input
Error: could not find an interface file for import "Std" 1024
[255]

View file

@ -1,3 +1,2 @@
$ ../src/Driver.exe -i test010.lama < test010.input $ ../src/Driver.exe -runtime ../runtime -I ../stdlib/x64 -i test010.lama < test010.input
Error: could not find an interface file for import "Std" 499950
[255]

View file

@ -1,3 +1,2 @@
$ ../src/Driver.exe -i test011.lama < test011.input $ ../src/Driver.exe -runtime ../runtime -I ../stdlib/x64 -i test011.lama < test011.input
Error: could not find an interface file for import "Std" 2
[255]

View file

@ -1,3 +1,9 @@
$ ../src/Driver.exe -i test012.lama < test012.input $ ../src/Driver.exe -runtime ../runtime -I ../stdlib/x64 -i test012.lama < test012.input
Error: could not find an interface file for import "Std" > 0
[255] 0
0
1
1
0
1
1

View file

@ -1,3 +1,9 @@
$ ../src/Driver.exe -i test013.lama < test013.input $ ../src/Driver.exe -runtime ../runtime -I ../stdlib/x64 -i test013.lama < test013.input
Error: could not find an interface file for import "Std" > 10
[255] 11
10
11
3
2
1
0

View file

@ -1,3 +1,32 @@
$ ../src/Driver.exe -i test014.lama < test014.input $ ../src/Driver.exe -runtime ../runtime -I ../stdlib/x64 -i test014.lama < test014.input
Error: could not find an interface file for import "Std" > 1
[255] 1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1

View file

@ -1,3 +1,2 @@
$ ../src/Driver.exe -i test015.lama < test015.input $ ../src/Driver.exe -runtime ../runtime -I ../stdlib/x64 -i test015.lama < test015.input
Error: could not find an interface file for import "Std" > 7919
[255]

View file

@ -1,3 +1,2 @@
$ ../src/Driver.exe -i test016.lama < test016.input $ ../src/Driver.exe -runtime ../runtime -I ../stdlib/x64 -i test016.lama < test016.input
Error: could not find an interface file for import "Std" > 3628800
[255]

View file

@ -1,3 +1,2 @@
$ ../src/Driver.exe -i test017.lama < test017.input $ ../src/Driver.exe -runtime ../runtime -I ../stdlib/x64 -i test017.lama < test017.input
Error: could not find an interface file for import "Std" > 6765
[255]

View file

@ -1,3 +1,15 @@
$ ../src/Driver.exe -i test018.lama < test018.input $ ../src/Driver.exe -runtime ../runtime -I ../stdlib/x64 -i test018.lama < test018.input
Error: could not find an interface file for import "Std" > 2
[255] 0
3
4
5
0
7
0
11
0
13
0
17
2

View file

@ -1,3 +1,2 @@
$ ../src/Driver.exe -i test019.lama < test019.input $ ../src/Driver.exe -runtime ../runtime -I ../stdlib/x64 -i test019.lama < test019.input
Error: could not find an interface file for import "Std" 499950
[255]

View file

@ -1,3 +1,2 @@
$ ../src/Driver.exe -i test020.lama < test020.input $ ../src/Driver.exe -runtime ../runtime -I ../stdlib/x64 -i test020.lama < test020.input
Error: could not find an interface file for import "Std" > 7919
[255]

View file

@ -1,3 +1,2 @@
$ ../src/Driver.exe -i test021.lama < test021.input $ ../src/Driver.exe -runtime ../runtime -I ../stdlib/x64 -i test021.lama < test021.input
Error: could not find an interface file for import "Std" > 3628800
[255]

View file

@ -1,3 +1,2 @@
$ ../src/Driver.exe -i test022.lama < test022.input $ ../src/Driver.exe -runtime ../runtime -I ../stdlib/x64 -i test022.lama < test022.input
Error: could not find an interface file for import "Std" > 6765
[255]

View file

@ -1,3 +1,2 @@
$ ../src/Driver.exe -i test023.lama < test023.input $ ../src/Driver.exe -runtime ../runtime -I ../stdlib/x64 -i test023.lama < test023.input
Error: could not find an interface file for import "Std" > > > > > > 35
[255]

View file

@ -1,3 +1,3 @@
$ ../src/Driver.exe -i test024.lama < test024.input $ ../src/Driver.exe -runtime ../runtime -I ../stdlib/x64 -i test024.lama < test024.input
Error: could not find an interface file for import "Std" > 3
[255] 8

View file

@ -1,3 +1,13 @@
$ ../src/Driver.exe -i test025.lama < test025.input $ ../src/Driver.exe -runtime ../runtime -I ../stdlib/x64 -i test025.lama < test025.input
Error: could not find an interface file for import "Std" > 1
[255] 100
200
300
2
100
200
300
3
100
200
300

View file

@ -1,3 +1,22 @@
$ ../src/Driver.exe -i test026.lama < test026.input $ ../src/Driver.exe -runtime ../runtime -I ../stdlib/x64 -i test026.lama < test026.input
Error: could not find an interface file for import "Std" > 1
[255] 100
200
300
100
200
300
2
100
200
300
100
200
300
3
100
200
300
100
200
300

View file

@ -1,3 +1,36 @@
$ ../src/Driver.exe -i test027.lama < test027.input $ ../src/Driver.exe -runtime ../runtime -I ../stdlib/x64 -i test027.lama < test027.input
Error: could not find an interface file for import "Std" > 1
[255] 100
200
300
1
2
100
200
300
3
100
200
300
3
4
100
200
300
5
100
200
300
5
100
200
300
100
200
300
100
200
300
100
200
300

View file

@ -1,3 +1,15 @@
$ ../src/Driver.exe -i test028.lama < test028.input $ ../src/Driver.exe -runtime ../runtime -I ../stdlib/x64 -i test028.lama < test028.input
Error: could not find an interface file for import "Std" > 7
[255] 5040
6
720
5
120
4
24
3
6
2
2
1
1

View file

@ -1,3 +1,19 @@
$ ../src/Driver.exe -i test029.lama < test029.input $ ../src/Driver.exe -runtime ../runtime -I ../stdlib/x64 -i test029.lama < test029.input
Error: could not find an interface file for import "Std" > 9
[255] 55
8
34
7
21
6
13
5
8
4
5
3
3
2
2
1
1

View file

@ -1,3 +1,17 @@
$ ../src/Driver.exe -i test034.lama < test034.input $ ../src/Driver.exe -runtime ../runtime -I ../stdlib/x64 -i test034.lama < test034.input
Error: could not find an interface file for import "Std" > 97
[255] 98
99
100
101
102
103
104
99
100
101
102
103
104
105
106

View file

@ -1,3 +1,17 @@
$ ../src/Driver.exe -i test036.lama < test036.input $ ../src/Driver.exe -runtime ../runtime -I ../stdlib/x64 -i test036.lama < test036.input
Error: could not find an interface file for import "Std" > 97
[255] 98
99
100
101
102
103
104
97
97
97
97
97
97
97
97

View file

@ -1,3 +1,5 @@
$ ../src/Driver.exe -i test040.lama < test040.input $ ../src/Driver.exe -runtime ../runtime -I ../stdlib/x64 -i test040.lama < test040.input
Error: could not find an interface file for import "Std" > 1
[255] 2
3
4

View file

@ -1,3 +1,3 @@
$ ../src/Driver.exe -i test041.lama < test041.input $ ../src/Driver.exe -runtime ../runtime -I ../stdlib/x64 -i test041.lama < test041.input
Error: could not find an interface file for import "Std" > 600
[255] 1800

View file

@ -1,3 +1,11 @@
$ ../src/Driver.exe -i test042.lama < test042.input $ ../src/Driver.exe -runtime ../runtime -I ../stdlib/x64 -i test042.lama < test042.input
Error: could not find an interface file for import "Std" > 0
[255] 1
2
3
4
4
4
4
4
4

View file

@ -1,3 +1,41 @@
$ ../src/Driver.exe -i test045.lama < test045.input $ ../src/Driver.exe -runtime ../runtime -I ../stdlib/x64 -i test045.lama < test045.input
Error: could not find an interface file for import "Std" > 49
[255] 34
97
98
99
34
91
93
91
49
44
32
50
44
32
51
93
67
111
110
115
32
40
49
44
32
67
111
110
115
32
40
50
44
32
78
105
108
41
41

View file

@ -1,3 +1,14 @@
$ ../src/Driver.exe -i test046.lama < test046.input $ ../src/Driver.exe -runtime ../runtime -I ../stdlib/x64 -i test046.lama < test046.input
Error: could not find an interface file for import "Std" > 3
[255] 3
3
1
2
3
5
5
1
2
3
4
5

View file

@ -1,3 +1,2 @@
$ ../src/Driver.exe -i test050.lama < test050.input $ ../src/Driver.exe -runtime ../runtime -I ../stdlib/x64 -i test050.lama < test050.input
Error: could not find an interface file for import "Std" > 2
[255]

View file

@ -1,3 +1,14 @@
$ ../src/Driver.exe -i test054.lama < test054.input $ ../src/Driver.exe -runtime ../runtime -I ../stdlib/x64 -i test054.lama < test054.input
Error: could not find an interface file for import "Std" > 105
[255] 105
105
230
105
105
105
230
105
250
1
2
3

View file

@ -1,3 +1,4 @@
$ ../src/Driver.exe -i test059.lama < test059.input $ ../src/Driver.exe -runtime ../runtime -I ../stdlib/x64 -i test059.lama < test059.input
Error: could not find an interface file for import "Std" > 0
[255] 1
2

View file

@ -1,3 +1,3 @@
$ ../src/Driver.exe -i test063.lama < test063.input $ ../src/Driver.exe -runtime ../runtime -I ../stdlib/x64 -i test063.lama < test063.input
Error: could not find an interface file for import "Std" > 100
[255] 200

View file

@ -1,3 +1,19 @@
$ ../src/Driver.exe -i test072.lama < test072.input $ ../src/Driver.exe -runtime ../runtime -I ../stdlib/x64 -i test072.lama < test072.input
Error: could not find an interface file for import "Std" > 9
[255] 55
8
34
7
21
6
13
5
8
4
5
3
3
2
2
1
1

View file

@ -1,3 +1,15 @@
$ ../src/Driver.exe -i test073.lama < test073.input $ ../src/Driver.exe -runtime ../runtime -I ../stdlib/x64 -i test073.lama < test073.input
Error: could not find an interface file for import "Std" > 7
[255] 5040
6
720
5
120
4
24
3
6
2
2
1
1

View file

@ -1,3 +1,37 @@
$ ../src/Driver.exe -i test074.lama < test074.input $ ../src/Driver.exe -runtime ../runtime -I ../stdlib/x64 -i test074.lama < test074.input
Error: could not find an interface file for import "Std" > 1
[255] 2
3
4
5
6
7
8
9
2
3
4
5
6
7
8
9
10
3
5
7
9
11
13
15
17
19
5
13
29
61
125
253
509
1021
2045

View file

@ -1,3 +1,7 @@
$ ../src/Driver.exe -i test077.lama < test077.input $ ../src/Driver.exe -runtime ../runtime -I ../stdlib/x64 -i test077.lama < test077.input
Error: could not find an interface file for import "Std" > 5
[255] 6
7
8
9
10

View file

@ -1,3 +1,13 @@
$ ../src/Driver.exe -i test078.lama < test078.input $ ../src/Driver.exe -runtime ../runtime -I ../stdlib/x64 -i test078.lama < test078.input
Error: could not find an interface file for import "Std" > 1
[255] 2
3
4
1
2
3
4
3
4
1
2

View file

@ -1,3 +1,7 @@
$ ../src/Driver.exe -i test079.lama < test079.input $ ../src/Driver.exe -runtime ../runtime -I ../stdlib/x64 -i test079.lama < test079.input
Error: could not find an interface file for import "Std" > 1
[255] 1
1
1
0
0

View file

@ -1,3 +1,4 @@
$ ../src/Driver.exe -i test080.lama < test080.input $ ../src/Driver.exe -runtime ../runtime -I ../stdlib/x64 -i test080.lama < test080.input
Error: could not find an interface file for import "Std" > 0
[255] 100
300

View file

@ -1,3 +1,7 @@
$ ../src/Driver.exe -i test081.lama < test081.input $ ../src/Driver.exe -runtime ../runtime -I ../stdlib/x64 -i test081.lama < test081.input
Error: could not find an interface file for import "Std" > 1
[255] 2
3
100
200
300

View file

@ -1,3 +1,18 @@
$ ../src/Driver.exe -i test082.lama < test082.input $ ../src/Driver.exe -runtime ../runtime -I ../stdlib/x64 -i test082.lama < test082.input
Error: could not find an interface file for import "Std" > 1
[255] 1
1
1
1
2
3
100
3
2
1
6
5
4
3
2
1

View file

@ -1,3 +1,4 @@
$ ../src/Driver.exe -i test083.lama < test083.input $ ../src/Driver.exe -runtime ../runtime -I ../stdlib/x64 -i test083.lama < test083.input
Error: could not find an interface file for import "Std" > 7
[255] 7
28

View file

@ -1,3 +1,4 @@
$ ../src/Driver.exe -i test084.lama < test084.input $ ../src/Driver.exe -runtime ../runtime -I ../stdlib/x64 -i test084.lama < test084.input
Error: could not find an interface file for import "Std" > 55
[255] 310
310

View file

@ -1,3 +1,9 @@
$ ../src/Driver.exe -i test085.lama < test085.input $ ../src/Driver.exe -runtime ../runtime -I ../stdlib/x64 -i test085.lama < test085.input
Error: could not find an interface file for import "Std" > 0
[255] 15
15
1
2
3
4
5

View file

@ -1,3 +1,4 @@
$ ../src/Driver.exe -i test086.lama < test086.input $ ../src/Driver.exe -runtime ../runtime -I ../stdlib/x64 -i test086.lama < test086.input
Error: could not find an interface file for import "Std" > 1
[255] 2
3

View file

@ -1,3 +1,3 @@
$ ../src/Driver.exe -i test088.lama < test088.input $ ../src/Driver.exe -runtime ../runtime -I ../stdlib/x64 -i test088.lama < test088.input
Error: could not find an interface file for import "Std" 0
[255] 3

View file

@ -1,3 +1,2 @@
$ ../src/Driver.exe -i test089.lama < test089.input $ ../src/Driver.exe -runtime ../runtime -I ../stdlib/x64 -i test089.lama < test089.input
Error: could not find an interface file for import "Std" > > > 8
[255]

View file

@ -1,3 +1,4 @@
$ ../src/Driver.exe -i test090.lama < test090.input $ ../src/Driver.exe -runtime ../runtime -I ../stdlib/x64 -i test090.lama < test090.input
Error: could not find an interface file for import "Std" > 6
[255] 7
8

View file

@ -1,3 +1,10 @@
$ ../src/Driver.exe -i test091.lama < test091.input $ ../src/Driver.exe -runtime ../runtime -I ../stdlib/x64 -i test091.lama < test091.input
Error: could not find an interface file for import "Std" > 1
[255] 2
3
2
3
4
3
4
5

View file

@ -1,3 +1,6 @@
$ ../src/Driver.exe -i test092.lama < test092.input $ ../src/Driver.exe -runtime ../runtime -I ../stdlib/x64 -i test092.lama < test092.input
Error: could not find an interface file for import "Std" > 1
[255] 1
1
1
0

View file

@ -1,3 +1,3 @@
$ ../src/Driver.exe -i test093.lama < test093.input $ ../src/Driver.exe -runtime ../runtime -I ../stdlib/x64 -i test093.lama < test093.input
Error: could not find an interface file for import "Std" > 11
[255] 18

View file

@ -1,3 +1,5 @@
$ ../src/Driver.exe -i test094.lama < test094.input $ ../src/Driver.exe -runtime ../runtime -I ../stdlib/x64 -i test094.lama < test094.input
Error: could not find an interface file for import "Std" > 5
[255] 7
12
-2

View file

@ -1,3 +1,2 @@
$ ../src/Driver.exe -i test095.lama < test095.input $ ../src/Driver.exe -runtime ../runtime -I ../stdlib/x64 -i test095.lama < test095.input
Error: could not find an interface file for import "Std" > 5
[255]

View file

@ -1,3 +1,3 @@
$ ../src/Driver.exe -i test096.lama < test096.input $ ../src/Driver.exe -runtime ../runtime -I ../stdlib/x64 -i test096.lama < test096.input
Error: could not find an interface file for import "Std" > 2
[255] 1

View file

@ -1,3 +1,2 @@
$ ../src/Driver.exe -i test097.lama < test097.input $ ../src/Driver.exe -runtime ../runtime -I ../stdlib/x64 -i test097.lama < test097.input
Error: could not find an interface file for import "Std" > 35
[255]

View file

@ -1,3 +1,2 @@
$ ../src/Driver.exe -i test098.lama < test098.input $ ../src/Driver.exe -runtime ../runtime -I ../stdlib/x64 -i test098.lama < test098.input
Error: could not find an interface file for import "Std" > 12
[255]

View file

@ -1,3 +1,4 @@
$ ../src/Driver.exe -i test099.lama < test099.input $ ../src/Driver.exe -runtime ../runtime -I ../stdlib/x64 -i test099.lama < test099.input
Error: could not find an interface file for import "Std" > 1
[255] 800
800

View file

@ -1,3 +1,2 @@
$ ../src/Driver.exe -i test100.lama < test100.input $ ../src/Driver.exe -runtime ../runtime -I ../stdlib/x64 -i test100.lama < test100.input
Error: could not find an interface file for import "Std" > 0
[255]

View file

@ -1,3 +1,2 @@
$ ../src/Driver.exe -i test101.lama < test101.input $ ../src/Driver.exe -runtime ../runtime -I ../stdlib/x64 -i test101.lama < test101.input
Error: could not find an interface file for import "Std" > 0
[255]

View file

@ -1,3 +1,2 @@
$ ../src/Driver.exe -i test102.lama < test102.input $ ../src/Driver.exe -runtime ../runtime -I ../stdlib/x64 -i test102.lama < test102.input
Error: could not find an interface file for import "Std" > 5
[255]

View file

@ -1,3 +1,2 @@
$ ../src/Driver.exe -i test103.lama < test103.input $ ../src/Driver.exe -runtime ../runtime -I ../stdlib/x64 -i test103.lama < test103.input
Error: could not find an interface file for import "Std" > > > 5
[255]

View file

@ -1,3 +1,11 @@
$ ../src/Driver.exe -i test104.lama < test104.input $ ../src/Driver.exe -runtime ../runtime -I ../stdlib/x64 -i test104.lama < test104.input
Error: could not find an interface file for import "Std" > 0
[255] 1
2
3
4
5
6
7
8
9

View file

@ -1,3 +1,2 @@
$ ../src/Driver.exe -i test105.lama < test105.input $ ../src/Driver.exe -runtime ../runtime -I ../stdlib/x64 -i test105.lama < test105.input
Error: could not find an interface file for import "Std" > 3
[255]

View file

@ -1,3 +1,3 @@
$ ../src/Driver.exe -i test106.lama < test106.input $ ../src/Driver.exe -runtime ../runtime -I ../stdlib/x64 -i test106.lama < test106.input
Error: could not find an interface file for import "Std" > 1
[255] 2

View file

@ -1,3 +1,2 @@
$ ../src/Driver.exe -i test107.lama < test107.input $ ../src/Driver.exe -runtime ../runtime -I ../stdlib/x64 -i test107.lama < test107.input
Error: could not find an interface file for import "Std" > 0
[255]

View file

@ -1,3 +1,7 @@
$ ../src/Driver.exe -i test110.lama < test110.input $ ../src/Driver.exe -runtime ../runtime -I ../stdlib/x64 -i test110.lama < test110.input
Error: could not find an interface file for import "Std" > 0
[255] 0
10
0
10
100

View file

@ -1,3 +1,3 @@
$ ../src/Driver.exe -i test111.lama < test111.input $ ../src/Driver.exe -runtime ../runtime -I ../stdlib/x64 -i test111.lama < test111.input
Error: could not find an interface file for import "Std" Error: undefined name "stringcat" at (11, 15)
[255] [255]

View file

@ -1,3 +1,12 @@
$ ../src/Driver.exe -i test112.lama < test112.input $ ../src/Driver.exe -runtime ../runtime -I ../stdlib/x64 -i test112.lama < test112.input
Error: could not find an interface file for import "Std" 1
[255] 2
5
6
7
8
5
6
7
8
3

View file

@ -1,3 +1,6 @@
$ ../src/Driver.exe -i test801.lama < test801.input $ ../src/Driver.exe -runtime ../runtime -I ../stdlib/x64 -i test801.lama < test801.input
Error: could not find an interface file for import "Std" 1
[255] 2
3
4
5

View file

@ -1,3 +1,11 @@
$ ../src/Driver.exe -i test802.lama < test802.input $ ../src/Driver.exe -runtime ../runtime -I ../stdlib/x64 -i test802.lama < test802.input
Error: could not find an interface file for import "Std" 1
[255] 2
3
4
5
6
7
8
9
10

View file

@ -1,3 +1,3 @@
$ ../src/Driver.exe -i test803.lama < test803.input $ ../src/Driver.exe -runtime ../runtime -I ../stdlib/x64 -i test803.lama < test803.input
Error: could not find an interface file for import "Std" Fatal error: exception Failure("int value expected (Closure ([\"unit\"], <not supported>, <not supported>))\n")
[255] [2]

View file

@ -24,7 +24,7 @@ runtime.o: runtime.c runtime.h
$(CC) $(PROD_FLAGS) -c runtime.c -o runtime.o $(CC) $(PROD_FLAGS) -c runtime.c -o runtime.o
printf.o: printf.S printf.o: printf.S
$(CC) $(PROD_FLAGS) -x assembler-with-cpp -c -g printf.S -o printf.o $(CC) $(PROD_FLAGS) -Wa,--noexecstack -x assembler-with-cpp -c -g printf.S -o printf.o
clean: clean:
$(RM) *.a *.o *~ negative_scenarios/*.err $(RM) *.a *.o *~ negative_scenarios/*.err

View file

@ -10,6 +10,8 @@
(install (install
(section share) (section share)
(enabled_if
(= %{system} "linux"))
(files (files
(runtime.a as x32/runtime.a) (runtime.a as x32/runtime.a)
(Std.i as x32/Std.i))) (Std.i as x32/Std.i)))

View file

@ -141,7 +141,33 @@ There are three forms of expressions to specify composite values: arrays, lists
\subsection{Let Expressions} \subsection{Let Expressions}
TODO \begin{figure}[h]
\[
\begin{array}{rcll}
\defterm{letExpression} & : & \term{let}\s\nonterm{pattern}\s\term{=}\s\nonterm{expression}\s\term{in}\s\nonterm{expression}
\end{array}
\]
\caption{Let-expression syntax}
\label{let_expression}
\end{figure}
Let expression is a derived syntactic form for a one-branch case-expression. An expression
\begin{lstlisting}
let p = e in b
\end{lstlisting}
is equivalent to
\begin{lstlisting}
case e of
p -> b
esac
\end{lstlisting}
As let expression lacks an explicit ending specifier its scope extends to the right while possible; multiple let expressions on
the same nesting level associate to the right.
\FloatBarrier \FloatBarrier

View file

@ -95,8 +95,8 @@ is automatically created and closed within the call.}
\descr{\lstinline|fun fprintf (file, fmt, ...)|}{Same as "\lstinline|printf|", but outputs to a given file. The file argument should be that acquired \descr{\lstinline|fun fprintf (file, fmt, ...)|}{Same as "\lstinline|printf|", but outputs to a given file. The file argument should be that acquired
by \lstinline|fopen| function.} by \lstinline|fopen| function.}
\descr{\lstinline|fun regexp (str)|}{Compiles a string representation of a regular expression (as per POSIX-Extended Regular Expressions syntax) into \descr{\lstinline|fun regexp (string)|}{Compiles a string representation of a regular expression (as per POSIX-Extended Regular Expressions syntax) into
an internal representation. The return value is a external pointer to the internal representation.} an internal representation. The return value is an external pointer to the internal representation.}
\descr{\lstinline|fun regexpMatch (pattern, subj, pos)|}{Matches a string "\lstinline{subj}", starting from the position "\lstinline|pos|", \descr{\lstinline|fun regexpMatch (pattern, subj, pos)|}{Matches a string "\lstinline{subj}", starting from the position "\lstinline|pos|",
against a pattern "\lstinline{pattern}". The pattern is an external pointer to a compiled representation, returned by the against a pattern "\lstinline{pattern}". The pattern is an external pointer to a compiled representation, returned by the

View file

@ -1464,7 +1464,7 @@ let compile cmd ((imports, _), p) =
| Expr.Ignore s -> | Expr.Ignore s ->
let ls, env = env#get_label in let ls, env = env#get_label in
add_code (compile_expr tail ls env s) ls false [ DROP ] add_code (compile_expr tail ls env s) ls false [ DROP ]
| Expr.ElemRef (x, i) -> compile_list tail l env [ x; i ] | Expr.ElemRef _ -> failwith "Should not happen. Indirect assignemts are temporarily prohibited."
| Expr.Var x -> ( | Expr.Var x -> (
let env, line = env#gen_line x in let env, line = env#gen_line x in
let env, acc = env#lookup x in let env, acc = env#lookup x in
@ -1475,10 +1475,7 @@ let compile cmd ((imports, _), p) =
false, false,
line @ [ PROTO (name, env#current_function) ] ) line @ [ PROTO (name, env#current_function) ] )
| _ -> (env, false, line @ [ LD acc ])) | _ -> (env, false, line @ [ LD acc ]))
| Expr.Ref x -> | Expr.Ref _ -> failwith "Should not happen. Indirect assignemts are temporarily prohibited."
let env, line = env#gen_line x in
let env, acc = env#lookup x in
(env, false, line @ [ LDA acc ])
| Expr.Const n -> (env, false, [ CONST n ]) | Expr.Const n -> (env, false, [ CONST n ])
| Expr.String s -> (env, false, [ STRING s ]) | Expr.String s -> (env, false, [ STRING s ])
| Expr.Binop (op, x, y) -> | Expr.Binop (op, x, y) ->
@ -1533,13 +1530,15 @@ let compile cmd ((imports, _), p) =
let env, line = env#gen_line x in let env, line = env#gen_line x in
let env, acc = env#lookup x in let env, acc = env#lookup x in
add_code (compile_expr false lassn env e) lassn false (line @ [ ST acc ]) add_code (compile_expr false lassn env e) lassn false (line @ [ ST acc ])
| Expr.Assign (x, e) -> | Expr.Assign (Expr.ElemRef (x, i), e) ->
let lassn, env = env#get_label in let lassn, env = env#get_label in
add_code add_code
(compile_list false lassn env [ x; e ]) (compile_list false lassn env [ x; i; e ])
lassn false lassn false
[ (match x with Expr.Ref _ -> STI | _ -> STA) ] [ STA ]
(*Expr.ElemRef _ -> STA | _ -> STI]*) | Expr.Assign (x, _) ->
failwith
(Printf.sprintf "Indirect assignment is not supported yet: %s" (show Expr.t x))
| Expr.Skip -> (env, false, []) | Expr.Skip -> (env, false, [])
| Expr.Seq (s1, s2) -> compile_list tail l env [ s1; s2 ] | Expr.Seq (s1, s2) -> compile_list tail l env [ s1; s2 ]
| Expr.If (c, s1, s2) -> | Expr.If (c, s1, s2) ->

View file

@ -22,8 +22,6 @@ let word_size = 4;;
| I of int * opnd (* an indirect operand with offset *) | I of int * opnd (* an indirect operand with offset *)
with show with show
let show_opnd = show(opnd)
(* For convenience we define the following synonyms for the registers: *) (* For convenience we define the following synonyms for the registers: *)
let ebx = R 0 let ebx = R 0
let ecx = R 1 let ecx = R 1
@ -150,7 +148,7 @@ let compile cmd env imports code =
in in
let env , pushs = push_args env [] n in let env , pushs = push_args env [] n in
let closure, env = env#pop in let closure, env = env#pop in
let y , env = env#allocate in let _ , env = env#allocate in
env, pushs @ [Mov (closure, edx); env, pushs @ [Mov (closure, edx);
Mov (I(0, edx), eax); Mov (I(0, edx), eax);
Mov (ebp, esp); Mov (ebp, esp);
@ -197,7 +195,7 @@ let compile cmd env imports code =
else push_args env ((mov x (env#loc (Value.Arg (n-1)))) @ acc) (n-1) else push_args env ((mov x (env#loc (Value.Arg (n-1)))) @ acc) (n-1)
in in
let env, pushs = push_args env [] n in let env, pushs = push_args env [] n in
let y, env = env#allocate in let _, env = env#allocate in
env, pushs @ [Mov (ebp, esp); Pop (ebp)] @ (if env#has_closure then [Pop ebx] else []) @ [Jmp f] env, pushs @ [Mov (ebp, esp); Pop (ebp)] @ (if env#has_closure then [Pop ebx] else []) @ [Jmp f]
) )
else ( else (
@ -563,8 +561,8 @@ module M = Map.Make (String)
(* Environment implementation *) (* Environment implementation *)
class env prg = class env prg =
let chars = "_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'" in let chars = "_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'" in
let make_assoc l i = List.combine l (List.init (List.length l) (fun x -> x + i)) in (* let make_assoc l i = List.combine l (List.init (List.length l) (fun x -> x + i)) in *)
let rec assoc x = function [] -> raise Not_found | l :: ls -> try List.assoc x l with Not_found -> assoc x ls in (* let rec assoc x = function [] -> raise Not_found | l :: ls -> try List.assoc x l with Not_found -> assoc x ls in *)
object (self) object (self)
inherit SM.indexer prg inherit SM.indexer prg
val globals = S.empty (* a set of global variables *) val globals = S.empty (* a set of global variables *)
@ -663,7 +661,7 @@ class env prg =
(* allocates a fresh position on a symbolic stack *) (* allocates a fresh position on a symbolic stack *)
method allocate = method allocate =
let x, n = let x, n =
let rec allocate' = function let allocate' = function
| [] -> ebx , 0 | [] -> ebx , 0
| (S n)::_ -> S (n+1) , n+2 | (S n)::_ -> S (n+1) , n+2
| (R n)::_ when n < num_of_regs -> R (n+1) , stack_slots | (R n)::_ when n < num_of_regs -> R (n+1) , stack_slots

View file

@ -260,11 +260,16 @@ let show env instr =
let in_memory = function M _ | S _ | I _ -> true | C _ | R _ | L _ -> false let in_memory = function M _ | S _ | I _ -> true | C _ | R _ | L _ -> false
let mov x s = let mov x s =
(* Numeric literals with more than 32 bits cannot ne directly moved to memory location *) (* Numeric literals with more than 32 bits cannot be directly moved to memory location *)
let big_numeric_literal = function L num -> num > 0xFFFFFFFF | _ -> false in let big_numeric_literal = function
| L num -> num > 0xFFFFFFFF || num < -0xFFFFFFFF
| _ -> false
in
if x = s then [] if x = s then []
else if (in_memory x && in_memory s) || big_numeric_literal x then else if
[ Mov (x, rax); Mov (rax, s) ] (in_memory x && in_memory s)
|| (big_numeric_literal x && (in_memory x || in_memory s))
then [ Mov (x, rax); Mov (rax, s) ]
else [ Mov (x, s) ] else [ Mov (x, s) ]
(* Boxing for numeric values *) (* Boxing for numeric values *)
@ -691,16 +696,30 @@ let compile cmd env imports code =
(env, push_closure_code @ mov address l @ call_code) (env, push_closure_code @ mov address l @ call_code)
| CONST n -> | CONST n ->
let s, env' = env#allocate in let s, env' = env#allocate in
(env', [ Mov (L (box n), s) ]) (env', mov (L (box n)) s)
| STRING s -> | STRING s ->
let addr, env = env#string s in let addr, env = env#string s in
let l, env = env#allocate in let l, env = env#allocate in
let env, call = compile_call env ~fname:".string" 1 false in let env, call = compile_call env ~fname:".string" 1 false in
(env, mov addr l @ call) (env, mov addr l @ call)
| LDA x -> | LDA _ ->
failwith
"Should not happen. Indirect assignemts are temporarily \
prohibited."
(*
let s, env' = (env#variable x)#allocate in let s, env' = (env#variable x)#allocate in
let s', env'' = env'#allocate in let s', env'' = env'#allocate in
(env'', [ Lea (env'#loc x, rax); Mov (rax, s); Mov (rax, s') ]) let loc_x = env'#loc x in
match loc_x with
| R _ ->
failwith
"We are not able to take an address of a register. This \
is the known limitation of 64-bit compiler. If you \
encountered this issue, just do not use indirect \
assignment :("
| _ ->
();
(env'', [ Lea (loc_x, rax); Mov (rax, s); Mov (rax, s') ])*)
| LD x -> ( | LD x -> (
let s, env' = (env#variable x)#allocate in let s, env' = (env#variable x)#allocate in
( env', ( env',
@ -715,7 +734,11 @@ let compile cmd env imports code =
| S _ | M _ -> [ Mov (s, rax); Mov (rax, env'#loc x) ] | S _ | M _ -> [ Mov (s, rax); Mov (rax, env'#loc x) ]
| _ -> [ Mov (s, env'#loc x) ] )) | _ -> [ Mov (s, env'#loc x) ] ))
| STA -> compile_call env ~fname:".sta" 3 false | STA -> compile_call env ~fname:".sta" 3 false
| STI -> ( | STI ->
failwith
"Should not happen. Indirect assignemts are temporarily \
prohibited."
(*
let v, env = env#pop in let v, env = env#pop in
let x = env#peek in let x = env#peek in
( env, ( env,
@ -727,7 +750,7 @@ let compile cmd env imports code =
Mov (rdx, I (0, rax)); Mov (rdx, I (0, rax));
Mov (rdx, x); Mov (rdx, x);
] ]
| _ -> [ Mov (v, rax); Mov (rax, I (0, x)); Mov (rax, x) ] )) | _ -> [ Mov (v, rax); Mov (rax, I (0, x)); Mov (rax, x) ] )*)
| BINOP op -> compile_binop env op | BINOP op -> compile_binop env op
| LABEL s | FLABEL s | SLABEL s -> (env, [ Label s ]) | LABEL s | FLABEL s | SLABEL s -> (env, [ Label s ])
| JMP l -> ((env#set_stack l)#set_barrier, [ Jmp l ]) | JMP l -> ((env#set_stack l)#set_barrier, [ Jmp l ])
@ -909,7 +932,7 @@ let compile cmd env imports code =
] ]
@ (if name = "main" then [ Binop ("^", rax, rax) ] else []) @ (if name = "main" then [ Binop ("^", rax, rax) ] else [])
@ [ @ [
Meta "\t.cfi_restore\t5"; Meta "\t.cfi_restore\trbp";
Meta "\t.cfi_def_cfa\t4, 4"; Meta "\t.cfi_def_cfa\t4, 4";
Ret; Ret;
Meta "\t.cfi_endproc"; Meta "\t.cfi_endproc";
@ -972,24 +995,20 @@ let compile cmd env imports code =
1 false 1 false
| LINE line -> env#gen_line line | LINE line -> env#gen_line line
| FAIL ((line, col), value) -> | FAIL ((line, col), value) ->
let v, env = if value then (env#peek, env) else env#pop in let value, env = if value then (env#peek, env) else env#pop in
let msg_addr, env = env#string cmd#get_infile in let msg_addr, env = env#string cmd#get_infile in
let vr, env = env#allocate in let value_arg_addr, env = env#allocate in
let sr, env = env#allocate in let msg_arg_addr, env = env#allocate in
let liner, env = env#allocate in let line_arg_addr, env = env#allocate in
let colr, env = env#allocate in let col_arg_addr, env = env#allocate in
let env, code = let env, code =
compile_call env ~fname:".match_failure" 4 false compile_call env ~fname:".match_failure" 4 false
in in
let _, env = env#pop in let _, env = env#pop in
( env, ( env,
[ mov (L col) col_arg_addr @ mov (L line) line_arg_addr
Mov (L col, colr); @ mov msg_addr msg_arg_addr @ mov value value_arg_addr @ code
Mov (L line, liner); )
Mov (msg_addr, sr);
Mov (v, vr);
]
@ code )
| i -> | i ->
invalid_arg invalid_arg
(Printf.sprintf "invalid SM insn: %s\n" (GT.show insn i)) (Printf.sprintf "invalid SM insn: %s\n" (GT.show insn i))
@ -1304,6 +1323,10 @@ class env prg mode =
Buffer.add_char buf '\\'; Buffer.add_char buf '\\';
Buffer.add_char buf 't'; Buffer.add_char buf 't';
iterate (i + 2) iterate (i + 2)
| 'r' ->
Buffer.add_char buf '\\';
Buffer.add_char buf 'r';
iterate (i + 2)
| _ -> | _ ->
Buffer.add_char buf '\\'; Buffer.add_char buf '\\';
Buffer.add_char buf '\\'; Buffer.add_char buf '\\';
@ -1474,8 +1497,8 @@ let build cmd prog =
in in
let compiler_flags, linker_flags = let compiler_flags, linker_flags =
match cmd#target_os with match cmd#target_os with
| Darwin -> ("-arch x86_64", "-ld_classic") | Darwin -> ("-arch x86_64 -Wa,--noexecstack", "-ld_classic")
| Linux -> ("", "") | Linux -> ("-Wa,--noexecstack", "")
in in
let debug_flags = if cmd#is_debug then "-g" else "" in let debug_flags = if cmd#is_debug then "-g" else "" in
match cmd#get_mode with match cmd#get_mode with
@ -1493,11 +1516,17 @@ let build cmd prog =
(Buffer.contents buf) cmd#get_runtime_path (Buffer.contents buf) cmd#get_runtime_path
(match cmd#march with `X86_32 -> "runtime32" | `AMD64 -> "runtime") (match cmd#march with `X86_32 -> "runtime32" | `AMD64 -> "runtime")
in in
Sys.command gcc_cmdline let result = Sys.command gcc_cmdline in
if result <> 0 then
failwith
(Printf.sprintf "Assembly compiler failed with exit code %d" result)
| `Compile -> | `Compile ->
let cmd = let cmd =
Printf.sprintf "%s %s %s -c -g %s.s" compiler compiler_flags debug_flags Printf.sprintf "%s %s %s -c -g %s.s" compiler compiler_flags debug_flags
cmd#basename cmd#basename
in in
Sys.command cmd let result = Sys.command cmd in
if result <> 0 then
failwith
(Printf.sprintf "Assembly compiler failed with exit code %d" result)
| _ -> invalid_arg "must not happen" | _ -> invalid_arg "must not happen"

View file

@ -61,7 +61,7 @@
SM SM
X86_64) X86_64)
((action ((action
(run %{project_root}/src/pp5+gt+plugins+ostap+dump.byte %{input-file})) (run %{project_root}/src/pp5+gt+plugins+ostap+dump.exe %{input-file}))
Language Language
Pprinter Pprinter
X86_32 X86_32
@ -69,7 +69,8 @@
version))) version)))
(preprocessor_deps (preprocessor_deps
(file %{project_root}/src/pp5+gt+plugins+ostap+dump.byte) (file %{project_root}/src/pp5+gt+plugins+ostap+dump.byte)
;(file %{project_root}/src/pp5+gt+plugins+ostap+dump.exe) (file %{project_root}/src/pp5+gt+plugins+ostap+dump.exe)
;
) )
;(inline_tests) ;(inline_tests)
) )
@ -106,5 +107,17 @@
-o -o
%{targets}))) %{targets})))
(rule
(targets pp5+gt+plugins+ostap+dump.exe)
(deps
(package GT))
(action
(run
mkcamlp5.opt
-package
camlp5,camlp5.pa_o,camlp5.pr_o,ostap.syntax,GT.syntax.all,GT.syntax
-o
%{targets})))
(cram (cram
(deps ./Driver.exe)) (deps ./Driver.exe))

View file

@ -18,6 +18,8 @@ $(BDIR)/Fun.o: $(BDIR)/Ref.o
$(BDIR)/Data.o: $(BDIR)/Ref.o $(BDIR)/Collection.o $(BDIR)/Data.o: $(BDIR)/Ref.o $(BDIR)/Collection.o
$(BDIR)/Queue.o: $(BDIR)/List.o
$(BDIR)/Collection.o: $(BDIR)/List.o $(BDIR)/Ref.o $(BDIR)/Collection.o: $(BDIR)/List.o $(BDIR)/Ref.o
$(BDIR)/Array.o: $(BDIR)/List.o $(BDIR)/Array.o: $(BDIR)/List.o

26
stdlib/Queue.lama Normal file
View file

@ -0,0 +1,26 @@
import List;
fun emptyQueue () {
[{}, {}]
}
fun isEmptyQueue (q) {
case q of
[{}, {}] -> true
| _ -> false
esac
}
fun enqueue ([pop, push], x) {
[pop, x : push]
}
fun dequeue ([pop, push]) {
case pop of
x : pop -> [[pop, push], x]
| _ -> case push of
{} -> failure ("dequeueing from empty queue\n")
| _ -> dequeue ([reverse (push), {}])
esac
esac
}

View file

@ -1,9 +1,13 @@
; This file was autogenerated ; This file was autogenerated
(cram (deps ../../src/Driver.exe)) (cram (deps ../../src/Driver.exe))
(cram (deps ../../runtime32/runtime.a ../../runtime32/Std.i)) (cram
(enabled_if (= %{system} "linux"))
(deps ../../runtime32/runtime.a ../../runtime32/Std.i))
(cram (deps ../../runtime/runtime.a ../../runtime/Std.i)) (cram (deps ../../runtime/runtime.a ../../runtime/Std.i))
(cram (deps ../x32/Array.i ../x32/Array.o ../x32/Buffer.i ../x32/Buffer.o ../x32/Collection.i ../x32/Collection.o ../x32/Data.i ../x32/Data.o ../x32/Fun.i ../x32/Fun.o ../x32/Lazy.i ../x32/Lazy.o ../x32/List.i ../x32/List.o ../x32/Matcher.i ../x32/Matcher.o ../x32/Ostap.i ../x32/Ostap.o ../x32/Random.i ../x32/Random.o ../x32/Ref.i ../x32/Ref.o ../x32/STM.i ../x32/STM.o ../x32/Timer.i ../x32/Timer.o)) (cram
(enabled_if (= %{system} "linux"))
(deps ../x32/Array.i ../x32/Array.o ../x32/Buffer.i ../x32/Buffer.o ../x32/Collection.i ../x32/Collection.o ../x32/Data.i ../x32/Data.o ../x32/Fun.i ../x32/Fun.o ../x32/Lazy.i ../x32/Lazy.o ../x32/List.i ../x32/List.o ../x32/Matcher.i ../x32/Matcher.o ../x32/Ostap.i ../x32/Ostap.o ../x32/Random.i ../x32/Random.o ../x32/Ref.i ../x32/Ref.o ../x32/STM.i ../x32/STM.o ../x32/Timer.i ../x32/Timer.o))
(cram (deps ../x64/Array.i ../x64/Array.o ../x64/Buffer.i ../x64/Buffer.o ../x64/Collection.i ../x64/Collection.o ../x64/Data.i ../x64/Data.o ../x64/Fun.i ../x64/Fun.o ../x64/Lazy.i ../x64/Lazy.o ../x64/List.i ../x64/List.o ../x64/Matcher.i ../x64/Matcher.o ../x64/Ostap.i ../x64/Ostap.o ../x64/Random.i ../x64/Random.o ../x64/Ref.i ../x64/Ref.o ../x64/STM.i ../x64/STM.o ../x64/Timer.i ../x64/Timer.o)) (cram (deps ../x64/Array.i ../x64/Array.o ../x64/Buffer.i ../x64/Buffer.o ../x64/Collection.i ../x64/Collection.o ../x64/Data.i ../x64/Data.o ../x64/Fun.i ../x64/Fun.o ../x64/Lazy.i ../x64/Lazy.o ../x64/List.i ../x64/List.o ../x64/Matcher.i ../x64/Matcher.o ../x64/Ostap.i ../x64/Ostap.o ../x64/Random.i ../x64/Random.o ../x64/Ref.i ../x64/Ref.o ../x64/STM.i ../x64/STM.o ../x64/Timer.i ../x64/Timer.o))
(cram (applies_to test01) (cram (applies_to test01)
(deps test01.lama)) (deps test01.lama))

View file

@ -7,11 +7,17 @@ let sprintf = Printf.sprintf
let () = let () =
Out_channel.with_open_text "dune" (fun dunech -> Out_channel.with_open_text "dune" (fun dunech ->
let dprintfn fmt = Format.kasprintf (Printf.fprintf dunech "%s\n") fmt in let dprintfn fmt = Format.kasprintf (Printf.fprintf dunech "%s\n") fmt in
let iflinux () = dprintfn " (enabled_if (= %%{system} \"linux\"))" in
dprintfn "; This file was autogenerated\n"; dprintfn "; This file was autogenerated\n";
dprintfn "(cram (deps ../../src/Driver.exe))"; dprintfn "(cram (deps ../../src/Driver.exe))";
dprintfn "(cram (deps ../../runtime32/runtime.a ../../runtime32/Std.i))"; dprintfn "(cram";
iflinux ();
dprintfn " (deps ../../runtime32/runtime.a ../../runtime32/Std.i))";
dprintfn "(cram (deps ../../runtime/runtime.a ../../runtime/Std.i))"; dprintfn "(cram (deps ../../runtime/runtime.a ../../runtime/Std.i))";
dprintfn "(cram (deps %s))"
dprintfn "(cram";
iflinux ();
dprintfn " (deps %s))"
(String.concat " " (List.concat_map (fun s -> (String.concat " " (List.concat_map (fun s ->
[sprintf "../x32/%s.i" s [sprintf "../x32/%s.i" s
;sprintf "../x32/%s.o" s ;sprintf "../x32/%s.o" s
@ -36,7 +42,7 @@ let () =
if Sys.file_exists !lama_file && i <> 30 then ( if Sys.file_exists !lama_file && i <> 30 then (
(* cram_printfn " $ ls ../x64"; *) (* cram_printfn " $ ls ../x64"; *)
cram_printfn cram_printfn
" $ ../../src/Driver.exe -runtime ../../runtime -I ../../runtime -I ../../stdlib/x64 -ds -dp test%02d.lama -o test 2>&1 | grep -v 'missing .note.GNU-stack'" i; " $ ../../src/Driver.exe -runtime ../../runtime -I ../../runtime -I ../../stdlib/x64 -ds -dp test%02d.lama -o test" i;
cram_printfn " $ ./test"; cram_printfn " $ ./test";
true) true)
else false else false

View file

@ -1,6 +1,5 @@
This file was autogenerated. This file was autogenerated.
$ ../../src/Driver.exe -runtime ../../runtime -I ../../runtime -I ../../stdlib/x64 -ds -dp test01.lama -o test 2>&1 | grep -v 'missing .note.GNU-stack' $ ../../src/Driver.exe -runtime ../../runtime -I ../../runtime -I ../../stdlib/x64 -ds -dp test01.lama -o test
/usr/bin/ld: NOTE: This behaviour is deprecated and will be removed in a future version of the linker
$ ./test $ ./test
Set internal structure: MNode (63, 1, 0, MNode (31, 1, 0, MNode (15, 1, 0, MNode (7, 1, 0, MNode (3, 1, 0, MNode (1, 1, 0, MNode (0, 1, 0, 0, 0), MNode (2, 1, 0, 0, 0)), MNode (5, 1, 0, MNode (4, 1, 0, 0, 0), MNode (6, 1, 0, 0, 0))), MNode (11, 1, 0, MNode (9, 1, 0, MNode (8, 1, 0, 0, 0), MNode (10, 1, 0, 0, 0)), MNode (13, 1, 0, MNode (12, 1, 0, 0, 0), MNode (14, 1, 0, 0, 0)))), MNode (23, 1, 0, MNode (19, 1, 0, MNode (17, 1, 0, MNode (16, 1, 0, 0, 0), MNode (18, 1, 0, 0, 0)), MNode (21, 1, 0, MNode (20, 1, 0, 0, 0), MNode (22, 1, 0, 0, 0))), MNode (27, 1, 0, MNode (25, 1, 0, MNode (24, 1, 0, 0, 0), MNode (26, 1, 0, 0, 0)), MNode (29, 1, 0, MNode (28, 1, 0, 0, 0), MNode (30, 1, 0, 0, 0))))), MNode (47, 1, 0, MNode (39, 1, 0, MNode (35, 1, 0, MNode (33, 1, 0, MNode (32, 1, 0, 0, 0), MNode (34, 1, 0, 0, 0)), MNode (37, 1, 0, MNode (36, 1, 0, 0, 0), MNode (38, 1, 0, 0, 0))), MNode (43, 1, 0, MNode (41, 1, 0, MNode (40, 1, 0, 0, 0), MNode (42, 1, 0, 0, 0)), MNode (45, 1, 0, MNode (44, 1, 0, 0, 0), MNode (46, 1, 0, 0, 0)))), MNode (55, 1, 0, MNode (51, 1, 0, MNode (49, 1, 0, MNode (48, 1, 0, 0, 0), MNode (50, 1, 0, 0, 0)), MNode (53, 1, 0, MNode (52, 1, 0, 0, 0), MNode (54, 1, 0, 0, 0))), MNode (59, 1, 0, MNode (57, 1, 0, MNode (56, 1, 0, 0, 0), MNode (58, 1, 0, 0, 0)), MNode (61, 1, 0, MNode (60, 1, 0, 0, 0), MNode (62, 1, 0, 0, 0)))))), MNode (79, 1, -1, MNode (71, 1, 0, MNode (67, 1, 0, MNode (65, 1, 0, MNode (64, 1, 0, 0, 0), MNode (66, 1, 0, 0, 0)), MNode (69, 1, 0, MNode (68, 1, 0, 0, 0), MNode (70, 1, 0, 0, 0))), MNode (75, 1, 0, MNode (73, 1, 0, MNode (72, 1, 0, 0, 0), MNode (74, 1, 0, 0, 0)), MNode (77, 1, 0, MNode (76, 1, 0, 0, 0), MNode (78, 1, 0, 0, 0)))), MNode (87, 1, -1, MNode (83, 1, 0, MNode (81, 1, 0, MNode (80, 1, 0, 0, 0), MNode (82, 1, 0, 0, 0)), MNode (85, 1, 0, MNode (84, 1, 0, 0, 0), MNode (86, 1, 0, 0, 0))), MNode (95, 1, 0, MNode (91, 1, 0, MNode (89, 1, 0, MNode (88, 1, 0, 0, 0), MNode (90, 1, 0, 0, 0)), MNode (93, 1, 0, MNode (92, 1, 0, 0, 0), MNode (94, 1, 0, 0, 0))), MNode (97, 1, -1, MNode (96, 1, 0, 0, 0), MNode (98, 1, -1, 0, MNode (99, 1, 0, 0, 0))))))) Set internal structure: MNode (63, 1, 0, MNode (31, 1, 0, MNode (15, 1, 0, MNode (7, 1, 0, MNode (3, 1, 0, MNode (1, 1, 0, MNode (0, 1, 0, 0, 0), MNode (2, 1, 0, 0, 0)), MNode (5, 1, 0, MNode (4, 1, 0, 0, 0), MNode (6, 1, 0, 0, 0))), MNode (11, 1, 0, MNode (9, 1, 0, MNode (8, 1, 0, 0, 0), MNode (10, 1, 0, 0, 0)), MNode (13, 1, 0, MNode (12, 1, 0, 0, 0), MNode (14, 1, 0, 0, 0)))), MNode (23, 1, 0, MNode (19, 1, 0, MNode (17, 1, 0, MNode (16, 1, 0, 0, 0), MNode (18, 1, 0, 0, 0)), MNode (21, 1, 0, MNode (20, 1, 0, 0, 0), MNode (22, 1, 0, 0, 0))), MNode (27, 1, 0, MNode (25, 1, 0, MNode (24, 1, 0, 0, 0), MNode (26, 1, 0, 0, 0)), MNode (29, 1, 0, MNode (28, 1, 0, 0, 0), MNode (30, 1, 0, 0, 0))))), MNode (47, 1, 0, MNode (39, 1, 0, MNode (35, 1, 0, MNode (33, 1, 0, MNode (32, 1, 0, 0, 0), MNode (34, 1, 0, 0, 0)), MNode (37, 1, 0, MNode (36, 1, 0, 0, 0), MNode (38, 1, 0, 0, 0))), MNode (43, 1, 0, MNode (41, 1, 0, MNode (40, 1, 0, 0, 0), MNode (42, 1, 0, 0, 0)), MNode (45, 1, 0, MNode (44, 1, 0, 0, 0), MNode (46, 1, 0, 0, 0)))), MNode (55, 1, 0, MNode (51, 1, 0, MNode (49, 1, 0, MNode (48, 1, 0, 0, 0), MNode (50, 1, 0, 0, 0)), MNode (53, 1, 0, MNode (52, 1, 0, 0, 0), MNode (54, 1, 0, 0, 0))), MNode (59, 1, 0, MNode (57, 1, 0, MNode (56, 1, 0, 0, 0), MNode (58, 1, 0, 0, 0)), MNode (61, 1, 0, MNode (60, 1, 0, 0, 0), MNode (62, 1, 0, 0, 0)))))), MNode (79, 1, -1, MNode (71, 1, 0, MNode (67, 1, 0, MNode (65, 1, 0, MNode (64, 1, 0, 0, 0), MNode (66, 1, 0, 0, 0)), MNode (69, 1, 0, MNode (68, 1, 0, 0, 0), MNode (70, 1, 0, 0, 0))), MNode (75, 1, 0, MNode (73, 1, 0, MNode (72, 1, 0, 0, 0), MNode (74, 1, 0, 0, 0)), MNode (77, 1, 0, MNode (76, 1, 0, 0, 0), MNode (78, 1, 0, 0, 0)))), MNode (87, 1, -1, MNode (83, 1, 0, MNode (81, 1, 0, MNode (80, 1, 0, 0, 0), MNode (82, 1, 0, 0, 0)), MNode (85, 1, 0, MNode (84, 1, 0, 0, 0), MNode (86, 1, 0, 0, 0))), MNode (95, 1, 0, MNode (91, 1, 0, MNode (89, 1, 0, MNode (88, 1, 0, 0, 0), MNode (90, 1, 0, 0, 0)), MNode (93, 1, 0, MNode (92, 1, 0, 0, 0), MNode (94, 1, 0, 0, 0))), MNode (97, 1, -1, MNode (96, 1, 0, 0, 0), MNode (98, 1, -1, 0, MNode (99, 1, 0, 0, 0)))))))
Set elements: {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99} Set elements: {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99}

Some files were not shown because too many files have changed in this diff Show more