aboutsummaryrefslogtreecommitdiff
path: root/test-suite
diff options
context:
space:
mode:
Diffstat (limited to 'test-suite')
-rw-r--r--test-suite/Makefile10
-rw-r--r--test-suite/bugs/closed/bug_9517.v1
-rwxr-xr-xtest-suite/coq-makefile/coqdoc1/run.sh9
-rwxr-xr-xtest-suite/coq-makefile/coqdoc2/run.sh9
-rwxr-xr-xtest-suite/coq-makefile/mlpack1/run.sh5
-rwxr-xr-xtest-suite/coq-makefile/mlpack2/run.sh5
-rwxr-xr-xtest-suite/coq-makefile/multiroot/run.sh9
-rwxr-xr-xtest-suite/coq-makefile/native1/run.sh2
-rwxr-xr-xtest-suite/coq-makefile/native2/run.sh2
-rwxr-xr-xtest-suite/coq-makefile/plugin1/run.sh5
-rwxr-xr-xtest-suite/coq-makefile/plugin2/run.sh5
-rwxr-xr-xtest-suite/coq-makefile/plugin3/run.sh5
-rwxr-xr-xtest-suite/coq-makefile/timing/run.sh3
-rwxr-xr-xtest-suite/coq-makefile/uninstall1/run.sh3
-rwxr-xr-xtest-suite/coq-makefile/uninstall2/run.sh3
-rwxr-xr-xtest-suite/misc/11170.sh8
-rw-r--r--test-suite/misc/aux11170.v6
-rw-r--r--test-suite/output/Notations2.v8
-rw-r--r--test-suite/output/Notations3.v2
-rw-r--r--test-suite/output/Notations4.out12
-rw-r--r--test-suite/output/Notations4.v19
-rw-r--r--test-suite/success/apply.v29
22 files changed, 151 insertions, 9 deletions
diff --git a/test-suite/Makefile b/test-suite/Makefile
index 279f32c903..245c717d42 100644
--- a/test-suite/Makefile
+++ b/test-suite/Makefile
@@ -144,6 +144,7 @@ bugs: $(BUGS)
clean:
rm -f trace .csdp.cache .nia.cache .lia.cache output/MExtraction.out
rm -f vos/Makefile vos/Makefile.conf
+ rm -f misc/universes/all_stdlib.v
$(SHOW) 'RM <**/*.stamp> <**/*.vo> <**/*.vio> <**/*.log> <**/*.glob>'
$(HIDE)find . \( \
-name '*.stamp' -o -name '*.vo' -o -name '*.vio' -o -name '*.vos' -o -name '*.vok' -o -name '*.log' -o -name '*.glob' \
@@ -252,7 +253,12 @@ $(addsuffix .log,$(wildcard bugs/closed/*.v)): %.v.log: %.v
@echo "TEST $< $(call get_coq_prog_args_in_parens,"$<")"
$(HIDE){ \
echo $(call log_intro,$<); \
- $(coqc) "$<" $(call get_coq_prog_args,"$<") 2>&1; R=$$?; times; \
+ (echo "\
+ bugs/closed/bug_3783.v \
+ bugs/closed/bug_4157.v \
+ bugs/closed/bug_5127.v \
+ " | grep -q "$<") && no_native="-native-compiler no"; \
+ $(coqc) $$no_native "$<" $(call get_coq_prog_args,"$<") 2>&1; R=$$?; times; \
if [ $$R = 0 ]; then \
echo $(log_success); \
echo " $<...Ok"; \
@@ -649,7 +655,7 @@ misc: $(patsubst %.sh,%.log,$(wildcard misc/*.sh))
misc/universes.log: misc/universes/all_stdlib.v
misc/universes/all_stdlib.v:
- cd .. && $(MAKE) test-suite/$@
+ cd misc/universes && ./build_all_stdlib.sh > all_stdlib.v
$(patsubst %.sh,%.log,$(wildcard misc/*.sh)): %.log: %.sh $(PREREQUISITELOG)
@echo "TEST $<"
diff --git a/test-suite/bugs/closed/bug_9517.v b/test-suite/bugs/closed/bug_9517.v
index bb43edbe74..93ed94df39 100644
--- a/test-suite/bugs/closed/bug_9517.v
+++ b/test-suite/bugs/closed/bug_9517.v
@@ -2,6 +2,7 @@ Declare Custom Entry expr.
Declare Custom Entry stmt.
Notation "x" := x (in custom stmt, x ident).
Notation "x" := x (in custom expr, x ident).
+Notation "'_'" := _ (in custom expr).
Notation "1" := 1 (in custom expr).
diff --git a/test-suite/coq-makefile/coqdoc1/run.sh b/test-suite/coq-makefile/coqdoc1/run.sh
index 88237815b1..d878b13ce6 100755
--- a/test-suite/coq-makefile/coqdoc1/run.sh
+++ b/test-suite/coq-makefile/coqdoc1/run.sh
@@ -21,6 +21,10 @@ make install-doc DSTROOT="$PWD/tmp"
sort -u > desired <<EOT
.
./test
+./test/.coq-native
+./test/.coq-native/Ntest_test.cmi
+./test/.coq-native/Ntest_test.cmx
+./test/.coq-native/Ntest_test.cmxs
./test/test_plugin.cmi
./test/test_plugin.cmx
./test/test_plugin.cmxa
@@ -29,6 +33,10 @@ sort -u > desired <<EOT
./test/test.v
./test/test.vo
./test/sub
+./test/sub/.coq-native
+./test/sub/.coq-native/Ntest_sub_testsub.cmi
+./test/sub/.coq-native/Ntest_sub_testsub.cmx
+./test/sub/.coq-native/Ntest_sub_testsub.cmxs
./test/sub/testsub.glob
./test/sub/testsub.v
./test/sub/testsub.vo
@@ -56,4 +64,5 @@ sort -u > desired <<EOT
./test/html/coqdoc.css
./test/html/test.test.html
EOT
+(coqc -config | grep -q "NATIVE_COMPILER_DEFAULT=yes") || sed -i.bak '/\.coq-native/d' desired
exec diff -u desired actual
diff --git a/test-suite/coq-makefile/coqdoc2/run.sh b/test-suite/coq-makefile/coqdoc2/run.sh
index 5811dd17e4..757667e8bd 100755
--- a/test-suite/coq-makefile/coqdoc2/run.sh
+++ b/test-suite/coq-makefile/coqdoc2/run.sh
@@ -19,6 +19,10 @@ make install-doc DSTROOT="$PWD/tmp"
sort -u > desired <<EOT
.
./test
+./test/.coq-native
+./test/.coq-native/Ntest_test.cmi
+./test/.coq-native/Ntest_test.cmx
+./test/.coq-native/Ntest_test.cmxs
./test/test_plugin.cmi
./test/test_plugin.cmx
./test/test_plugin.cmxa
@@ -27,6 +31,10 @@ sort -u > desired <<EOT
./test/test.v
./test/test.vo
./test/sub
+./test/sub/.coq-native
+./test/sub/.coq-native/Ntest_sub_testsub.cmi
+./test/sub/.coq-native/Ntest_sub_testsub.cmx
+./test/sub/.coq-native/Ntest_sub_testsub.cmxs
./test/sub/testsub.glob
./test/sub/testsub.v
./test/sub/testsub.vo
@@ -54,4 +62,5 @@ sort -u > desired <<EOT
./test/html/coqdoc.css
./test/html/test.test.html
EOT
+(coqc -config | grep -q "NATIVE_COMPILER_DEFAULT=yes") || sed -i.bak '/\.coq-native/d' desired
exec diff -u desired actual
diff --git a/test-suite/coq-makefile/mlpack1/run.sh b/test-suite/coq-makefile/mlpack1/run.sh
index bbd2fc460c..113a862d97 100755
--- a/test-suite/coq-makefile/mlpack1/run.sh
+++ b/test-suite/coq-makefile/mlpack1/run.sh
@@ -12,6 +12,10 @@ make install DSTROOT="$PWD/tmp"
sort > desired <<EOT
.
./test
+./test/.coq-native
+./test/.coq-native/Ntest_test.cmi
+./test/.coq-native/Ntest_test.cmx
+./test/.coq-native/Ntest_test.cmxs
./test/test.glob
./test/test_plugin.cmi
./test/test_plugin.cmx
@@ -20,4 +24,5 @@ sort > desired <<EOT
./test/test.v
./test/test.vo
EOT
+(coqc -config | grep -q "NATIVE_COMPILER_DEFAULT=yes") || sed -i.bak '/\.coq-native/d' desired
exec diff -u desired actual
diff --git a/test-suite/coq-makefile/mlpack2/run.sh b/test-suite/coq-makefile/mlpack2/run.sh
index bbd2fc460c..113a862d97 100755
--- a/test-suite/coq-makefile/mlpack2/run.sh
+++ b/test-suite/coq-makefile/mlpack2/run.sh
@@ -12,6 +12,10 @@ make install DSTROOT="$PWD/tmp"
sort > desired <<EOT
.
./test
+./test/.coq-native
+./test/.coq-native/Ntest_test.cmi
+./test/.coq-native/Ntest_test.cmx
+./test/.coq-native/Ntest_test.cmxs
./test/test.glob
./test/test_plugin.cmi
./test/test_plugin.cmx
@@ -20,4 +24,5 @@ sort > desired <<EOT
./test/test.v
./test/test.vo
EOT
+(coqc -config | grep -q "NATIVE_COMPILER_DEFAULT=yes") || sed -i.bak '/\.coq-native/d' desired
exec diff -u desired actual
diff --git a/test-suite/coq-makefile/multiroot/run.sh b/test-suite/coq-makefile/multiroot/run.sh
index 45bf1481df..be0d04f93d 100755
--- a/test-suite/coq-makefile/multiroot/run.sh
+++ b/test-suite/coq-makefile/multiroot/run.sh
@@ -20,6 +20,10 @@ make install-doc DSTROOT="$PWD/tmp"
sort > desired <<EOT
.
./test
+./test/.coq-native
+./test/.coq-native/Ntest_test.cmi
+./test/.coq-native/Ntest_test.cmx
+./test/.coq-native/Ntest_test.cmxs
./test/test.glob
./test/test.cmi
./test/test.cmx
@@ -30,6 +34,10 @@ sort > desired <<EOT
./test/test.v
./test/test.vo
./test2
+./test2/.coq-native
+./test2/.coq-native/Ntest2_test.cmi
+./test2/.coq-native/Ntest2_test.cmx
+./test2/.coq-native/Ntest2_test.cmxs
./test2/test.glob
./test2/test.v
./test2/test.vo
@@ -58,4 +66,5 @@ sort > desired <<EOT
./orphan_test_test2_test/mlihtml/type_Test_aux.html
./orphan_test_test2_test/mlihtml/type_Test.html
EOT
+(coqc -config | grep -q "NATIVE_COMPILER_DEFAULT=yes") || sed -i.bak '/\.coq-native/d' desired
exec diff -u desired actual
diff --git a/test-suite/coq-makefile/native1/run.sh b/test-suite/coq-makefile/native1/run.sh
index 3ffe831b3c..5dd36757be 100755
--- a/test-suite/coq-makefile/native1/run.sh
+++ b/test-suite/coq-makefile/native1/run.sh
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
-NONATIVECOMP=$(grep "let native_compiler = false" ../../../config/coq_config.ml)||true
+NONATIVECOMP=$(grep "let native_compiler = NativeOff" ../../../config/coq_config.ml)||true
if [[ $(which ocamlopt) && ! $NONATIVECOMP ]]; then
. ../template/init.sh
diff --git a/test-suite/coq-makefile/native2/run.sh b/test-suite/coq-makefile/native2/run.sh
index aaae81630f..47befc50c3 100755
--- a/test-suite/coq-makefile/native2/run.sh
+++ b/test-suite/coq-makefile/native2/run.sh
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
-NONATIVECOMP=$(grep "let native_compiler = false" ../../../config/coq_config.ml)||true
+NONATIVECOMP=$(grep "let native_compiler = NativeOff" ../../../config/coq_config.ml)||true
if [[ $(which ocamlopt) && ! $NONATIVECOMP ]]; then
. ../template/init.sh
diff --git a/test-suite/coq-makefile/plugin1/run.sh b/test-suite/coq-makefile/plugin1/run.sh
index 1e2bd979b3..f69e8c1b8c 100755
--- a/test-suite/coq-makefile/plugin1/run.sh
+++ b/test-suite/coq-makefile/plugin1/run.sh
@@ -13,6 +13,10 @@ make install DSTROOT="$PWD/tmp"
sort > desired <<EOT
.
./test
+./test/.coq-native
+./test/.coq-native/Ntest_test.cmi
+./test/.coq-native/Ntest_test.cmx
+./test/.coq-native/Ntest_test.cmxs
./test/test.glob
./test/test.cmi
./test/test.cmx
@@ -23,4 +27,5 @@ sort > desired <<EOT
./test/test.v
./test/test.vo
EOT
+(coqc -config | grep -q "NATIVE_COMPILER_DEFAULT=yes") || sed -i.bak '/\.coq-native/d' desired
exec diff -u desired actual
diff --git a/test-suite/coq-makefile/plugin2/run.sh b/test-suite/coq-makefile/plugin2/run.sh
index 1e2bd979b3..f69e8c1b8c 100755
--- a/test-suite/coq-makefile/plugin2/run.sh
+++ b/test-suite/coq-makefile/plugin2/run.sh
@@ -13,6 +13,10 @@ make install DSTROOT="$PWD/tmp"
sort > desired <<EOT
.
./test
+./test/.coq-native
+./test/.coq-native/Ntest_test.cmi
+./test/.coq-native/Ntest_test.cmx
+./test/.coq-native/Ntest_test.cmxs
./test/test.glob
./test/test.cmi
./test/test.cmx
@@ -23,4 +27,5 @@ sort > desired <<EOT
./test/test.v
./test/test.vo
EOT
+(coqc -config | grep -q "NATIVE_COMPILER_DEFAULT=yes") || sed -i.bak '/\.coq-native/d' desired
exec diff -u desired actual
diff --git a/test-suite/coq-makefile/plugin3/run.sh b/test-suite/coq-makefile/plugin3/run.sh
index 1e2bd979b3..f69e8c1b8c 100755
--- a/test-suite/coq-makefile/plugin3/run.sh
+++ b/test-suite/coq-makefile/plugin3/run.sh
@@ -13,6 +13,10 @@ make install DSTROOT="$PWD/tmp"
sort > desired <<EOT
.
./test
+./test/.coq-native
+./test/.coq-native/Ntest_test.cmi
+./test/.coq-native/Ntest_test.cmx
+./test/.coq-native/Ntest_test.cmxs
./test/test.glob
./test/test.cmi
./test/test.cmx
@@ -23,4 +27,5 @@ sort > desired <<EOT
./test/test.v
./test/test.vo
EOT
+(coqc -config | grep -q "NATIVE_COMPILER_DEFAULT=yes") || sed -i.bak '/\.coq-native/d' desired
exec diff -u desired actual
diff --git a/test-suite/coq-makefile/timing/run.sh b/test-suite/coq-makefile/timing/run.sh
index ed5a4f93f5..426c9ea53f 100755
--- a/test-suite/coq-makefile/timing/run.sh
+++ b/test-suite/coq-makefile/timing/run.sh
@@ -3,6 +3,9 @@
#set -x
set -e
+NONATIVECOMP=$(grep "let native_compiler = NativeOff" ../../../config/coq_config.ml)||true
+if [[ ! $NONATIVECOMP ]]; then exit 0 ; fi
+
. ../template/path-init.sh
# reset MAKEFLAGS so that, e.g., `make -C test-suite -B coq-makefile` doesn't give us issues
diff --git a/test-suite/coq-makefile/uninstall1/run.sh b/test-suite/coq-makefile/uninstall1/run.sh
index fc95d84b9a..0f05acd072 100755
--- a/test-suite/coq-makefile/uninstall1/run.sh
+++ b/test-suite/coq-makefile/uninstall1/run.sh
@@ -19,5 +19,8 @@ make uninstall-doc DSTROOT="$PWD/tmp"
) | sort -u > actual
sort -u > desired <<EOT
.
+./test
+./test/sub
EOT
+(coqc -config | grep -q "NATIVE_COMPILER_DEFAULT=yes") || sed -i.bak '/test/d' desired
exec diff -u desired actual
diff --git a/test-suite/coq-makefile/uninstall2/run.sh b/test-suite/coq-makefile/uninstall2/run.sh
index fc95d84b9a..0f05acd072 100755
--- a/test-suite/coq-makefile/uninstall2/run.sh
+++ b/test-suite/coq-makefile/uninstall2/run.sh
@@ -19,5 +19,8 @@ make uninstall-doc DSTROOT="$PWD/tmp"
) | sort -u > actual
sort -u > desired <<EOT
.
+./test
+./test/sub
EOT
+(coqc -config | grep -q "NATIVE_COMPILER_DEFAULT=yes") || sed -i.bak '/test/d' desired
exec diff -u desired actual
diff --git a/test-suite/misc/11170.sh b/test-suite/misc/11170.sh
new file mode 100755
index 0000000000..da8843fcf6
--- /dev/null
+++ b/test-suite/misc/11170.sh
@@ -0,0 +1,8 @@
+#!/usr/bin/env bash
+
+set -e
+
+export PATH=$BIN:$PATH
+export OCAMLRUNPARAM=s=1
+
+${coqc#"$BIN"} misc/aux11170.v
diff --git a/test-suite/misc/aux11170.v b/test-suite/misc/aux11170.v
new file mode 100644
index 0000000000..d4a8630053
--- /dev/null
+++ b/test-suite/misc/aux11170.v
@@ -0,0 +1,6 @@
+Fixpoint T n := match n with O => nat | S n => nat -> T n end.
+Fixpoint app n : T n -> nat :=
+ match n with O => fun x => x | S n => fun f => app n (f 0) end.
+Definition n := (fix aux n := match n with S n => aux n + aux n | O => 1 end) 13.
+Axiom f : T n.
+Eval vm_compute in let t := (app n f, 0) in snd t.
diff --git a/test-suite/output/Notations2.v b/test-suite/output/Notations2.v
index bcb2468792..05712eaac7 100644
--- a/test-suite/output/Notations2.v
+++ b/test-suite/output/Notations2.v
@@ -62,7 +62,7 @@ Check `(∀ n p : A, n=p).
Notation "'let'' f x .. y := t 'in' u":=
(let f := fun x => .. (fun y => t) .. in u)
- (f ident, x closed binder, y closed binder, at level 200,
+ (f name, x closed binder, y closed binder, at level 200,
right associativity).
Check let' f x y (a:=0) z (b:bool) := x+y+z+1 in f 0 1 2.
@@ -93,7 +93,7 @@ End A.
Notation "'mylet' f [ x ; .. ; y ] := t 'in' u":=
(let f := fun x => .. (fun y => t) .. in u)
- (f ident, x closed binder, y closed binder, at level 200,
+ (f name, x closed binder, y closed binder, at level 200,
right associativity).
Check mylet f [x;y;z;(a:bool)] := x+y+z+1 in f 0 1 2.
@@ -104,7 +104,7 @@ Check mylet f [x;y;z;(a:bool)] := x+y+z+1 in f 0 1 2.
(* Old request mentioned again on coq-club 20/1/2012 *)
Notation "# x : T => t" := (fun x : T => t)
- (at level 0, t at level 200, x ident).
+ (at level 0, t at level 200, x name).
Check # x : nat => x.
Check # _ : nat => 2.
@@ -116,7 +116,7 @@ Parameters (A : Set) (x y : A) (Q : A -> A -> Prop) (conj : Q x y).
Check (exist (Q x) y conj).
(* Check bug #4854 *)
-Notation "% i" := (fun i : nat => i) (at level 0, i ident).
+Notation "% i" := (fun i : nat => i) (at level 0, i name).
Check %i.
Check %j.
diff --git a/test-suite/output/Notations3.v b/test-suite/output/Notations3.v
index 04a91c14d9..6c714fc624 100644
--- a/test-suite/output/Notations3.v
+++ b/test-suite/output/Notations3.v
@@ -305,7 +305,7 @@ Module E.
Inductive myex2 {A:Type} (P Q:A -> Prop) : Prop :=
myex_intro2 : forall x:A, P x -> Q x -> myex2 P Q.
Notation "'myexists2' x : A , p & q" := (myex2 (A:=A) (fun x => p) (fun x => q))
- (at level 200, x ident, A at level 200, p at level 200, right associativity,
+ (at level 200, x name, A at level 200, p at level 200, right associativity,
format "'[' 'myexists2' '/ ' x : A , '/ ' '[' p & '/' q ']' ']'")
: type_scope.
Check myex2 (fun x => let '(y,z) := x in y>z) (fun x => let '(y,z) := x in z>y).
diff --git a/test-suite/output/Notations4.out b/test-suite/output/Notations4.out
index 86c4b3cccc..df64ae2af3 100644
--- a/test-suite/output/Notations4.out
+++ b/test-suite/output/Notations4.out
@@ -197,3 +197,15 @@ Found an inductive type while a pattern was expected.
: nat * nat
%%%
: Type
+## (x, _) (x = 0)
+ : Prop
+The command has indeed failed with message:
+Unexpected type constraint in notation already providing a type constraint.
+## '(x, y) (x + y = 0)
+ : Prop
+## x (x = 0)
+ : Prop
+## '(x, y) (x = 0)
+ : Prop
+fun f : ## a (a = 0) => f 1 eq_refl
+ : ## a (a = 0) -> 1 = 0
diff --git a/test-suite/output/Notations4.v b/test-suite/output/Notations4.v
index 6af192ea82..ce488fe18d 100644
--- a/test-suite/output/Notations4.v
+++ b/test-suite/output/Notations4.v
@@ -327,6 +327,7 @@ Module P.
Module NotationMixedTermBinderAsIdent.
+ Set Warnings "-deprecated-ident-entry". (* We do want ident! *)
Notation "▢_ n P" := (pseudo_force n (fun n => P))
(at level 0, n ident, P at level 9, format "▢_ n P").
Check exists p, ▢_p (p >= 1).
@@ -487,3 +488,21 @@ Notation "∀ x .. y , P" := (forall x, .. (forall y, P) ..)
Check %%%.
End MorePrecise3.
+
+Module TypedPattern.
+
+Notation "## x P" := (forall x:nat*nat, P) (x pattern, at level 0).
+Check ## (x,y) (x=0).
+Fail Check ## ((x,y):bool*bool) (x=y).
+
+End TypedPattern.
+
+Module SingleBinder.
+
+Notation "## x P" := (forall x, x = x -> P) (x binder, at level 0).
+Check ## '(x,y) (x+y=0).
+Check ## (x:nat) (x=0).
+Check ## '((x,y):nat*nat) (x=0).
+Check fun (f : ## {a} (a=0)) => f (a:=1) eq_refl.
+
+End SingleBinder.
diff --git a/test-suite/success/apply.v b/test-suite/success/apply.v
index e1df9ba84a..8c4b567106 100644
--- a/test-suite/success/apply.v
+++ b/test-suite/success/apply.v
@@ -530,6 +530,16 @@ rewrite H0.
change (x+0=0).
Abort.
+Goal (forall x y, x <= y -> y + x = 0 /\ True) -> exists x y, (x <= 0 -> y <= 1 -> 0 = 0 /\ 1 = 0).
+intros.
+do 2 eexists.
+intros.
+eapply H in H0 as (H0,_), H1 as (H1,_).
+split.
+- exact H0.
+- exact H1.
+Qed.
+
(* 2nd order apply used to have delta on local definitions even though
it does not have delta on global definitions; keep it by
compatibility while finding a more uniform way to proceed. *)
@@ -582,3 +592,22 @@ intros. eexists ?[p]. split. rewrite H.
reflexivity.
exact H0.
Qed.
+
+(* apply and side conditions: we check that apply in iterates only on
+ the main subgoals *)
+
+Goal (forall x, x=0 -> x>=0 -> x<=0 \/ x<=1) -> 0>=0 -> 1>=0 -> 1=0 -> True.
+intros f H H0 H1.
+apply f in H as [], H0 as [].
+1-3: change (0 <= 0) in H.
+4-6: change (0 <= 1) in H.
+1: change (1 <= 0) in H0.
+4: change (1 <= 0) in H0.
+2: change (1 <= 1) in H0.
+5: change (1 <= 1) in H0.
+1-2,4-5: exact I.
+1,2: exact H1.
+change (0 >= 0) in H.
+change (1 >= 0) in H0.
+exact (eq_refl 0).
+Qed.