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 | |
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')
-rw-r--r-- | testsuite/tests/backpack/reexport/bkpreex02.stderr | 8 | ||||
-rw-r--r-- | testsuite/tests/backpack/should_compile/bkp24.stderr | 4 | ||||
-rw-r--r-- | testsuite/tests/backpack/should_fail/bkpfail14.stderr | 2 | ||||
-rw-r--r-- | testsuite/tests/backpack/should_fail/bkpfail15.stderr | 2 | ||||
-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 |
8 files changed, 25 insertions, 8 deletions
diff --git a/testsuite/tests/backpack/reexport/bkpreex02.stderr b/testsuite/tests/backpack/reexport/bkpreex02.stderr index 44c07c44ff..8ae6714f33 100644 --- a/testsuite/tests/backpack/reexport/bkpreex02.stderr +++ b/testsuite/tests/backpack/reexport/bkpreex02.stderr @@ -15,11 +15,11 @@ [2 of 2] Compiling T ( r-impl/T.hs, nothing ) [5 of 5] Processing r Instantiating r - [1 of 1] Including q[H=r-impl:H, T=r-impl:T] - Instantiating q[H=r-impl:H, T=r-impl:T] + [1 of 1] Including q[H=r-impl:H,T=r-impl:T] + Instantiating q[H=r-impl:H,T=r-impl:T] [1 of 2] Including timpl - [2 of 2] Including p[H=r-impl:H, T=r-impl:T] - Instantiating p[H=r-impl:H, T=r-impl:T] + [2 of 2] Including p[H=r-impl:H,T=r-impl:T] + Instantiating p[H=r-impl:H,T=r-impl:T] [1 of 2] Compiling T[sig] ( p/T.hsig, nothing ) [2 of 2] Compiling H[sig] ( p/H.hsig, nothing ) [1 of 3] Compiling T[sig] ( q/T.hsig, nothing ) diff --git a/testsuite/tests/backpack/should_compile/bkp24.stderr b/testsuite/tests/backpack/should_compile/bkp24.stderr index 73e1f9d6fb..ddafe4150b 100644 --- a/testsuite/tests/backpack/should_compile/bkp24.stderr +++ b/testsuite/tests/backpack/should_compile/bkp24.stderr @@ -15,8 +15,8 @@ Instantiating r [1 of 2] Including q[B=b:B] Instantiating q[B=b:B] - [1 of 2] Including p[A=a:A, B=b:B] - Instantiating p[A=a:A, B=b:B] + [1 of 2] Including p[A=a:A,B=b:B] + Instantiating p[A=a:A,B=b:B] [1 of 3] Compiling A[sig] ( p/A.hsig, bkp24.out/p/p-BVwzUlgOVR6H8V9umpUZ2h/A.o ) [2 of 3] Compiling B[sig] ( p/B.hsig, bkp24.out/p/p-BVwzUlgOVR6H8V9umpUZ2h/B.o ) [3 of 3] Compiling P ( p/P.hs, bkp24.out/p/p-BVwzUlgOVR6H8V9umpUZ2h/P.o ) diff --git a/testsuite/tests/backpack/should_fail/bkpfail14.stderr b/testsuite/tests/backpack/should_fail/bkpfail14.stderr index ddfddeeb91..d89e6cab28 100644 --- a/testsuite/tests/backpack/should_fail/bkpfail14.stderr +++ b/testsuite/tests/backpack/should_fail/bkpfail14.stderr @@ -15,4 +15,4 @@ bkpfail14.bkp:9:9: error: Main module: f :: GHC.Types.Bool Hsig file: f :: GHC.Types.Int The two types are different - • while checking that QMe implements signature Q in p[Q=QMe, Q2=Q2] + • while checking that QMe implements signature Q in p[Q=QMe,Q2=Q2] diff --git a/testsuite/tests/backpack/should_fail/bkpfail15.stderr b/testsuite/tests/backpack/should_fail/bkpfail15.stderr index e761cb102e..f32cd6dcf7 100644 --- a/testsuite/tests/backpack/should_fail/bkpfail15.stderr +++ b/testsuite/tests/backpack/should_fail/bkpfail15.stderr @@ -14,4 +14,4 @@ bkpfail15.bkp:8:9: error: Main module: f :: GHC.Types.Bool Hsig file: f :: GHC.Types.Int The two types are different - • while checking that q:Q implements signature Q in p[A=<A>, Q=q:Q] + • while checking that q:Q implements signature Q in p[A=<A>,Q=q:Q] 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']) |