summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2014-08-29 15:37:16 +0100
committerSimon Peyton Jones <simonpj@microsoft.com>2014-08-29 17:16:55 +0100
commit393506269315bca66aae91517b75e0a003470c84 (patch)
treefad0cf8d6e233043d853a567cc2752a122dbab13 /testsuite
parente5f766c392c8c1cb329e1409102b5655c3c253c9 (diff)
downloadhaskell-393506269315bca66aae91517b75e0a003470c84.tar.gz
Finally! Test Trac #6056
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/tests/simplCore/should_compile/T6056.hs8
-rw-r--r--testsuite/tests/simplCore/should_compile/T6056.stderr20
-rw-r--r--testsuite/tests/simplCore/should_compile/T6056a.hs8
-rw-r--r--testsuite/tests/simplCore/should_compile/all.T1
4 files changed, 37 insertions, 0 deletions
diff --git a/testsuite/tests/simplCore/should_compile/T6056.hs b/testsuite/tests/simplCore/should_compile/T6056.hs
new file mode 100644
index 0000000000..e24631d234
--- /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 0000000000..10226d82b7
--- /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@main:T6056 T6056a.$wsmallerAndRest @ GHC.Integer.Type.Integer
+Rule fired:
+ SPEC/main@main:T6056 T6056a.$wsmallerAndRest @ GHC.Types.Int
+Rule fired: Class op <
+Rule fired: Class op <
+Rule fired:
+ SPEC/main@main:T6056 T6056a.$wsmallerAndRest @ GHC.Integer.Type.Integer
+Rule fired:
+ SPEC/main@main:T6056 T6056a.$wsmallerAndRest @ GHC.Integer.Type.Integer
+Rule fired:
+ SPEC/main@main:T6056 T6056a.$wsmallerAndRest @ GHC.Types.Int
+Rule fired:
+ SPEC/main@main:T6056 T6056a.$wsmallerAndRest @ GHC.Types.Int
+Rule fired:
+ SPEC/main@main:T6056 T6056a.$wsmallerAndRest @ GHC.Types.Int
+Rule fired:
+ SPEC/main@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 0000000000..c83f74f965
--- /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 d8518f6264..88d10228f9 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'])