diff options
author | Maxime Dénès <mail@maximedenes.fr> | 2018-05-29 09:43:14 +0200 |
---|---|---|
committer | Maxime Dénès <mail@maximedenes.fr> | 2018-05-29 09:45:38 +0200 |
commit | 9b4e7dc0ed05dbfbb96177124a6394345feee67e (patch) | |
tree | 6db5c533a20985c19bf67ebb22b094bc8b32b180 /test-suite/bugs/7333.v | |
parent | a205bb9f2a93396aad154ec50f6f122cbd46811c (diff) |
Add test for #7333: vm_compute segfaults / Anomaly with cofix
Diffstat (limited to 'test-suite/bugs/7333.v')
-rw-r--r-- | test-suite/bugs/7333.v | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/test-suite/bugs/7333.v b/test-suite/bugs/7333.v new file mode 100644 index 000000000..fba5b9029 --- /dev/null +++ b/test-suite/bugs/7333.v @@ -0,0 +1,39 @@ +Module Example1. + +CoInductive wrap : Type := + | item : unit -> wrap. + +Definition extract (t : wrap) : unit := +match t with +| item x => x +end. + +CoFixpoint close u : unit -> wrap := +match u with +| tt => item +end. + +Definition table : wrap := close tt tt. + +Eval vm_compute in (extract table). +Eval vm_compute in (extract table). + +End Example1. + +Module Example2. + +Set Primitive Projections. +CoInductive wrap : Type := + item { extract : unit }. + +CoFixpoint close u : unit -> wrap := +match u with +| tt => item +end. + +Definition table : wrap := close tt tt. + +Eval vm_compute in (extract table). +Eval vm_compute in (extract table). + +End Example2. |