Add a new determinism test
authorBartosz Nitka <niteria@gmail.com>
Thu, 30 Jun 2016 13:59:02 +0000 (06:59 -0700)
committerBartosz Nitka <niteria@gmail.com>
Mon, 25 Jul 2016 14:44:47 +0000 (07:44 -0700)
This is one of the testcases that I forgot to commit

(cherry picked from commit 9854f14ef0a3a6f399a1aa4c141c5e3dddcd77ff)

testsuite/tests/determinism/determ021/A.hs [new file with mode: 0644]
testsuite/tests/determinism/determ021/Makefile [new file with mode: 0644]
testsuite/tests/determinism/determ021/all.T [new file with mode: 0644]
testsuite/tests/determinism/determ021/determ021.stdout [new file with mode: 0644]

diff --git a/testsuite/tests/determinism/determ021/A.hs b/testsuite/tests/determinism/determ021/A.hs
new file mode 100644 (file)
index 0000000..773a012
--- /dev/null
@@ -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 (file)
index 0000000..e88edef
--- /dev/null
@@ -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 (file)
index 0000000..35af362
--- /dev/null
@@ -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 (file)
index 0000000..747064f
--- /dev/null
@@ -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]