Test Trac #5955
authorSimon Peyton Jones <simonpj@microsoft.com>
Wed, 28 Mar 2012 12:24:03 +0000 (13:24 +0100)
committerSimon Peyton Jones <simonpj@microsoft.com>
Wed, 28 Mar 2012 12:24:03 +0000 (13:24 +0100)
testsuite/tests/indexed-types/should_compile/Makefile
testsuite/tests/indexed-types/should_compile/T5955.hs [new file with mode: 0644]
testsuite/tests/indexed-types/should_compile/T5955a.hs [new file with mode: 0644]
testsuite/tests/indexed-types/should_compile/all.T

index a5dfe03..e37855c 100644 (file)
@@ -13,3 +13,8 @@ IndTypesPerf:
        $(RM) IndTypesPerfMerge.o IndTypesPerfMerge.hi
        '$(TEST_HC)' $(TEST_HC_OPTS) -O -c IndTypesPerfMerge.hs +RTS -M20M
        '$(TEST_HC)' $(TEST_HC_OPTS) -O -c IndTypesPerf.hs      +RTS -M20M
+
+T5955:
+       $(RM) T5955.o T5955.hi T5955a.o T5955a.hi 
+       '$(TEST_HC)' $(TEST_HC_OPTS) -c T5955a.hs
+       '$(TEST_HC)' $(TEST_HC_OPTS) -c T5955.hs
diff --git a/testsuite/tests/indexed-types/should_compile/T5955.hs b/testsuite/tests/indexed-types/should_compile/T5955.hs
new file mode 100644 (file)
index 0000000..0d92239
--- /dev/null
@@ -0,0 +1,7 @@
+module T5955 where
+
+import T5955a
+
+
+foo :: ()
+foo = ()
diff --git a/testsuite/tests/indexed-types/should_compile/T5955a.hs b/testsuite/tests/indexed-types/should_compile/T5955a.hs
new file mode 100644 (file)
index 0000000..b9d4ea2
--- /dev/null
@@ -0,0 +1,13 @@
+{-# LANGUAGE FlexibleContexts #-}
+{-# LANGUAGE TypeFamilies #-}
+
+module T5955a where
+
+
+class (Eq (Multi a)) => MultiPrim a where
+    data Multi a
+
+instance MultiPrim Int where
+    newtype Multi Int = MultiInt Int deriving (Eq)
+
+
index fd39b36..9253673 100644 (file)
@@ -182,3 +182,9 @@ test('ClassEqContext3', normal, compile, [''])
 test('HO', normal, compile, [''])
 
 
+# The point about this test is that it compiles the two T5955
+# modules *separately*
+test('T5955',
+     extra_clean(['T5955.o', 'T5955.hi', 'T5955a.o', 'T5955a.hi']),
+     run_command,
+     ['$MAKE -s --no-print-directory T5955'])