From 09810470fc308b45e78a34b5b3bab15b04f7a225 Mon Sep 17 00:00:00 2001 From: Dmitry Boulytchev Date: Fri, 1 Nov 2024 22:16:30 +0300 Subject: [PATCH] Fixed paths --- regression/gen.ml | 2 +- regression/test001.t | 3 +- regression/test002.t | 3 +- regression/test003.t | 5 +-- regression/test004.t | 3 +- regression/test005.t | 3 +- regression/test006.t | 8 +---- regression/test007.t | 3 +- regression/test008.t | 3 +- regression/test009.t | 3 +- regression/test010.t | 3 +- regression/test011.t | 3 +- regression/test012.t | 10 +----- regression/test013.t | 10 +----- regression/test014.t | 33 +------------------ regression/test015.t | 3 +- regression/test016.t | 3 +- regression/test017.t | 3 +- regression/test018.t | 16 +-------- regression/test019.t | 3 +- regression/test020.t | 3 +- regression/test021.t | 3 +- regression/test022.t | 3 +- regression/test023.t | 3 +- regression/test024.t | 4 +-- regression/test025.t | 14 +------- regression/test026.t | 23 +------------ regression/test027.t | 37 +-------------------- regression/test028.t | 16 +-------- regression/test029.t | 20 +----------- regression/test034.t | 18 +---------- regression/test036.t | 18 +---------- regression/test040.t | 6 +--- regression/test041.t | 4 +-- regression/test042.t | 12 +------ regression/test045.t | 42 +----------------------- regression/test046.t | 15 +-------- regression/test050.t | 3 +- regression/test054.t | 15 +-------- regression/test059.t | 5 +-- regression/test063.t | 4 +-- regression/test072.t | 20 +----------- regression/test073.t | 16 +-------- regression/test074.t | 38 +--------------------- regression/test077.t | 8 +---- regression/test078.t | 14 +------- regression/test079.t | 8 +---- regression/test080.t | 5 +-- regression/test081.t | 8 +---- regression/test082.t | 19 +---------- regression/test083.t | 5 +-- regression/test084.t | 5 +-- regression/test085.t | 10 +----- regression/test086.t | 5 +-- regression/test088.t | 4 +-- regression/test089.t | 3 +- regression/test090.t | 5 +-- regression/test091.t | 11 +------ regression/test092.t | 7 +--- regression/test093.t | 4 +-- regression/test094.t | 6 +--- regression/test095.t | 3 +- regression/test096.t | 4 +-- regression/test097.t | 3 +- regression/test098.t | 3 +- regression/test099.t | 5 +-- regression/test100.t | 3 +- regression/test101.t | 3 +- regression/test102.t | 3 +- regression/test103.t | 3 +- regression/test104.t | 12 +------ regression/test105.t | 3 +- regression/test106.t | 4 +-- regression/test107.t | 3 +- regression/test110.t | 8 +---- regression/test111.t | 4 +-- regression/test112.t | 13 +------- regression/test801.t | 7 +--- regression/test802.t | 12 +------ regression/test803.t | 4 +-- src/Driver.ml | 2 +- src/Options.ml | 77 +++++++++++++++++++++++++++----------------- src/X86_32.ml | 7 +--- stdlib/x32/dune | 2 +- stdlib/x64/dune | 2 +- tutorial/dune | 40 +++++++++++------------ 86 files changed, 152 insertions(+), 670 deletions(-) diff --git a/regression/gen.ml b/regression/gen.ml index d7bfb3504..ac00e11d8 100644 --- a/regression/gen.ml +++ b/regression/gen.ml @@ -21,7 +21,7 @@ let () = let found = if Sys.file_exists !lama_file then ( cram_printfn - " $ LAMA=../runtime ../src/Driver.exe -i test%03d.lama < \ + "../src/Driver.exe -i test%03d.lama < \ test%03d.input" i i; true) diff --git a/regression/test001.t b/regression/test001.t index 16fe859cb..201dcd8ae 100644 --- a/regression/test001.t +++ b/regression/test001.t @@ -1,2 +1 @@ - $ LAMA=../runtime ../src/Driver.exe -i test001.lama < test001.input - > > 90 +../src/Driver.exe -i test001.lama < test001.input diff --git a/regression/test002.t b/regression/test002.t index c36961625..70f251fb7 100644 --- a/regression/test002.t +++ b/regression/test002.t @@ -1,2 +1 @@ - $ LAMA=../runtime ../src/Driver.exe -i test002.lama < test002.input - > > 41 +../src/Driver.exe -i test002.lama < test002.input diff --git a/regression/test003.t b/regression/test003.t index 2d2060714..5a2483dfc 100644 --- a/regression/test003.t +++ b/regression/test003.t @@ -1,4 +1 @@ - $ LAMA=../runtime ../src/Driver.exe -i test003.lama < test003.input - > > 7 - 3 - 1 +../src/Driver.exe -i test003.lama < test003.input diff --git a/regression/test004.t b/regression/test004.t index 9bcc18607..612138062 100644 --- a/regression/test004.t +++ b/regression/test004.t @@ -1,2 +1 @@ - $ LAMA=../runtime ../src/Driver.exe -i test004.lama < test004.input - > > 10 +../src/Driver.exe -i test004.lama < test004.input diff --git a/regression/test005.t b/regression/test005.t index 2efdae8f2..908ffc202 100644 --- a/regression/test005.t +++ b/regression/test005.t @@ -1,2 +1 @@ - $ LAMA=../runtime ../src/Driver.exe -i test005.lama < test005.input - > > 11 +../src/Driver.exe -i test005.lama < test005.input diff --git a/regression/test006.t b/regression/test006.t index 240b91821..70bf1390f 100644 --- a/regression/test006.t +++ b/regression/test006.t @@ -1,7 +1 @@ - $ LAMA=../runtime ../src/Driver.exe -i test006.lama < test006.input - > > 1 - 1 - 0 - 1 - 0 - 0 +../src/Driver.exe -i test006.lama < test006.input diff --git a/regression/test007.t b/regression/test007.t index abddc7a51..f93d7f520 100644 --- a/regression/test007.t +++ b/regression/test007.t @@ -1,2 +1 @@ - $ LAMA=../runtime ../src/Driver.exe -i test007.lama < test007.input - -4 +../src/Driver.exe -i test007.lama < test007.input diff --git a/regression/test008.t b/regression/test008.t index 4962f828b..5968bc996 100644 --- a/regression/test008.t +++ b/regression/test008.t @@ -1,2 +1 @@ - $ LAMA=../runtime ../src/Driver.exe -i test008.lama < test008.input - -45 +../src/Driver.exe -i test008.lama < test008.input diff --git a/regression/test009.t b/regression/test009.t index 8bc198cab..549c6c913 100644 --- a/regression/test009.t +++ b/regression/test009.t @@ -1,2 +1 @@ - $ LAMA=../runtime ../src/Driver.exe -i test009.lama < test009.input - 1024 +../src/Driver.exe -i test009.lama < test009.input diff --git a/regression/test010.t b/regression/test010.t index b046d8ec5..0e2c01a10 100644 --- a/regression/test010.t +++ b/regression/test010.t @@ -1,2 +1 @@ - $ LAMA=../runtime ../src/Driver.exe -i test010.lama < test010.input - 499950 +../src/Driver.exe -i test010.lama < test010.input diff --git a/regression/test011.t b/regression/test011.t index 235e0ca3e..50eef5e52 100644 --- a/regression/test011.t +++ b/regression/test011.t @@ -1,2 +1 @@ - $ LAMA=../runtime ../src/Driver.exe -i test011.lama < test011.input - 2 +../src/Driver.exe -i test011.lama < test011.input diff --git a/regression/test012.t b/regression/test012.t index b8a3d94e8..fac4dea6b 100644 --- a/regression/test012.t +++ b/regression/test012.t @@ -1,9 +1 @@ - $ LAMA=../runtime ../src/Driver.exe -i test012.lama < test012.input - > 0 - 0 - 0 - 1 - 1 - 0 - 1 - 1 +../src/Driver.exe -i test012.lama < test012.input diff --git a/regression/test013.t b/regression/test013.t index 145b6a275..493873179 100644 --- a/regression/test013.t +++ b/regression/test013.t @@ -1,9 +1 @@ - $ LAMA=../runtime ../src/Driver.exe -i test013.lama < test013.input - > 10 - 11 - 10 - 11 - 3 - 2 - 1 - 0 +../src/Driver.exe -i test013.lama < test013.input diff --git a/regression/test014.t b/regression/test014.t index a0f47c6fb..49d8952cc 100644 --- a/regression/test014.t +++ b/regression/test014.t @@ -1,32 +1 @@ - $ LAMA=../runtime ../src/Driver.exe -i test014.lama < test014.input - > 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 - 1 +../src/Driver.exe -i test014.lama < test014.input diff --git a/regression/test015.t b/regression/test015.t index cbad48b85..f9ddce64c 100644 --- a/regression/test015.t +++ b/regression/test015.t @@ -1,2 +1 @@ - $ LAMA=../runtime ../src/Driver.exe -i test015.lama < test015.input - > 7919 +../src/Driver.exe -i test015.lama < test015.input diff --git a/regression/test016.t b/regression/test016.t index 61155d80b..f6f8f2192 100644 --- a/regression/test016.t +++ b/regression/test016.t @@ -1,2 +1 @@ - $ LAMA=../runtime ../src/Driver.exe -i test016.lama < test016.input - > 3628800 +../src/Driver.exe -i test016.lama < test016.input diff --git a/regression/test017.t b/regression/test017.t index 984817468..fa04ef09e 100644 --- a/regression/test017.t +++ b/regression/test017.t @@ -1,2 +1 @@ - $ LAMA=../runtime ../src/Driver.exe -i test017.lama < test017.input - > 6765 +../src/Driver.exe -i test017.lama < test017.input diff --git a/regression/test018.t b/regression/test018.t index a932bd5e3..42a4701da 100644 --- a/regression/test018.t +++ b/regression/test018.t @@ -1,15 +1 @@ - $ LAMA=../runtime ../src/Driver.exe -i test018.lama < test018.input - > 2 - 0 - 3 - 4 - 5 - 0 - 7 - 0 - 11 - 0 - 13 - 0 - 17 - 2 +../src/Driver.exe -i test018.lama < test018.input diff --git a/regression/test019.t b/regression/test019.t index fc0330654..1947812a4 100644 --- a/regression/test019.t +++ b/regression/test019.t @@ -1,2 +1 @@ - $ LAMA=../runtime ../src/Driver.exe -i test019.lama < test019.input - 499950 +../src/Driver.exe -i test019.lama < test019.input diff --git a/regression/test020.t b/regression/test020.t index ed64591f8..b0e4d51fc 100644 --- a/regression/test020.t +++ b/regression/test020.t @@ -1,2 +1 @@ - $ LAMA=../runtime ../src/Driver.exe -i test020.lama < test020.input - > 7919 +../src/Driver.exe -i test020.lama < test020.input diff --git a/regression/test021.t b/regression/test021.t index 546f9bdec..31f982bbf 100644 --- a/regression/test021.t +++ b/regression/test021.t @@ -1,2 +1 @@ - $ LAMA=../runtime ../src/Driver.exe -i test021.lama < test021.input - > 3628800 +../src/Driver.exe -i test021.lama < test021.input diff --git a/regression/test022.t b/regression/test022.t index 248a58489..d67a80d70 100644 --- a/regression/test022.t +++ b/regression/test022.t @@ -1,2 +1 @@ - $ LAMA=../runtime ../src/Driver.exe -i test022.lama < test022.input - > 6765 +../src/Driver.exe -i test022.lama < test022.input diff --git a/regression/test023.t b/regression/test023.t index 9afbc61b3..1e1c4f2c0 100644 --- a/regression/test023.t +++ b/regression/test023.t @@ -1,2 +1 @@ - $ LAMA=../runtime ../src/Driver.exe -i test023.lama < test023.input - > > > > > > 35 +../src/Driver.exe -i test023.lama < test023.input diff --git a/regression/test024.t b/regression/test024.t index f71f291ed..12e31baaf 100644 --- a/regression/test024.t +++ b/regression/test024.t @@ -1,3 +1 @@ - $ LAMA=../runtime ../src/Driver.exe -i test024.lama < test024.input - > 3 - 8 +../src/Driver.exe -i test024.lama < test024.input diff --git a/regression/test025.t b/regression/test025.t index 0f6a417b8..381b5ae73 100644 --- a/regression/test025.t +++ b/regression/test025.t @@ -1,13 +1 @@ - $ LAMA=../runtime ../src/Driver.exe -i test025.lama < test025.input - > 1 - 100 - 200 - 300 - 2 - 100 - 200 - 300 - 3 - 100 - 200 - 300 +../src/Driver.exe -i test025.lama < test025.input diff --git a/regression/test026.t b/regression/test026.t index b64cee1d8..f17bf0b57 100644 --- a/regression/test026.t +++ b/regression/test026.t @@ -1,22 +1 @@ - $ LAMA=../runtime ../src/Driver.exe -i test026.lama < test026.input - > 1 - 100 - 200 - 300 - 100 - 200 - 300 - 2 - 100 - 200 - 300 - 100 - 200 - 300 - 3 - 100 - 200 - 300 - 100 - 200 - 300 +../src/Driver.exe -i test026.lama < test026.input diff --git a/regression/test027.t b/regression/test027.t index 3cfdc9cda..6f084b3cb 100644 --- a/regression/test027.t +++ b/regression/test027.t @@ -1,36 +1 @@ - $ LAMA=../runtime ../src/Driver.exe -i test027.lama < test027.input - > 1 - 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 +../src/Driver.exe -i test027.lama < test027.input diff --git a/regression/test028.t b/regression/test028.t index a38cd379c..0e6cda558 100644 --- a/regression/test028.t +++ b/regression/test028.t @@ -1,15 +1 @@ - $ LAMA=../runtime ../src/Driver.exe -i test028.lama < test028.input - > 7 - 5040 - 6 - 720 - 5 - 120 - 4 - 24 - 3 - 6 - 2 - 2 - 1 - 1 +../src/Driver.exe -i test028.lama < test028.input diff --git a/regression/test029.t b/regression/test029.t index 3c8e3d1b4..16b77f481 100644 --- a/regression/test029.t +++ b/regression/test029.t @@ -1,19 +1 @@ - $ LAMA=../runtime ../src/Driver.exe -i test029.lama < test029.input - > 9 - 55 - 8 - 34 - 7 - 21 - 6 - 13 - 5 - 8 - 4 - 5 - 3 - 3 - 2 - 2 - 1 - 1 +../src/Driver.exe -i test029.lama < test029.input diff --git a/regression/test034.t b/regression/test034.t index 4b7e217a9..64b41c482 100644 --- a/regression/test034.t +++ b/regression/test034.t @@ -1,17 +1 @@ - $ LAMA=../runtime ../src/Driver.exe -i test034.lama < test034.input - > 97 - 98 - 99 - 100 - 101 - 102 - 103 - 104 - 99 - 100 - 101 - 102 - 103 - 104 - 105 - 106 +../src/Driver.exe -i test034.lama < test034.input diff --git a/regression/test036.t b/regression/test036.t index 3998c0fe5..6d3cdff7f 100644 --- a/regression/test036.t +++ b/regression/test036.t @@ -1,17 +1 @@ - $ LAMA=../runtime ../src/Driver.exe -i test036.lama < test036.input - > 97 - 98 - 99 - 100 - 101 - 102 - 103 - 104 - 97 - 97 - 97 - 97 - 97 - 97 - 97 - 97 +../src/Driver.exe -i test036.lama < test036.input diff --git a/regression/test040.t b/regression/test040.t index 76a6b7fae..66571d303 100644 --- a/regression/test040.t +++ b/regression/test040.t @@ -1,5 +1 @@ - $ LAMA=../runtime ../src/Driver.exe -i test040.lama < test040.input - > 1 - 2 - 3 - 4 +../src/Driver.exe -i test040.lama < test040.input diff --git a/regression/test041.t b/regression/test041.t index 953e9fea3..9f627a82e 100644 --- a/regression/test041.t +++ b/regression/test041.t @@ -1,3 +1 @@ - $ LAMA=../runtime ../src/Driver.exe -i test041.lama < test041.input - > 600 - 1800 +../src/Driver.exe -i test041.lama < test041.input diff --git a/regression/test042.t b/regression/test042.t index 784d9c99a..259a4823f 100644 --- a/regression/test042.t +++ b/regression/test042.t @@ -1,11 +1 @@ - $ LAMA=../runtime ../src/Driver.exe -i test042.lama < test042.input - > 0 - 1 - 2 - 3 - 4 - 4 - 4 - 4 - 4 - 4 +../src/Driver.exe -i test042.lama < test042.input diff --git a/regression/test045.t b/regression/test045.t index 12f718072..941f0203a 100644 --- a/regression/test045.t +++ b/regression/test045.t @@ -1,41 +1 @@ - $ LAMA=../runtime ../src/Driver.exe -i test045.lama < test045.input - > 49 - 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 +../src/Driver.exe -i test045.lama < test045.input diff --git a/regression/test046.t b/regression/test046.t index 0ab3a1933..e1c63fc96 100644 --- a/regression/test046.t +++ b/regression/test046.t @@ -1,14 +1 @@ - $ LAMA=../runtime ../src/Driver.exe -i test046.lama < test046.input - > 3 - 3 - 3 - 1 - 2 - 3 - 5 - 5 - 1 - 2 - 3 - 4 - 5 +../src/Driver.exe -i test046.lama < test046.input diff --git a/regression/test050.t b/regression/test050.t index 1806c8c1b..c3dfe3cb1 100644 --- a/regression/test050.t +++ b/regression/test050.t @@ -1,2 +1 @@ - $ LAMA=../runtime ../src/Driver.exe -i test050.lama < test050.input - > 2 +../src/Driver.exe -i test050.lama < test050.input diff --git a/regression/test054.t b/regression/test054.t index b8ba38380..b202bd30e 100644 --- a/regression/test054.t +++ b/regression/test054.t @@ -1,14 +1 @@ - $ LAMA=../runtime ../src/Driver.exe -i test054.lama < test054.input - > 105 - 105 - 105 - 230 - 105 - 105 - 105 - 230 - 105 - 250 - 1 - 2 - 3 +../src/Driver.exe -i test054.lama < test054.input diff --git a/regression/test059.t b/regression/test059.t index d4fdcfc01..1130f8c4c 100644 --- a/regression/test059.t +++ b/regression/test059.t @@ -1,4 +1 @@ - $ LAMA=../runtime ../src/Driver.exe -i test059.lama < test059.input - > 0 - 1 - 2 +../src/Driver.exe -i test059.lama < test059.input diff --git a/regression/test063.t b/regression/test063.t index 324869734..7b7bef0d1 100644 --- a/regression/test063.t +++ b/regression/test063.t @@ -1,3 +1 @@ - $ LAMA=../runtime ../src/Driver.exe -i test063.lama < test063.input - > 100 - 200 +../src/Driver.exe -i test063.lama < test063.input diff --git a/regression/test072.t b/regression/test072.t index de6947dc0..4514f098c 100644 --- a/regression/test072.t +++ b/regression/test072.t @@ -1,19 +1 @@ - $ LAMA=../runtime ../src/Driver.exe -i test072.lama < test072.input - > 9 - 55 - 8 - 34 - 7 - 21 - 6 - 13 - 5 - 8 - 4 - 5 - 3 - 3 - 2 - 2 - 1 - 1 +../src/Driver.exe -i test072.lama < test072.input diff --git a/regression/test073.t b/regression/test073.t index 7896db913..8e2145f19 100644 --- a/regression/test073.t +++ b/regression/test073.t @@ -1,15 +1 @@ - $ LAMA=../runtime ../src/Driver.exe -i test073.lama < test073.input - > 7 - 5040 - 6 - 720 - 5 - 120 - 4 - 24 - 3 - 6 - 2 - 2 - 1 - 1 +../src/Driver.exe -i test073.lama < test073.input diff --git a/regression/test074.t b/regression/test074.t index 1f8f8e865..217fee840 100644 --- a/regression/test074.t +++ b/regression/test074.t @@ -1,37 +1 @@ - $ LAMA=../runtime ../src/Driver.exe -i test074.lama < test074.input - > 1 - 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 +../src/Driver.exe -i test074.lama < test074.input diff --git a/regression/test077.t b/regression/test077.t index ffa587bce..da9a8d7f8 100644 --- a/regression/test077.t +++ b/regression/test077.t @@ -1,7 +1 @@ - $ LAMA=../runtime ../src/Driver.exe -i test077.lama < test077.input - > 5 - 6 - 7 - 8 - 9 - 10 +../src/Driver.exe -i test077.lama < test077.input diff --git a/regression/test078.t b/regression/test078.t index d0d87f6b1..26e49ccff 100644 --- a/regression/test078.t +++ b/regression/test078.t @@ -1,13 +1 @@ - $ LAMA=../runtime ../src/Driver.exe -i test078.lama < test078.input - > 1 - 2 - 3 - 4 - 1 - 2 - 3 - 4 - 3 - 4 - 1 - 2 +../src/Driver.exe -i test078.lama < test078.input diff --git a/regression/test079.t b/regression/test079.t index 86b1be4e0..9045f9f48 100644 --- a/regression/test079.t +++ b/regression/test079.t @@ -1,7 +1 @@ - $ LAMA=../runtime ../src/Driver.exe -i test079.lama < test079.input - > 1 - 1 - 1 - 1 - 0 - 0 +../src/Driver.exe -i test079.lama < test079.input diff --git a/regression/test080.t b/regression/test080.t index 7dd4b6546..7f688f7a2 100644 --- a/regression/test080.t +++ b/regression/test080.t @@ -1,4 +1 @@ - $ LAMA=../runtime ../src/Driver.exe -i test080.lama < test080.input - > 0 - 100 - 300 +../src/Driver.exe -i test080.lama < test080.input diff --git a/regression/test081.t b/regression/test081.t index 64532d478..a20c3dceb 100644 --- a/regression/test081.t +++ b/regression/test081.t @@ -1,7 +1 @@ - $ LAMA=../runtime ../src/Driver.exe -i test081.lama < test081.input - > 1 - 2 - 3 - 100 - 200 - 300 +../src/Driver.exe -i test081.lama < test081.input diff --git a/regression/test082.t b/regression/test082.t index c83a10b24..2fd67b8ba 100644 --- a/regression/test082.t +++ b/regression/test082.t @@ -1,18 +1 @@ - $ LAMA=../runtime ../src/Driver.exe -i test082.lama < test082.input - > 1 - 1 - 1 - 1 - 1 - 2 - 3 - 100 - 3 - 2 - 1 - 6 - 5 - 4 - 3 - 2 - 1 +../src/Driver.exe -i test082.lama < test082.input diff --git a/regression/test083.t b/regression/test083.t index f2375351a..a5dc4151b 100644 --- a/regression/test083.t +++ b/regression/test083.t @@ -1,4 +1 @@ - $ LAMA=../runtime ../src/Driver.exe -i test083.lama < test083.input - > 7 - 7 - 28 +../src/Driver.exe -i test083.lama < test083.input diff --git a/regression/test084.t b/regression/test084.t index 248264dce..ff1add100 100644 --- a/regression/test084.t +++ b/regression/test084.t @@ -1,4 +1 @@ - $ LAMA=../runtime ../src/Driver.exe -i test084.lama < test084.input - > 55 - 310 - 310 +../src/Driver.exe -i test084.lama < test084.input diff --git a/regression/test085.t b/regression/test085.t index 81e57944d..7b916fbaf 100644 --- a/regression/test085.t +++ b/regression/test085.t @@ -1,9 +1 @@ - $ LAMA=../runtime ../src/Driver.exe -i test085.lama < test085.input - > 0 - 15 - 15 - 1 - 2 - 3 - 4 - 5 +../src/Driver.exe -i test085.lama < test085.input diff --git a/regression/test086.t b/regression/test086.t index 52604ce77..1ff07af84 100644 --- a/regression/test086.t +++ b/regression/test086.t @@ -1,4 +1 @@ - $ LAMA=../runtime ../src/Driver.exe -i test086.lama < test086.input - > 1 - 2 - 3 +../src/Driver.exe -i test086.lama < test086.input diff --git a/regression/test088.t b/regression/test088.t index e090b76aa..0cf3b7c10 100644 --- a/regression/test088.t +++ b/regression/test088.t @@ -1,3 +1 @@ - $ LAMA=../runtime ../src/Driver.exe -i test088.lama < test088.input - 0 - 3 +../src/Driver.exe -i test088.lama < test088.input diff --git a/regression/test089.t b/regression/test089.t index 5ff3b8b6c..b2b6acb8d 100644 --- a/regression/test089.t +++ b/regression/test089.t @@ -1,2 +1 @@ - $ LAMA=../runtime ../src/Driver.exe -i test089.lama < test089.input - > > > 8 +../src/Driver.exe -i test089.lama < test089.input diff --git a/regression/test090.t b/regression/test090.t index 378dda424..9422a2443 100644 --- a/regression/test090.t +++ b/regression/test090.t @@ -1,4 +1 @@ - $ LAMA=../runtime ../src/Driver.exe -i test090.lama < test090.input - > 6 - 7 - 8 +../src/Driver.exe -i test090.lama < test090.input diff --git a/regression/test091.t b/regression/test091.t index d703619c3..eb917b877 100644 --- a/regression/test091.t +++ b/regression/test091.t @@ -1,10 +1 @@ - $ LAMA=../runtime ../src/Driver.exe -i test091.lama < test091.input - > 1 - 2 - 3 - 2 - 3 - 4 - 3 - 4 - 5 +../src/Driver.exe -i test091.lama < test091.input diff --git a/regression/test092.t b/regression/test092.t index f8f6563db..74139f238 100644 --- a/regression/test092.t +++ b/regression/test092.t @@ -1,6 +1 @@ - $ LAMA=../runtime ../src/Driver.exe -i test092.lama < test092.input - > 1 - 1 - 1 - 1 - 0 +../src/Driver.exe -i test092.lama < test092.input diff --git a/regression/test093.t b/regression/test093.t index 4d06b40f9..362441437 100644 --- a/regression/test093.t +++ b/regression/test093.t @@ -1,3 +1 @@ - $ LAMA=../runtime ../src/Driver.exe -i test093.lama < test093.input - > 11 - 18 +../src/Driver.exe -i test093.lama < test093.input diff --git a/regression/test094.t b/regression/test094.t index d57d4bde3..d18622acd 100644 --- a/regression/test094.t +++ b/regression/test094.t @@ -1,5 +1 @@ - $ LAMA=../runtime ../src/Driver.exe -i test094.lama < test094.input - > 5 - 7 - 12 - -2 +../src/Driver.exe -i test094.lama < test094.input diff --git a/regression/test095.t b/regression/test095.t index 8f98b32bd..651d7696d 100644 --- a/regression/test095.t +++ b/regression/test095.t @@ -1,2 +1 @@ - $ LAMA=../runtime ../src/Driver.exe -i test095.lama < test095.input - > 5 +../src/Driver.exe -i test095.lama < test095.input diff --git a/regression/test096.t b/regression/test096.t index a37d3219a..7f0ea2ae0 100644 --- a/regression/test096.t +++ b/regression/test096.t @@ -1,3 +1 @@ - $ LAMA=../runtime ../src/Driver.exe -i test096.lama < test096.input - > 2 - 1 +../src/Driver.exe -i test096.lama < test096.input diff --git a/regression/test097.t b/regression/test097.t index e9b227d52..9f8879a0d 100644 --- a/regression/test097.t +++ b/regression/test097.t @@ -1,2 +1 @@ - $ LAMA=../runtime ../src/Driver.exe -i test097.lama < test097.input - > 35 +../src/Driver.exe -i test097.lama < test097.input diff --git a/regression/test098.t b/regression/test098.t index 4869149a3..1275c34cb 100644 --- a/regression/test098.t +++ b/regression/test098.t @@ -1,2 +1 @@ - $ LAMA=../runtime ../src/Driver.exe -i test098.lama < test098.input - > 12 +../src/Driver.exe -i test098.lama < test098.input diff --git a/regression/test099.t b/regression/test099.t index e25631b63..65189afd5 100644 --- a/regression/test099.t +++ b/regression/test099.t @@ -1,4 +1 @@ - $ LAMA=../runtime ../src/Driver.exe -i test099.lama < test099.input - > 1 - 800 - 800 +../src/Driver.exe -i test099.lama < test099.input diff --git a/regression/test100.t b/regression/test100.t index 98987a174..241838524 100644 --- a/regression/test100.t +++ b/regression/test100.t @@ -1,2 +1 @@ - $ LAMA=../runtime ../src/Driver.exe -i test100.lama < test100.input - > 0 +../src/Driver.exe -i test100.lama < test100.input diff --git a/regression/test101.t b/regression/test101.t index 1ce66632f..c7e25912d 100644 --- a/regression/test101.t +++ b/regression/test101.t @@ -1,2 +1 @@ - $ LAMA=../runtime ../src/Driver.exe -i test101.lama < test101.input - > 0 +../src/Driver.exe -i test101.lama < test101.input diff --git a/regression/test102.t b/regression/test102.t index 73575c98a..578e1a7c6 100644 --- a/regression/test102.t +++ b/regression/test102.t @@ -1,2 +1 @@ - $ LAMA=../runtime ../src/Driver.exe -i test102.lama < test102.input - > 5 +../src/Driver.exe -i test102.lama < test102.input diff --git a/regression/test103.t b/regression/test103.t index cb08e6cf1..ec132c965 100644 --- a/regression/test103.t +++ b/regression/test103.t @@ -1,2 +1 @@ - $ LAMA=../runtime ../src/Driver.exe -i test103.lama < test103.input - > > > 5 +../src/Driver.exe -i test103.lama < test103.input diff --git a/regression/test104.t b/regression/test104.t index fb53d8a92..2e09c6f65 100644 --- a/regression/test104.t +++ b/regression/test104.t @@ -1,11 +1 @@ - $ LAMA=../runtime ../src/Driver.exe -i test104.lama < test104.input - > 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 +../src/Driver.exe -i test104.lama < test104.input diff --git a/regression/test105.t b/regression/test105.t index c84d97686..00be90841 100644 --- a/regression/test105.t +++ b/regression/test105.t @@ -1,2 +1 @@ - $ LAMA=../runtime ../src/Driver.exe -i test105.lama < test105.input - > 3 +../src/Driver.exe -i test105.lama < test105.input diff --git a/regression/test106.t b/regression/test106.t index f3b604992..834a5d9b1 100644 --- a/regression/test106.t +++ b/regression/test106.t @@ -1,3 +1 @@ - $ LAMA=../runtime ../src/Driver.exe -i test106.lama < test106.input - > 1 - 2 +../src/Driver.exe -i test106.lama < test106.input diff --git a/regression/test107.t b/regression/test107.t index e014f90b8..da02b20f5 100644 --- a/regression/test107.t +++ b/regression/test107.t @@ -1,2 +1 @@ - $ LAMA=../runtime ../src/Driver.exe -i test107.lama < test107.input - > 0 +../src/Driver.exe -i test107.lama < test107.input diff --git a/regression/test110.t b/regression/test110.t index b948c7a1f..bf864a6bf 100644 --- a/regression/test110.t +++ b/regression/test110.t @@ -1,7 +1 @@ - $ LAMA=../runtime ../src/Driver.exe -i test110.lama < test110.input - > 0 - 0 - 10 - 0 - 10 - 100 +../src/Driver.exe -i test110.lama < test110.input diff --git a/regression/test111.t b/regression/test111.t index 89bd9eb3e..46ec0f0ad 100644 --- a/regression/test111.t +++ b/regression/test111.t @@ -1,3 +1 @@ - $ LAMA=../runtime ../src/Driver.exe -i test111.lama < test111.input - Error: undefined name "stringcat" at (11, 15) - [255] +../src/Driver.exe -i test111.lama < test111.input diff --git a/regression/test112.t b/regression/test112.t index ce76a15e5..ffae84ee3 100644 --- a/regression/test112.t +++ b/regression/test112.t @@ -1,12 +1 @@ - $ LAMA=../runtime ../src/Driver.exe -i test112.lama < test112.input - 1 - 2 - 5 - 6 - 7 - 8 - 5 - 6 - 7 - 8 - 3 +../src/Driver.exe -i test112.lama < test112.input diff --git a/regression/test801.t b/regression/test801.t index 2c4f231ae..a90135b36 100644 --- a/regression/test801.t +++ b/regression/test801.t @@ -1,6 +1 @@ - $ LAMA=../runtime ../src/Driver.exe -i test801.lama < test801.input - 1 - 2 - 3 - 4 - 5 +../src/Driver.exe -i test801.lama < test801.input diff --git a/regression/test802.t b/regression/test802.t index e5aed0926..5ae68579e 100644 --- a/regression/test802.t +++ b/regression/test802.t @@ -1,11 +1 @@ - $ LAMA=../runtime ../src/Driver.exe -i test802.lama < test802.input - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 +../src/Driver.exe -i test802.lama < test802.input diff --git a/regression/test803.t b/regression/test803.t index 064a4a5bb..059c0db45 100644 --- a/regression/test803.t +++ b/regression/test803.t @@ -1,3 +1 @@ - $ LAMA=../runtime ../src/Driver.exe -i test803.lama < test803.input - Fatal error: exception Failure("int value expected (Closure ([\"unit\"], , ))\n") - [2] +../src/Driver.exe -i test803.lama < test803.input diff --git a/src/Driver.ml b/src/Driver.ml index a5bcdd6c5..c57a919fb 100644 --- a/src/Driver.ml +++ b/src/Driver.ml @@ -15,7 +15,7 @@ let[@ocaml.warning "-32"] main = | `Default | `Compile -> ( match cmd#march with | `X86_32 -> ignore @@ X86_32.build cmd prog - | `AMD64 -> ignore @@ X86_64.build cmd prog) + | `AMD64 -> ignore @@ X86_64.build cmd prog) | `BC -> SM.ByteCode.compile cmd (SM.compile cmd prog) | _ -> let rec read acc = diff --git a/src/Options.ml b/src/Options.ml index 81b48a733..045f91d9d 100644 --- a/src/Options.ml +++ b/src/Options.ml @@ -8,7 +8,8 @@ class options args = let dump_sm = 0b010 in let dump_source = 0b100 in (* Kakadu: binary masks are cool for C code, but for OCaml I don't see any reason to save memory like this *) - let runtime_path_ = + (* DB: that's not to save memory, but to ease the check :^) *) + let generic_runtime_path = match Sys.getenv_opt "LAMA" with Some s -> s | None -> Stdpath.path in let host_os = @@ -22,20 +23,24 @@ class options args = "Lama compiler. (C) JetBrains Reserach, 2017-2024.\n" ^ "Usage: lamac \n\n" ^ "When no options specified, builds the source file into executable.\n" - ^ "Options:\n" ^ " -c --- compile into object file\n" - ^ " -o --- write executable into file \n" - ^ " -I --- add into unit search path list\n" - ^ " -i --- interpret on a source-level interpreter\n" - ^ " -s --- compile into stack machine code and interpret on the \ - stack machine initerpreter\n" - ^ " -g --- add more debug info and runtime checks\n" - ^ " -dp --- dump AST (the output will be written into .ast file)\n" - ^ " -dsrc --- dump pretty-printed source code\n" - ^ " -ds --- dump stack machine code (the output will be written \ - into .sm file; has no\n" - ^ " effect if -i option is specfied)\n" - ^ " -b --- compile to a stack machine bytecode\n" - ^ " -v --- show version\n" ^ " -h --- show this help\n" + ^ "Options:\n" + ^ " -c --- compile into object file\n" + ^ " -o --- write executable into file \n" + ^ " -I --- add into unit search path list\n" + ^ " -i --- interpret on a source-level interpreter\n" + ^ " -s --- compile into stack machine code and interpret on the \ + stack machine initerpreter\n" + ^ " -g --- add more debug info and runtime checks\n" + ^ " -dp --- dump AST (the output will be written into .ast file)\n" + ^ " -dsrc --- dump pretty-printed source code\n" + ^ " -ds --- dump stack machine code (the output will be written \ + into .sm file; has no\n" + ^ " effect if -i option is specfied)\n" + ^ " -b --- compile to a stack machine bytecode\n" + ^ " -64 --- set native compiler target to X86_64 (default)\n" + ^ " -32 --- set native compiler target to X86_32\n" + ^ " -runtime --- set a path to runtime explicitly\n" + ^ " -v --- show version\n" ^ " -h --- show this help\n" in object (self) val version = ref false @@ -44,8 +49,9 @@ class options args = val infile = ref (None : string option) val outfile = ref (None : string option) val march = ref `AMD64 - val runtime_path = runtime_path_ - val paths = ref [ runtime_path_ ] + val runtime_path = generic_runtime_path + val explicit_runtime_path = ref None + val paths = ref [] val mode = ref (`Default : [ `Default | `Eval | `SM | `Compile | `BC ]) val curdir = Unix.getcwd () val debug = ref false @@ -80,16 +86,23 @@ class options args = raise (Commandline_error "Path expected after '-I' specifier") | Some path -> self#add_include_path path) - | "-march=x86_64" | "-march=amd64" -> march := `AMD64 - | "-march=x86" -> march := `X86_32 - | "-s" -> self#set_mode `SM - | "-b" -> self#set_mode `BC - | "-i" -> self#set_mode `Eval - | "-ds" -> self#set_dump dump_sm - | "-dsrc" -> self#set_dump dump_source - | "-dp" -> self#set_dump dump_ast - | "-h" -> self#set_help - | "-v" -> self#set_version + | "-64" -> march := `AMD64 + | "-32" -> march := `X86_32 + | "-s" -> self#set_mode `SM + | "-b" -> self#set_mode `BC + | "-i" -> self#set_mode `Eval + | "-ds" -> self#set_dump dump_sm + | "-dsrc" -> self#set_dump dump_source + | "-dp" -> self#set_dump dump_ast + | "-h" -> self#set_help + | "-v" -> self#set_version + | "-runtime" -> + (match self#peek with + | None -> + raise + (Commandline_error "Path expected after '-runtime' specifier") + | Some path -> self#set_runtime_path path + ) | "-g" -> set_debug () | _ -> if opt.[0] = '-' then @@ -142,6 +155,8 @@ class options args = Some args.(j)) else None + method private set_runtime_path path = explicit_runtime_path := Some path + method march : [ `AMD64 | `X86_32 ] = !march method get_debug = "" method get_mode = !mode @@ -161,8 +176,12 @@ class options args = | Some name -> name method get_help = !help - method get_include_paths = !paths - method get_runtime_path = runtime_path + method get_include_paths = self#get_runtime_path :: !paths + method get_runtime_path = + match !explicit_runtime_path with + | None -> + runtime_path ^ (match self#march with `X86_32 -> "/x32" | _ -> "/x64") + | Some p -> p method basename = Filename.chop_suffix (Filename.basename self#get_infile) ".lama" diff --git a/src/X86_32.ml b/src/X86_32.ml index ed70a9241..e6b20350e 100644 --- a/src/X86_32.ml +++ b/src/X86_32.ml @@ -807,11 +807,6 @@ let genasm cmd prog = code); Buffer.contents asm -let get_std_path () = - match Sys.getenv_opt "LAMA" with - | Some s -> s - | None -> Stdpath.path - (* Builds a program: generates the assembler file and compiles it with the gcc toolchain *) let build cmd prog = let find_objects imports paths = @@ -834,7 +829,7 @@ let build cmd prog = in cmd#dump_file "s" (genasm cmd prog); cmd#dump_file "i" (Interface.gen prog); - let inc = get_std_path () in + let inc = cmd#get_runtime_path in match cmd#get_mode with | `Default -> let objs = find_objects (fst @@ fst prog) cmd#get_include_paths in diff --git a/stdlib/x32/dune b/stdlib/x32/dune index 75d89f945..3cd4554b7 100644 --- a/stdlib/x32/dune +++ b/stdlib/x32/dune @@ -58,5 +58,5 @@ "../../runtime32" (setenv LAMAC - "../../src/Driver.exe -march=x86 -I ../runtime32" + "../../src/Driver.exe -32 -I ../../runtime32" (run make -j2 -f ../Makefile all))))))) diff --git a/stdlib/x64/dune b/stdlib/x64/dune index 433c312d4..a125b6bb0 100644 --- a/stdlib/x64/dune +++ b/stdlib/x64/dune @@ -55,5 +55,5 @@ "../../runtime" (setenv LAMAC - "../../src/Driver.exe -march=amd64 -I ../runtime" + "../../src/Driver.exe -64 -I ../../runtime" (run make -j2 -f ../Makefile all))))))) diff --git a/tutorial/dune b/tutorial/dune index c819d913d..9da618d90 100644 --- a/tutorial/dune +++ b/tutorial/dune @@ -11,11 +11,11 @@ "../runtime32" (run %{project_root}/src/Driver.exe - -march=x86 + -32 %{lama} -I ../stdlib/x32 - -I + -runtime ../runtime32 -o %{targets})))) @@ -32,11 +32,11 @@ "../runtime" (run %{project_root}/src/Driver.exe - -march=x86_64 + -64 %{lama} -I ../stdlib/x64 - -I + -runtime ../runtime -o %{targets})))) @@ -53,11 +53,11 @@ "../runtime32" (run %{project_root}/src/Driver.exe - -march=x86 + -32 %{lama} -I ../stdlib/x32 - -I + -runtime ../runtime32 -o %{targets})))) @@ -74,11 +74,11 @@ "../runtime" (run %{project_root}/src/Driver.exe - -march=x86_64 + -64 %{lama} -I ../stdlib/x64 - -I + -runtime ../runtime -o %{targets})))) @@ -95,11 +95,11 @@ "../runtime32" (run %{project_root}/src/Driver.exe - -march=x86 + -32 %{lama} -I ../stdlib/x32 - -I + -runtime ../runtime32 -o %{targets})))) @@ -116,11 +116,11 @@ "../runtime" (run %{project_root}/src/Driver.exe - -march=x86_64 + -64 %{lama} -I ../stdlib/x64 - -I + -runtime ../runtime -o %{targets})))) @@ -137,11 +137,11 @@ "../runtime32" (run %{project_root}/src/Driver.exe - -march=x86 + -32 %{lama} -I ../stdlib/x32 - -I + -runtime ../runtime32 -o %{targets})))) @@ -158,11 +158,11 @@ "../runtime" (run %{project_root}/src/Driver.exe - -march=x86_64 + -64 %{lama} -I ../stdlib/x64 - -I + -runtime ../runtime -o %{targets})))) @@ -179,11 +179,11 @@ "../runtime32" (run %{project_root}/src/Driver.exe - -march=x86 + -32 %{lama} -I ../stdlib/x32 - -I + -runtime ../runtime32 -o %{targets})))) @@ -200,11 +200,11 @@ "../runtime" (run %{project_root}/src/Driver.exe - -march=x86_64 + -64 %{lama} -I ../stdlib/x64 - -I + -runtime ../runtime -o %{targets}))))