diff options
author | Edward Z. Yang <ezyang@cs.stanford.edu> | 2016-12-08 19:32:37 -0800 |
---|---|---|
committer | Edward Z. Yang <ezyang@cs.stanford.edu> | 2016-12-12 23:09:55 -0800 |
commit | 24f6bec94411aa6c39a2c94ce5154ffe96ae330f (patch) | |
tree | 594b5f74d9889751abc5e959109e78c2fd789eb3 /testsuite/tests/driver | |
parent | 8f6d241a74efa6f6280689a9b14c36c6a9f4c231 (diff) | |
download | haskell-24f6bec94411aa6c39a2c94ce5154ffe96ae330f.tar.gz |
Sanity check if we pick up an hsig file without -instantiated-with.
Summary:
Previously we would just let compilation proceed along until
we tried to pull up the Module for the hsig file, and get
main:A instead of <A>, and get a mysterious error. Check
for this earlier!
Fixes #12955.
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Test Plan: validate
Reviewers: simonpj, austin, bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2815
GHC Trac Issues: #12955
Diffstat (limited to 'testsuite/tests/driver')
-rw-r--r-- | testsuite/tests/driver/Makefile | 5 | ||||
-rw-r--r-- | testsuite/tests/driver/T12955.hsig | 1 | ||||
-rw-r--r-- | testsuite/tests/driver/T12955.stderr | 9 | ||||
-rw-r--r-- | testsuite/tests/driver/all.T | 2 |
4 files changed, 17 insertions, 0 deletions
diff --git a/testsuite/tests/driver/Makefile b/testsuite/tests/driver/Makefile index 4e9ef20f41..2dfb41f223 100644 --- a/testsuite/tests/driver/Makefile +++ b/testsuite/tests/driver/Makefile @@ -636,3 +636,8 @@ T10923: "$(TEST_HC)" $(TEST_HC_OPTS) -v1 -O0 -c T10923.hs # should NOT output "compilation is NOT required" "$(TEST_HC)" $(TEST_HC_OPTS) -v1 -O -c T10923.hs + +.PHONY: T12955 +T12955: + ! "$(TEST_HC)" $(TEST_HC_OPTS) --make T12955 + ! "$(TEST_HC)" $(TEST_HC_OPTS) --make T12955 -fbuilding-cabal-package diff --git a/testsuite/tests/driver/T12955.hsig b/testsuite/tests/driver/T12955.hsig new file mode 100644 index 0000000000..3b674fc497 --- /dev/null +++ b/testsuite/tests/driver/T12955.hsig @@ -0,0 +1 @@ +signature T12955 where diff --git a/testsuite/tests/driver/T12955.stderr b/testsuite/tests/driver/T12955.stderr new file mode 100644 index 0000000000..acf4000608 --- /dev/null +++ b/testsuite/tests/driver/T12955.stderr @@ -0,0 +1,9 @@ + +T12955.hsig:1:11: error: + Unexpected signature: ‘T12955’ + (Try passing -instantiated-with="T12955=<T12955>" + replacing <T12955> as necessary.) + +T12955.hsig:1:11: error: + Unexpected signature: ‘T12955’ + (Try adding ‘T12955’ to the ‘signatures’ field in your Cabal file.) diff --git a/testsuite/tests/driver/all.T b/testsuite/tests/driver/all.T index 8cd5c2f968..9119c715aa 100644 --- a/testsuite/tests/driver/all.T +++ b/testsuite/tests/driver/all.T @@ -499,3 +499,5 @@ test('T10923', ['$MAKE -s --no-print-directory T10923']) test('T12752pass', normal, compile, ['-DSHOULD_PASS=1 -Wcpp-undef']) + +test('T12955', normal, run_command, ['$MAKE -s --no-print-directory T12955']) |