aboutsummaryrefslogtreecommitdiffhomepage
path: root/test-suite/complexity/guard.v
diff options
context:
space:
mode:
Diffstat (limited to 'test-suite/complexity/guard.v')
-rw-r--r--test-suite/complexity/guard.v15
1 files changed, 14 insertions, 1 deletions
diff --git a/test-suite/complexity/guard.v b/test-suite/complexity/guard.v
index 387263e2f..ceb7835a6 100644
--- a/test-suite/complexity/guard.v
+++ b/test-suite/complexity/guard.v
@@ -1,4 +1,4 @@
-(* Examples to check that the guard condition does not unfold
+(* Examples to check that the guard condition does not evaluate
irrelevant subterms *)
(* Expected time < 1.00s *)
Require Import Bool.
@@ -15,3 +15,16 @@ Timeout 5 Time Fixpoint F n :=
| S k =>
if slow 100 then F k else 0
end.
+
+Fixpoint slow2 n :=
+ match n with
+ | 0 => 0
+ | S k => slow2 k + slow2 k
+ end.
+
+Timeout 5 Time Fixpoint F' n :=
+ match n with
+ | 0 => 0
+ | S k =>
+ if slow2 100 then F' k else 0
+ end.