From 24f6bec94411aa6c39a2c94ce5154ffe96ae330f Mon Sep 17 00:00:00 2001 From: "Edward Z. Yang" Date: Thu, 8 Dec 2016 19:32:37 -0800 Subject: 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 , and get a mysterious error. Check for this earlier! Fixes #12955. Signed-off-by: Edward Z. Yang Test Plan: validate Reviewers: simonpj, austin, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2815 GHC Trac Issues: #12955 --- testsuite/tests/driver/Makefile | 5 +++++ testsuite/tests/driver/T12955.hsig | 1 + testsuite/tests/driver/T12955.stderr | 9 +++++++++ testsuite/tests/driver/all.T | 2 ++ 4 files changed, 17 insertions(+) create mode 100644 testsuite/tests/driver/T12955.hsig create mode 100644 testsuite/tests/driver/T12955.stderr (limited to 'testsuite/tests/driver') 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=" + replacing 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']) -- cgit v1.2.1