diff options
author | Edward Z. Yang <ezyang@cs.stanford.edu> | 2015-06-11 14:57:50 -0700 |
---|---|---|
committer | Edward Z. Yang <ezyang@cs.stanford.edu> | 2015-06-11 14:57:50 -0700 |
commit | 23582b0c16bb147dad6bd7dee98686a8b61eacea (patch) | |
tree | d2ae431261e89d96f1b5c329ba26ca7b9f649d66 /testsuite | |
parent | 0db0ac4a255931036c5859c3f22108f4e27ccd11 (diff) | |
download | haskell-23582b0c16bb147dad6bd7dee98686a8b61eacea.tar.gz |
Add failing test for #9562.
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/.gitignore | 1 | ||||
-rw-r--r-- | testsuite/tests/driver/T9562/A.hs | 5 | ||||
-rw-r--r-- | testsuite/tests/driver/T9562/B.hs | 11 | ||||
-rw-r--r-- | testsuite/tests/driver/T9562/B.hs-boot | 5 | ||||
-rw-r--r-- | testsuite/tests/driver/T9562/C.hs | 3 | ||||
-rw-r--r-- | testsuite/tests/driver/T9562/D.hs | 11 | ||||
-rw-r--r-- | testsuite/tests/driver/T9562/Main.hs | 5 | ||||
-rw-r--r-- | testsuite/tests/driver/T9562/Makefile | 12 | ||||
-rw-r--r-- | testsuite/tests/driver/T9562/all.T | 6 |
9 files changed, 59 insertions, 0 deletions
diff --git a/testsuite/.gitignore b/testsuite/.gitignore index 1855727c56..ade0024bcb 100644 --- a/testsuite/.gitignore +++ b/testsuite/.gitignore @@ -540,6 +540,7 @@ mk/ghcconfig*_inplace_bin_ghc-stage2.exe.mk /tests/driver/T7835/Test /tests/driver/T8526/A.inc /tests/driver/T8602/t8602.sh +/tests/driver/T9562/Main /tests/driver/Test.081b /tests/driver/Test.081b.hs /tests/driver/Test_081a diff --git a/testsuite/tests/driver/T9562/A.hs b/testsuite/tests/driver/T9562/A.hs new file mode 100644 index 0000000000..03f5ad3bbe --- /dev/null +++ b/testsuite/tests/driver/T9562/A.hs @@ -0,0 +1,5 @@ +{-# LANGUAGE TypeFamilies #-} + +module A where + +type family F a b diff --git a/testsuite/tests/driver/T9562/B.hs b/testsuite/tests/driver/T9562/B.hs new file mode 100644 index 0000000000..34fe7b8f2e --- /dev/null +++ b/testsuite/tests/driver/T9562/B.hs @@ -0,0 +1,11 @@ +{-# LANGUAGE TypeFamilies #-} + +module B where + +import A +import C + +type instance F a b = b + +oops :: F a b -> a -> b +oops = const diff --git a/testsuite/tests/driver/T9562/B.hs-boot b/testsuite/tests/driver/T9562/B.hs-boot new file mode 100644 index 0000000000..facbc8c0e3 --- /dev/null +++ b/testsuite/tests/driver/T9562/B.hs-boot @@ -0,0 +1,5 @@ +module B where + +import A + +oops :: F a b -> a -> b diff --git a/testsuite/tests/driver/T9562/C.hs b/testsuite/tests/driver/T9562/C.hs new file mode 100644 index 0000000000..bca4f464e1 --- /dev/null +++ b/testsuite/tests/driver/T9562/C.hs @@ -0,0 +1,3 @@ +module C (oops) where + +import {-# SOURCE #-} B diff --git a/testsuite/tests/driver/T9562/D.hs b/testsuite/tests/driver/T9562/D.hs new file mode 100644 index 0000000000..c9becebc85 --- /dev/null +++ b/testsuite/tests/driver/T9562/D.hs @@ -0,0 +1,11 @@ +{-# LANGUAGE TypeFamilies #-} + +module D where + +import A +import C + +type instance F a b = a + +unsafeCoerce :: a -> b +unsafeCoerce x = oops x x diff --git a/testsuite/tests/driver/T9562/Main.hs b/testsuite/tests/driver/T9562/Main.hs new file mode 100644 index 0000000000..fabf5f585b --- /dev/null +++ b/testsuite/tests/driver/T9562/Main.hs @@ -0,0 +1,5 @@ +module Main where + +import D ( unsafeCoerce ) + +main = print $ (unsafeCoerce True :: Int) diff --git a/testsuite/tests/driver/T9562/Makefile b/testsuite/tests/driver/T9562/Makefile new file mode 100644 index 0000000000..423389d18b --- /dev/null +++ b/testsuite/tests/driver/T9562/Makefile @@ -0,0 +1,12 @@ +TOP=../../.. +include $(TOP)/mk/boilerplate.mk +include $(TOP)/mk/test.mk + +T9562: + rm -f *.o *.hi *.o-boot *.hi-boot Main + '$(TEST_HC)' -c A.hs + '$(TEST_HC)' -c B.hs-boot + '$(TEST_HC)' -c C.hs + '$(TEST_HC)' -c B.hs + '$(TEST_HC)' -c D.hs + ! ('$(TEST_HC)' Main.hs && ./Main) diff --git a/testsuite/tests/driver/T9562/all.T b/testsuite/tests/driver/T9562/all.T new file mode 100644 index 0000000000..ab379ee715 --- /dev/null +++ b/testsuite/tests/driver/T9562/all.T @@ -0,0 +1,6 @@ +setTestOpts(only_compiler_types(['ghc'])) + +test('T9562', + [extra_clean(['A011.hi', 'A011.o']), expect_broken(9562)], + run_command, + ['$MAKE -s --no-print-directory T9562']) |