diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2011-08-03 11:01:03 +0100 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2011-08-03 11:01:03 +0100 |
commit | 53e07d8bc7f60735435eae248fca138b2de4cb32 (patch) | |
tree | 6080c233f13fde89cb989a4c538eaa081764455c /testsuite/tests/driver/T5147 | |
parent | 085a89b8e539a70e020090c944ed704d4ead9cd4 (diff) | |
download | haskell-53e07d8bc7f60735435eae248fca138b2de4cb32.tar.gz |
Test Trac #5147
Diffstat (limited to 'testsuite/tests/driver/T5147')
-rw-r--r-- | testsuite/tests/driver/T5147/A.hs | 7 | ||||
-rw-r--r-- | testsuite/tests/driver/T5147/B1.hs | 8 | ||||
-rw-r--r-- | testsuite/tests/driver/T5147/B2.hs | 9 | ||||
-rw-r--r-- | testsuite/tests/driver/T5147/Makefile | 21 | ||||
-rw-r--r-- | testsuite/tests/driver/T5147/T5147.stderr | 7 | ||||
-rw-r--r-- | testsuite/tests/driver/T5147/all.T | 5 |
6 files changed, 57 insertions, 0 deletions
diff --git a/testsuite/tests/driver/T5147/A.hs b/testsuite/tests/driver/T5147/A.hs new file mode 100644 index 0000000000..7a968dfbd7 --- /dev/null +++ b/testsuite/tests/driver/T5147/A.hs @@ -0,0 +1,7 @@ +module A where + +import B + +showField :: Fields v -> String +showField a = show a + diff --git a/testsuite/tests/driver/T5147/B1.hs b/testsuite/tests/driver/T5147/B1.hs new file mode 100644 index 0000000000..67c283dc73 --- /dev/null +++ b/testsuite/tests/driver/T5147/B1.hs @@ -0,0 +1,8 @@ +{-# LANGUAGE TypeFamilies #-} +module B where + +class Entity v where + data Fields v + +instance Show (Fields v) where show = undefined + diff --git a/testsuite/tests/driver/T5147/B2.hs b/testsuite/tests/driver/T5147/B2.hs new file mode 100644 index 0000000000..31857a3846 --- /dev/null +++ b/testsuite/tests/driver/T5147/B2.hs @@ -0,0 +1,9 @@ +{-# LANGUAGE TypeFamilies #-} +module B where + +class Entity v where + data Fields v + +-- Remove instance +-- instance Show (Fields v) where show = undefined + diff --git a/testsuite/tests/driver/T5147/Makefile b/testsuite/tests/driver/T5147/Makefile new file mode 100644 index 0000000000..e298ad7209 --- /dev/null +++ b/testsuite/tests/driver/T5147/Makefile @@ -0,0 +1,21 @@ +TOP=../../.. +include $(TOP)/mk/boilerplate.mk +include $(TOP)/mk/test.mk + +# Recompilation tests + +clean: + rm -f *.o *.hi + rm -f B.hs C + +# Removing an instance declaration should force recompilation +# failed in GHC 7.0 + +T5147: clean + cp B1.hs B.hs + '$(TEST_HC)' $(TEST_HC_OPTS) --make -v0 A.hs + sleep 1 + cp B2.hs B.hs + if '$(TEST_HC)' $(TEST_HC_OPTS) --make -v0 A.hs; then exit 1; else exit 0; fi +# Reverse the sense of the error; we *expect* +# the compilation to fail, and then we want to succeed diff --git a/testsuite/tests/driver/T5147/T5147.stderr b/testsuite/tests/driver/T5147/T5147.stderr new file mode 100644 index 0000000000..b38cad9850 --- /dev/null +++ b/testsuite/tests/driver/T5147/T5147.stderr @@ -0,0 +1,7 @@ + +A.hs:6:15: + No instance for (Show (Fields v)) + arising from a use of `show' + Possible fix: add an instance declaration for (Show (Fields v)) + In the expression: show a + In an equation for `showField': showField a = show a diff --git a/testsuite/tests/driver/T5147/all.T b/testsuite/tests/driver/T5147/all.T new file mode 100644 index 0000000000..40565edb54 --- /dev/null +++ b/testsuite/tests/driver/T5147/all.T @@ -0,0 +1,5 @@ +test('T5147', + [clean_cmd('$MAKE -s clean')], + run_command, + ['$MAKE -s --no-print-directory T5147']) + |