forked from ocaml-flambda/flambda-backend
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Import flexpect from old repo and add to Makefile/dune (ocaml-flambda…
…#340) You can now `make runtest` to run a couple of tests. One of them is an `flexpect`-based test, with a functioning `make promote`. (The other is the preexisting `meet_test.ml`, which simply needed to be made a test in `dune`.) There are also the `fldiff` and `parseflambda` utilities from the old repo. `fldiff` might be useful for testing the `Flambda2_compare` module, and `parseflambda` more or less runs the middle end and nothing else.
- Loading branch information
1 parent
3e09dd9
commit 079445c
Showing
13 changed files
with
335 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,12 @@ | ||
(executable | ||
(name meet_test) | ||
(tests | ||
(names meet_test) | ||
(modes native) | ||
(flags (:standard -principal -nostdlib -cclib "-I ../../runtime")) | ||
(libraries ocamloptcomp ocamloptcommon ocamlmiddleend flambda ocamlcommon runtimeopt stdlib) | ||
(modules meet_test)) | ||
(flags (:standard -principal -nostdlib)) | ||
(libraries | ||
stdlib runtime_native ocamloptcomp ocamlcommon | ||
flambda2_bound_identifiers flambda2_cmx flambda2_identifiers flambda2_kinds | ||
flambda2_nominal flambda2_numbers flambda2_term_basics flambda2_types)) | ||
|
||
(include_subdirs no) | ||
|
||
(alias | ||
(name world) | ||
(deps | ||
meet_test.exe | ||
)) | ||
(dirs mlexamples tools) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
(rule | ||
(alias runtest) | ||
(action | ||
(progn | ||
(run ../tools/flexpect.exe tests0.flt) | ||
(diff? tests0.flt tests0.flt.corrected)))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
(executables | ||
(names flexpect fldiff parseflambda) | ||
(modes native) | ||
(flags (:standard -principal -nostdlib)) | ||
(libraries | ||
stdlib runtime_native ocamlcommon ocamloptcomp | ||
flambda2 flambda2_compare flambda2_parser flambda2_terms)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
open Import | ||
|
||
let parse_flambda file = | ||
match | ||
Parse_flambda.parse ~symbol_for_global:Flambda2.symbol_for_global file | ||
with | ||
| Ok unit -> unit | ||
| Error e -> | ||
begin | ||
match e with | ||
| Parsing_error (msg, loc) -> | ||
Format.eprintf "%a:@.Syntax error: %s@." Location.print_loc loc msg | ||
| Lexing_error (error, loc) -> | ||
Format.eprintf "%a:@.Lex error: %a@." Location.print_loc loc | ||
Flambda_lex.pp_error error | ||
end; | ||
exit 1 | ||
|
||
let _ = | ||
let file1 = Sys.argv.(1) in | ||
let file2 = Sys.argv.(2) in | ||
let unit1 = parse_flambda file1 in | ||
let unit2 = parse_flambda file2 in | ||
Format.printf "%a@." | ||
(Compare.Comparison.print Flambda_unit.print) | ||
(Compare.flambda_units unit1 unit2) |
Oops, something went wrong.