Skip to content

Commit

Permalink
add test for no_inline_let pragma
Browse files Browse the repository at this point in the history
  • Loading branch information
amosr committed Oct 9, 2024
1 parent 484b8f1 commit c13a1e2
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/extraction/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FSTAR_EXAMPLES=$(realpath ../../examples)
include $(FSTAR_EXAMPLES)/Makefile.include
include $(FSTAR_ULIB)/ml/Makefile.include

all: inline_let all_cmi Eta_expand.test Div.test
all: inline_let all_cmi Eta_expand.test Div.test no_inline_let

%.exe: %.fst | out
$(FSTAR) $(FSTAR_DEFAULT_ARGS) --odir out --codegen OCaml $<
Expand All @@ -25,6 +25,11 @@ inline_let: InlineLet.fst
egrep -A 10 test InlineLet.ml | grep -qs "17"
@touch $@

no_inline_let: NoInlineLet.fst
$(FSTAR) --codegen OCaml NoInlineLet.fst
diff -u --strip-trailing-cr NoInlineLet.ml.expected NoInlineLet.ml
@touch $@

all_cmi:
+$(MAKE) -C cmi all

Expand Down
11 changes: 11 additions & 0 deletions tests/extraction/NoInlineLet.fst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module NoInlineLet

let test_no_inline (f: int): int =
[@@no_inline_let]
let x = f * 2 in
x + x

[@preprocess_with (fun i -> norm [delta_only [`%test_no_inline]])]
let test_preeprocess (f: int): int =
let x = test_no_inline f in
x
Empty file.

0 comments on commit c13a1e2

Please sign in to comment.