| 1 |
(** Some LtacProf tests *) |
| 2 |
|
| 3 |
Set Ltac Profiling. |
| 4 |
Ltac multi := (idtac + idtac). |
| 5 |
Goal True. |
| 6 |
try (multi; fail). (* Used to result in: Anomaly: Uncaught exception Failure("hd"). Please report. *) |
| 7 |
Admitted. |
| 8 |
Show Ltac Profile. |
| 9 |
|
| 10 |
(* backtracking across profiler manipulation *) |
| 11 |
Unset Ltac Profiling. |
| 12 |
Reset Ltac Profile. |
| 13 |
|
| 14 |
Fixpoint slow (n : nat) : unit |
| 15 |
:= match n with |
| 16 |
| 0 => tt |
| 17 |
| S n => fst (slow n, slow n) |
| 18 |
end. |
| 19 |
|
| 20 |
Ltac slow := idtac; let v := eval cbv in (slow 16) in idtac. |
| 21 |
Ltac multi2 := |
| 22 |
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. |
| 23 |
Goal True. |
| 24 |
multi2. |
| 25 |
Admitted. |