Skip to content

Commit

Permalink
Add a test for divergence, Div.exe should reach a 1 second timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
mtzguido committed Sep 10, 2024
1 parent 78f249a commit 084979d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
7 changes: 7 additions & 0 deletions tests/extraction/Div.fst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module Div

let rec f () : Dv int = f ()

let _ =
let _ = f () in
1
9 changes: 8 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
all: inline_let all_cmi Eta_expand.test Div.test

%.exe: %.fst | out
$(FSTAR) $(FSTAR_DEFAULT_ARGS) --odir out --codegen OCaml $<
Expand All @@ -13,6 +13,13 @@ all: inline_let all_cmi Eta_expand.test
$(Q)./$<
$(Q)touch $@

Div.test: Div.exe
$(call msg,TIMEOUT,$<)
$(Q)timeout 1 ./Div.exe ; \
RC=$$? ;\
if ! [ $$RC -eq 124 ]; then echo "ERROR: Div.exe terminated!?!?!"; false; fi
$(Q)touch $@

inline_let: InlineLet.fst
$(FSTAR) --codegen OCaml InlineLet.fst
egrep -A 10 test InlineLet.ml | grep -qs "17"
Expand Down

0 comments on commit 084979d

Please sign in to comment.