summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBartosz Nitka <niteria@gmail.com>2016-06-30 06:59:02 -0700
committerBartosz Nitka <niteria@gmail.com>2016-06-30 07:03:05 -0700
commit9854f14ef0a3a6f399a1aa4c141c5e3dddcd77ff (patch)
tree888400915b06de3857eab6f0cc757fe9bd495081
parentfb6e2c7fe213004c7398a13e3cc38d4428b66b12 (diff)
downloadhaskell-9854f14ef0a3a6f399a1aa4c141c5e3dddcd77ff.tar.gz
Add a new determinism test
This is one of the testcases that I forgot to commit
-rw-r--r--testsuite/driver/extra_files.py1
-rw-r--r--testsuite/tests/determinism/determ021/A.hs8
-rw-r--r--testsuite/tests/determinism/determ021/Makefile11
-rw-r--r--testsuite/tests/determinism/determ021/all.T4
-rw-r--r--testsuite/tests/determinism/determ021/determ021.stdout22
5 files changed, 46 insertions, 0 deletions
diff --git a/testsuite/driver/extra_files.py b/testsuite/driver/extra_files.py
index 43e78af39d..bc5d460b77 100644
--- a/testsuite/driver/extra_files.py
+++ b/testsuite/driver/extra_files.py
@@ -202,6 +202,7 @@ extra_src_files = {
'determ017': ['A.hs'],
'determ018': ['A.hs'],
'determ019': ['A.hs'],
+ 'determ021': ['A.hs'],
'dodgy': ['DodgyA.hs'],
'driver011': ['A011.hs'],
'driver012': ['A012.hs'],
diff --git a/testsuite/tests/determinism/determ021/A.hs b/testsuite/tests/determinism/determ021/A.hs
new file mode 100644
index 0000000000..773a012fee
--- /dev/null
+++ b/testsuite/tests/determinism/determ021/A.hs
@@ -0,0 +1,8 @@
+{-# LANGUAGE ApplicativeDo #-}
+{-# OPTIONS_GHC -ddump-types #-}
+module A where
+
+test2 f = do
+ x <- f 3
+ y <- f 4
+ return (x + y)
diff --git a/testsuite/tests/determinism/determ021/Makefile b/testsuite/tests/determinism/determ021/Makefile
new file mode 100644
index 0000000000..e88edeff65
--- /dev/null
+++ b/testsuite/tests/determinism/determ021/Makefile
@@ -0,0 +1,11 @@
+TOP=../../..
+include $(TOP)/mk/boilerplate.mk
+include $(TOP)/mk/test.mk
+
+determ021:
+ $(RM) A.hi A.o
+ '$(TEST_HC)' $(TEST_HC_OPTS) -O -dinitial-unique=0 -dunique-increment=1 A.hs
+ $(CP) A.hi A.normal.hi
+ $(RM) A.hi A.o
+ '$(TEST_HC)' $(TEST_HC_OPTS) -O -dinitial-unique=16777215 -dunique-increment=-1 A.hs
+ diff A.hi A.normal.hi
diff --git a/testsuite/tests/determinism/determ021/all.T b/testsuite/tests/determinism/determ021/all.T
new file mode 100644
index 0000000000..35af3622b7
--- /dev/null
+++ b/testsuite/tests/determinism/determ021/all.T
@@ -0,0 +1,4 @@
+test('determ021',
+ extra_clean(['A.o', 'A.hi', 'A.normal.hi']),
+ run_command,
+ ['$MAKE -s --no-print-directory determ021'])
diff --git a/testsuite/tests/determinism/determ021/determ021.stdout b/testsuite/tests/determinism/determ021/determ021.stdout
new file mode 100644
index 0000000000..747064f2c6
--- /dev/null
+++ b/testsuite/tests/determinism/determ021/determ021.stdout
@@ -0,0 +1,22 @@
+[1 of 1] Compiling A ( A.hs, A.o )
+TYPE SIGNATURES
+ test2 ::
+ forall t b (f :: * -> *).
+ (Num b, Num t, Applicative f) =>
+ (t -> f b) -> f b
+TYPE CONSTRUCTORS
+COERCION AXIOMS
+Dependent modules: []
+Dependent packages: [base-4.9.0.0, ghc-prim-0.5.0.0,
+ integer-gmp-1.0.0.1]
+[1 of 1] Compiling A ( A.hs, A.o )
+TYPE SIGNATURES
+ test2 ::
+ forall t b (f :: * -> *).
+ (Num b, Num t, Applicative f) =>
+ (t -> f b) -> f b
+TYPE CONSTRUCTORS
+COERCION AXIOMS
+Dependent modules: []
+Dependent packages: [base-4.9.0.0, ghc-prim-0.5.0.0,
+ integer-gmp-1.0.0.1]