From 9212dd34acb965d804724c510125fc27bc3f1d57 Mon Sep 17 00:00:00 2001 From: Jacques Garrigue Date: Wed, 30 Oct 2013 02:57:59 +0000 Subject: [PATCH] Add test for PR#6216. Not fixed yet. git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14250 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02 --- testsuite/makefiles/Makefile.common | 3 ++- testsuite/tests/basic-more/Makefile | 1 + testsuite/tests/basic-more/pr6216.ml | 12 ++++++++++++ testsuite/tests/basic-more/pr6216.reference | 2 ++ 4 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 testsuite/tests/basic-more/pr6216.ml create mode 100644 testsuite/tests/basic-more/pr6216.reference diff --git a/testsuite/makefiles/Makefile.common b/testsuite/makefiles/Makefile.common index 86f139f51..20af7ea4b 100644 --- a/testsuite/makefiles/Makefile.common +++ b/testsuite/makefiles/Makefile.common @@ -44,11 +44,12 @@ SET_LD_PATH=CAML_LD_LIBRARY_PATH="$(LD_PATH)" include $(TOPDIR)/config/Makefile OCFLAGS=-nostdlib -I $(OTOPDIR)/stdlib $(COMPFLAGS) +OCOPTFLAGS= OCAML=$(OCAMLRUN) $(OTOPDIR)/ocaml $(OCFLAGS) \ -init $(OTOPDIR)/testsuite/lib/empty OCAMLC=$$($(CAMLC_BIN_CMD_TO_EVAL)) $(OCFLAGS) -OCAMLOPT=$$($(CAMLOPT_BIN_CMD_TO_EVAL)) $(OCFLAGS) +OCAMLOPT=$$($(CAMLOPT_BIN_CMD_TO_EVAL)) $(OCFLAGS) $(OCOPTFLAGS) OCAMLDOC=$(OCAMLRUN) $(OTOPDIR)/ocamldoc/ocamldoc OCAMLLEX=$(OCAMLRUN) $(OTOPDIR)/lex/ocamllex OCAMLMKLIB=$(OCAMLRUN) $(OTOPDIR)/tools/ocamlmklib \ diff --git a/testsuite/tests/basic-more/Makefile b/testsuite/tests/basic-more/Makefile index 9805d2db4..f6e665971 100644 --- a/testsuite/tests/basic-more/Makefile +++ b/testsuite/tests/basic-more/Makefile @@ -15,3 +15,4 @@ MODULES=testing include $(BASEDIR)/makefiles/Makefile.several include $(BASEDIR)/makefiles/Makefile.common +OCOPTFLAGS=-inline 20 diff --git a/testsuite/tests/basic-more/pr6216.ml b/testsuite/tests/basic-more/pr6216.ml new file mode 100644 index 000000000..71844f149 --- /dev/null +++ b/testsuite/tests/basic-more/pr6216.ml @@ -0,0 +1,12 @@ +(* PR6216: wrong inlining of GADT match *) + +type _ t = + | Float : float t + | String : string t + +let f : type a . a t -> a -> unit = fun t a -> + match t with + | Float -> () + | String -> ignore (String.length a : int) + +let _g (kind : float t) (x : float) : unit = f kind (x *. 13.) diff --git a/testsuite/tests/basic-more/pr6216.reference b/testsuite/tests/basic-more/pr6216.reference new file mode 100644 index 000000000..197c92807 --- /dev/null +++ b/testsuite/tests/basic-more/pr6216.reference @@ -0,0 +1,2 @@ + +All tests succeeded.