[commit: ghc] master: testsuite: Add test for #14965 (d1fb583)

git at git.haskell.org git at git.haskell.org
Tue Mar 27 13:53:55 UTC 2018


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/d1fb5831f574953661a3716720fbc798781d37eb/ghc

>---------------------------------------------------------------

commit d1fb5831f574953661a3716720fbc798781d37eb
Author: Ben Gamari <ben at smart-cactus.org>
Date:   Mon Mar 26 15:41:39 2018 -0400

    testsuite: Add test for #14965


>---------------------------------------------------------------

d1fb5831f574953661a3716720fbc798781d37eb
 testsuite/tests/simplCore/should_run/T14965.hs            | 15 +++++++++++++++
 .../tests/simplCore/should_run/T14965.stdout              |  0
 testsuite/tests/simplCore/should_run/T14965_Sep.hs        | 13 +++++++++++++
 testsuite/tests/simplCore/should_run/all.T                |  1 +
 4 files changed, 29 insertions(+)

diff --git a/testsuite/tests/simplCore/should_run/T14965.hs b/testsuite/tests/simplCore/should_run/T14965.hs
new file mode 100644
index 0000000..f4fa011
--- /dev/null
+++ b/testsuite/tests/simplCore/should_run/T14965.hs
@@ -0,0 +1,15 @@
+module Main (main) where
+
+import T14965_Sep
+
+main :: IO ()
+main = print $ cc bb
+
+bb :: Sep
+bb = catSep b1 b2
+
+b1 :: Sep
+b1 = Sep [] ["foo"] []
+
+b2 :: Sep
+b2 = Sep [] ["bar"] []
diff --git a/libraries/base/tests/IO/IOError002.stdout b/testsuite/tests/simplCore/should_run/T14965.stdout
similarity index 100%
copy from libraries/base/tests/IO/IOError002.stdout
copy to testsuite/tests/simplCore/should_run/T14965.stdout
diff --git a/testsuite/tests/simplCore/should_run/T14965_Sep.hs b/testsuite/tests/simplCore/should_run/T14965_Sep.hs
new file mode 100644
index 0000000..46c0f1b
--- /dev/null
+++ b/testsuite/tests/simplCore/should_run/T14965_Sep.hs
@@ -0,0 +1,13 @@
+module T14965_Sep where
+
+data Sep = Sep
+  { bugVanishesWithoutThis :: [()]
+  , middle :: [String]
+  , orThis :: [()]
+  }
+
+catSep :: Sep -> Sep -> Sep
+catSep (Sep a b c) (Sep x y z) = Sep (a ++ x) (b ++ y) (c ++ z)
+
+cc :: Sep -> Bool
+cc boost = elem "foo" $ middle boost
diff --git a/testsuite/tests/simplCore/should_run/all.T b/testsuite/tests/simplCore/should_run/all.T
index d697605..ca69565 100644
--- a/testsuite/tests/simplCore/should_run/all.T
+++ b/testsuite/tests/simplCore/should_run/all.T
@@ -83,3 +83,4 @@ test('T14868',
      [when((arch('powerpc64') or arch('powerpc64le')), expect_broken(11261))],
      compile_and_run, [''])
 test('T14894', normal, compile_and_run, [''])
+test('T14965', normal, compile_and_run, [''])



More information about the ghc-commits mailing list