aboutsummaryrefslogtreecommitdiff
path: root/test-suite/success
diff options
context:
space:
mode:
authorJason Gross2020-04-28 15:43:13 -0400
committerJason Gross2020-05-02 13:20:54 -0400
commit570dd44feec40ca2be2dd6a4d46ca5378acdce09 (patch)
treef91db8f27407b764568743f459f3c588a01a9298 /test-suite/success
parent1700c63e82c0b10cbdeda8d79639d925a7571e12 (diff)
LtacProf now handles multi-success backtracking
Fixes #12196
Diffstat (limited to 'test-suite/success')
-rw-r--r--test-suite/success/ltacprof.v17
1 files changed, 17 insertions, 0 deletions
diff --git a/test-suite/success/ltacprof.v b/test-suite/success/ltacprof.v
index d5552695c4..f40f40c2bb 100644
--- a/test-suite/success/ltacprof.v
+++ b/test-suite/success/ltacprof.v
@@ -6,3 +6,20 @@ Goal True.
try (multi; fail). (* Used to result in: Anomaly: Uncaught exception Failure("hd"). Please report. *)
Admitted.
Show Ltac Profile.
+
+(* backtracking across profiler manipulation *)
+Unset Ltac Profiling.
+Reset Ltac Profile.
+
+Fixpoint slow (n : nat) : unit
+ := match n with
+ | 0 => tt
+ | S n => fst (slow n, slow n)
+ end.
+
+Ltac slow := idtac; let v := eval cbv in (slow 16) in idtac.
+Ltac multi2 :=
+ try (((idtac; slow) + (start ltac profiling; slow) + (idtac; slow) + (slow; stop ltac profiling; slow) + slow + (start ltac profiling; (idtac + slow); ((stop ltac profiling + idtac); fail))); slow; fail); slow; show ltac profile.
+Goal True.
+ multi2.
+Admitted.