summaryrefslogtreecommitdiff
path: root/testsuite/tests/simplCore/should_compile/spec002.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/simplCore/should_compile/spec002.hs')
-rw-r--r--testsuite/tests/simplCore/should_compile/spec002.hs17
1 files changed, 17 insertions, 0 deletions
diff --git a/testsuite/tests/simplCore/should_compile/spec002.hs b/testsuite/tests/simplCore/should_compile/spec002.hs
new file mode 100644
index 0000000000..1fb88d995c
--- /dev/null
+++ b/testsuite/tests/simplCore/should_compile/spec002.hs
@@ -0,0 +1,17 @@
+{-# OPTIONS_GHC -O2 #-}
+
+-- Ths one fooled the rule-matching in SpecConstr, and gave a CoreLint error
+
+module Foo where
+
+type Token = (Int, Int, Lex, String)
+
+data Lex = Llbrace
+
+laLayout :: Int -> [Int] -> [Token] -> [Token]
+
+laLayout l (s:ss) (t1@(l1, n1, w1, c1) :
+ t2@(l2, n2, w2, c2) : ts)
+ | n1 < s = laLayout l2 (n2:s:ss) ts
+ | otherwise = laLayout l ss (t1:t2:ts)
+