summaryrefslogtreecommitdiff
path: root/testsuite/tests/backpack
diff options
context:
space:
mode:
authorEdward Z. Yang <ezyang@cs.stanford.edu>2017-10-03 15:08:24 -0400
committerBen Gamari <ben@smart-cactus.org>2017-10-03 17:07:36 -0400
commitf3f624aeb1360c1f902930b3cc62346d2e5201c0 (patch)
tree29ef8e3cc3b0159737eb47137f20e5c84a339cb3 /testsuite/tests/backpack
parentde1b802b651de5397bb3c42cdf0189fdc41a8f82 (diff)
downloadhaskell-f3f624aeb1360c1f902930b3cc62346d2e5201c0.tar.gz
Include libraries which fill holes as deps when linking.
Fixes the issue reported at https://github.com/haskell/cabal/issues/4755 and fixes #14304 in the GHC tracker. Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: validate Reviewers: bgamari, austin, goldfire Reviewed By: bgamari Subscribers: rwbarton, thomie GHC Trac Issues: #14304 Differential Revision: https://phabricator.haskell.org/D4057
Diffstat (limited to 'testsuite/tests/backpack')
-rw-r--r--testsuite/tests/backpack/cabal/T14304/Makefile36
-rw-r--r--testsuite/tests/backpack/cabal/T14304/Setup.hs2
-rw-r--r--testsuite/tests/backpack/cabal/T14304/T14304.stderr6
-rw-r--r--testsuite/tests/backpack/cabal/T14304/all.T9
-rw-r--r--testsuite/tests/backpack/cabal/T14304/indef/Indef.hs3
-rw-r--r--testsuite/tests/backpack/cabal/T14304/indef/Sig.hsig2
-rw-r--r--testsuite/tests/backpack/cabal/T14304/indef/indef.cabal9
-rw-r--r--testsuite/tests/backpack/cabal/T14304/p/P.hs3
-rw-r--r--testsuite/tests/backpack/cabal/T14304/p/p.cabal8
-rw-r--r--testsuite/tests/backpack/cabal/T14304/th/TH.hs3
-rw-r--r--testsuite/tests/backpack/cabal/T14304/th/th.cabal9
11 files changed, 90 insertions, 0 deletions
diff --git a/testsuite/tests/backpack/cabal/T14304/Makefile b/testsuite/tests/backpack/cabal/T14304/Makefile
new file mode 100644
index 0000000000..1f58184198
--- /dev/null
+++ b/testsuite/tests/backpack/cabal/T14304/Makefile
@@ -0,0 +1,36 @@
+TOP=../../../..
+include $(TOP)/mk/boilerplate.mk
+include $(TOP)/mk/test.mk
+
+SETUP='$(PWD)/Setup' -v0
+CONFIGURE=$(SETUP) configure $(CABAL_MINIMAL_BUILD) --with-ghc='$(TEST_HC)' --ghc-options='$(TEST_HC_OPTS)' --package-db='$(PWD)/tmp.d' --prefix='$(PWD)/inst' --enable-shared
+
+T14304: clean
+ $(MAKE) -s --no-print-directory clean
+ '$(GHC_PKG)' init tmp.d
+ '$(TEST_HC)' -v0 --make Setup
+ # typecheck indef
+ rm -rf indef/dist
+ (cd indef; $(CONFIGURE) --ipid "indef-0.1")
+ (cd indef; $(SETUP) build)
+ (cd indef; $(SETUP) copy)
+ (cd indef; $(SETUP) register)
+ # build p
+ rm -rf p/dist
+ (cd p; $(CONFIGURE) --ipid "p-0.1")
+ (cd p; $(SETUP) build)
+ (cd p; $(SETUP) copy)
+ (cd p; $(SETUP) register)
+ # build indef instantiated with p
+ rm -rf indef/dist
+ (cd indef; $(CONFIGURE) --ipid "indef-0.1" --instantiate-with "Sig=p-0.1:P")
+ (cd indef; $(SETUP) build)
+ (cd indef; $(SETUP) copy)
+ (cd indef; $(SETUP) register)
+ # build th (which tests if we have correct linkage)
+ rm -rf th/dist
+ (cd th; $(CONFIGURE))
+ (cd th; $(SETUP) build)
+
+clean :
+ $(RM) -r tmp.d inst dist Setup$(exeext)
diff --git a/testsuite/tests/backpack/cabal/T14304/Setup.hs b/testsuite/tests/backpack/cabal/T14304/Setup.hs
new file mode 100644
index 0000000000..9a994af677
--- /dev/null
+++ b/testsuite/tests/backpack/cabal/T14304/Setup.hs
@@ -0,0 +1,2 @@
+import Distribution.Simple
+main = defaultMain
diff --git a/testsuite/tests/backpack/cabal/T14304/T14304.stderr b/testsuite/tests/backpack/cabal/T14304/T14304.stderr
new file mode 100644
index 0000000000..89a07b9193
--- /dev/null
+++ b/testsuite/tests/backpack/cabal/T14304/T14304.stderr
@@ -0,0 +1,6 @@
+Warning: -rtsopts and -with-rtsopts have no effect with -shared.
+ Call hs_init_ghc() from your main() function to set these options.
+Warning: -rtsopts and -with-rtsopts have no effect with -shared.
+ Call hs_init_ghc() from your main() function to set these options.
+Warning: -rtsopts and -with-rtsopts have no effect with -shared.
+ Call hs_init_ghc() from your main() function to set these options.
diff --git a/testsuite/tests/backpack/cabal/T14304/all.T b/testsuite/tests/backpack/cabal/T14304/all.T
new file mode 100644
index 0000000000..f25285d0d0
--- /dev/null
+++ b/testsuite/tests/backpack/cabal/T14304/all.T
@@ -0,0 +1,9 @@
+if config.cleanup:
+ cleanup = 'CLEANUP=1'
+else:
+ cleanup = 'CLEANUP=0'
+
+test('T14304',
+ extra_files(['p', 'indef', 'th', 'Setup.hs']),
+ run_command,
+ ['$MAKE -s --no-print-directory T14304 ' + cleanup])
diff --git a/testsuite/tests/backpack/cabal/T14304/indef/Indef.hs b/testsuite/tests/backpack/cabal/T14304/indef/Indef.hs
new file mode 100644
index 0000000000..0bd438e6de
--- /dev/null
+++ b/testsuite/tests/backpack/cabal/T14304/indef/Indef.hs
@@ -0,0 +1,3 @@
+module Indef where
+import Sig
+data T = MkT B
diff --git a/testsuite/tests/backpack/cabal/T14304/indef/Sig.hsig b/testsuite/tests/backpack/cabal/T14304/indef/Sig.hsig
new file mode 100644
index 0000000000..a37b1908bc
--- /dev/null
+++ b/testsuite/tests/backpack/cabal/T14304/indef/Sig.hsig
@@ -0,0 +1,2 @@
+signature Sig where
+data B
diff --git a/testsuite/tests/backpack/cabal/T14304/indef/indef.cabal b/testsuite/tests/backpack/cabal/T14304/indef/indef.cabal
new file mode 100644
index 0000000000..d89f055959
--- /dev/null
+++ b/testsuite/tests/backpack/cabal/T14304/indef/indef.cabal
@@ -0,0 +1,9 @@
+name: indef
+version: 1.0
+build-type: Simple
+cabal-version: >= 2.0
+
+library
+ build-depends: base
+ signatures: Sig
+ exposed-modules: Indef
diff --git a/testsuite/tests/backpack/cabal/T14304/p/P.hs b/testsuite/tests/backpack/cabal/T14304/p/P.hs
new file mode 100644
index 0000000000..f570e0bb7f
--- /dev/null
+++ b/testsuite/tests/backpack/cabal/T14304/p/P.hs
@@ -0,0 +1,3 @@
+module P where
+type B = Foo
+newtype Foo = Foo Double
diff --git a/testsuite/tests/backpack/cabal/T14304/p/p.cabal b/testsuite/tests/backpack/cabal/T14304/p/p.cabal
new file mode 100644
index 0000000000..f49ce4273f
--- /dev/null
+++ b/testsuite/tests/backpack/cabal/T14304/p/p.cabal
@@ -0,0 +1,8 @@
+name: p
+version: 1.0
+build-type: Simple
+cabal-version: >= 2.0
+
+library
+ build-depends: base
+ exposed-modules: P
diff --git a/testsuite/tests/backpack/cabal/T14304/th/TH.hs b/testsuite/tests/backpack/cabal/T14304/th/TH.hs
new file mode 100644
index 0000000000..5d921cf931
--- /dev/null
+++ b/testsuite/tests/backpack/cabal/T14304/th/TH.hs
@@ -0,0 +1,3 @@
+{-# LANGUAGE TemplateHaskell #-}
+module TH where
+$( return [] )
diff --git a/testsuite/tests/backpack/cabal/T14304/th/th.cabal b/testsuite/tests/backpack/cabal/T14304/th/th.cabal
new file mode 100644
index 0000000000..2b17f09493
--- /dev/null
+++ b/testsuite/tests/backpack/cabal/T14304/th/th.cabal
@@ -0,0 +1,9 @@
+name: th
+version: 1.0
+build-type: Simple
+cabal-version: >= 2.0
+
+library
+ build-depends: p, indef, base
+ mixins: p (P as Sig)
+ exposed-modules: TH