aboutsummaryrefslogtreecommitdiff
path: root/test-suite
diff options
context:
space:
mode:
authorPierre-Marie Pédrot2020-12-08 10:22:54 +0100
committerPierre-Marie Pédrot2020-12-08 10:27:09 +0100
commite5a5fdb9ad8d57b37729a781b217701ac341f522 (patch)
treeee212b43d2717312d12dafd719e5f2d731fe6408 /test-suite
parent0369080c826171cf18cfa2c8be5024445cb4a2d9 (diff)
Add a test for cbv over inductive types which feature let-bindings.
Diffstat (limited to 'test-suite')
-rw-r--r--test-suite/success/cbv_let.v34
1 files changed, 34 insertions, 0 deletions
diff --git a/test-suite/success/cbv_let.v b/test-suite/success/cbv_let.v
new file mode 100644
index 0000000000..861a73a64e
--- /dev/null
+++ b/test-suite/success/cbv_let.v
@@ -0,0 +1,34 @@
+Record T : Type := Build_T { f : unit; g := pair f f; }.
+
+Definition t : T := {| f := tt; |}.
+
+Goal match t return unit with Build_T f g => f end = tt.
+Proof.
+cbv.
+reflexivity.
+Qed.
+
+Goal match t return prod unit unit with Build_T f g => g end = pair tt tt.
+Proof.
+cbv.
+reflexivity.
+Qed.
+
+Goal forall (x : T),
+ match x return prod unit unit with Build_T f g => g end =
+ pair match x return unit with Build_T f g => fst g end match x return unit with Build_T f g => snd g end.
+Proof.
+cbv.
+destruct x.
+reflexivity.
+Qed.
+
+Record U : Type := Build_U { h := tt }.
+
+Definition u : U := Build_U.
+
+Goal match u with Build_U h => h end = tt.
+Proof.
+cbv.
+reflexivity.
+Qed.