[commit: ghc] master: Finally! Test Trac #6056 (3935062)

git at git.haskell.org git at git.haskell.org
Fri Aug 29 16:17:25 UTC 2014


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

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

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

commit 393506269315bca66aae91517b75e0a003470c84
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Fri Aug 29 15:37:16 2014 +0100

    Finally!  Test Trac #6056


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

393506269315bca66aae91517b75e0a003470c84
 testsuite/tests/simplCore/should_compile/T6056.hs    |  8 ++++++++
 .../tests/simplCore/should_compile/T6056.stderr      | 20 ++++++++++++++++++++
 testsuite/tests/simplCore/should_compile/T6056a.hs   |  8 ++++++++
 testsuite/tests/simplCore/should_compile/all.T       |  1 +
 4 files changed, 37 insertions(+)

diff --git a/testsuite/tests/simplCore/should_compile/T6056.hs b/testsuite/tests/simplCore/should_compile/T6056.hs
new file mode 100644
index 0000000..e24631d
--- /dev/null
+++ b/testsuite/tests/simplCore/should_compile/T6056.hs
@@ -0,0 +1,8 @@
+module T6056 where
+import T6056a
+
+foo1 :: Int -> (Maybe Int, [Int])
+foo1 x = smallerAndRest x [x]
+
+foo2 :: Integer -> (Maybe Integer, [Integer])
+foo2 x = smallerAndRest x [x]
diff --git a/testsuite/tests/simplCore/should_compile/T6056.stderr b/testsuite/tests/simplCore/should_compile/T6056.stderr
new file mode 100644
index 0000000..10226d8
--- /dev/null
+++ b/testsuite/tests/simplCore/should_compile/T6056.stderr
@@ -0,0 +1,20 @@
+Rule fired: foldr/nil
+Rule fired: foldr/nil
+Rule fired:
+    SPEC/main at main:T6056 T6056a.$wsmallerAndRest @ GHC.Integer.Type.Integer
+Rule fired:
+    SPEC/main at main:T6056 T6056a.$wsmallerAndRest @ GHC.Types.Int
+Rule fired: Class op <
+Rule fired: Class op <
+Rule fired:
+    SPEC/main at main:T6056 T6056a.$wsmallerAndRest @ GHC.Integer.Type.Integer
+Rule fired:
+    SPEC/main at main:T6056 T6056a.$wsmallerAndRest @ GHC.Integer.Type.Integer
+Rule fired:
+    SPEC/main at main:T6056 T6056a.$wsmallerAndRest @ GHC.Types.Int
+Rule fired:
+    SPEC/main at main:T6056 T6056a.$wsmallerAndRest @ GHC.Types.Int
+Rule fired:
+    SPEC/main at main:T6056 T6056a.$wsmallerAndRest @ GHC.Types.Int
+Rule fired:
+    SPEC/main at main:T6056 T6056a.$wsmallerAndRest @ GHC.Integer.Type.Integer
diff --git a/testsuite/tests/simplCore/should_compile/T6056a.hs b/testsuite/tests/simplCore/should_compile/T6056a.hs
new file mode 100644
index 0000000..c83f74f
--- /dev/null
+++ b/testsuite/tests/simplCore/should_compile/T6056a.hs
@@ -0,0 +1,8 @@
+module T6056a where
+
+smallerAndRest :: Ord a => a -> [a] -> (Maybe a, [a])
+smallerAndRest x [] = (Nothing, [])
+smallerAndRest x (y:ys) | y < x = (Just y, ys)
+                        | otherwise = smallerAndRest x ys
+
+{-# INLINABLE smallerAndRest #-}
diff --git a/testsuite/tests/simplCore/should_compile/all.T b/testsuite/tests/simplCore/should_compile/all.T
index d8518f6..88d1022 100644
--- a/testsuite/tests/simplCore/should_compile/all.T
+++ b/testsuite/tests/simplCore/should_compile/all.T
@@ -205,3 +205,4 @@ test('T8832',
 test('T8848', only_ways(['optasm']), compile, ['-ddump-rule-firings -dsuppress-uniques'])
 test('T8848a', only_ways(['optasm']), compile, ['-ddump-rules'])
 test('T8331', only_ways(['optasm']), compile, ['-ddump-rules'])
+test('T6056', only_ways(['optasm']), multimod_compile, ['T6056', '-v0 -ddump-rule-firings'])



More information about the ghc-commits mailing list