SpecConstr infinite specialisation: test for #5550
authorAmos Robinson <amos.robinson@gmail.com>
Wed, 3 Apr 2013 06:28:41 +0000 (17:28 +1100)
committerAmos Robinson <amos.robinson@gmail.com>
Wed, 3 Apr 2013 06:28:41 +0000 (17:28 +1100)
testsuite/tests/simplCore/should_compile/T5550.hs [new file with mode: 0644]
testsuite/tests/simplCore/should_compile/T5550.stderr [new file with mode: 0644]
testsuite/tests/simplCore/should_compile/all.T

diff --git a/testsuite/tests/simplCore/should_compile/T5550.hs b/testsuite/tests/simplCore/should_compile/T5550.hs
new file mode 100644 (file)
index 0000000..025da50
--- /dev/null
@@ -0,0 +1,11 @@
+module T5550 where
+
+import GHC.Exts ( SpecConstrAnnotation(..) )
+
+data SPEC = SPEC | SPEC2
+{-# ANN type SPEC ForceSpecConstr #-}
+
+loop :: SPEC -> [Int] -> [Int] -> [Int]
+loop SPEC z [] = z
+loop SPEC z (x:xs) = loop SPEC (x:z) xs
+
diff --git a/testsuite/tests/simplCore/should_compile/T5550.stderr b/testsuite/tests/simplCore/should_compile/T5550.stderr
new file mode 100644 (file)
index 0000000..9ebd8cc
--- /dev/null
@@ -0,0 +1,3 @@
+Loading package ghc-prim ... linking ... done.
+Loading package integer-gmp ... linking ... done.
+Loading package base ... linking ... done.
index f23061a..8c33ab1 100644 (file)
@@ -164,3 +164,4 @@ test('T7796',
      extra_clean(['T7796.prep']),
      run_command,
      ['$MAKE -s --no-print-directory T7796'])
+test('T5550', normal, compile, [''])