diff options
author | Matthew Pickering <matthewtpickering@gmail.com> | 2022-08-15 14:28:58 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2022-08-18 09:24:44 -0400 |
commit | a740a4c56416c7c1bc914a7a9207207e17833573 (patch) | |
tree | c92a65b22e6c25ce49cc51ff771291d2fac7ba05 /testsuite/tests/driver/Makefile | |
parent | 436867d6b07c69170e8e51283ac57ed3eab52ae4 (diff) | |
download | haskell-a740a4c56416c7c1bc914a7a9207207e17833573.tar.gz |
driver: Honour -x option
The -x option is used to manually specify which phase a file should be
started to be compiled from (even if it lacks the correct extension). I
just failed to implement this when refactoring the driver.
In particular Cabal calls GHC with `-E -cpp -x hs Foo.cpphs` to
preprocess source files using GHC.
I added a test to exercise this case.
Fixes #22044
Diffstat (limited to 'testsuite/tests/driver/Makefile')
-rw-r--r-- | testsuite/tests/driver/Makefile | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/testsuite/tests/driver/Makefile b/testsuite/tests/driver/Makefile index 085ca668a4..7c9625570a 100644 --- a/testsuite/tests/driver/Makefile +++ b/testsuite/tests/driver/Makefile @@ -779,3 +779,11 @@ T21869: "$(TEST_HC)" $(TEST_HC_OPTS) -v0 T21869.hs -S [ -f T21869.s ] || (echo "assembly file does not exist" && exit 2) [ ! -f T21869.o ] || (echo "object file exists" && exit 2) + +.PHONY: T22044 +T22044: + "$(TEST_HC)" $(TEST_HC_OPTS) -v0 -E -cpp -x hs T22044.bazoo -o T22044.hs -DBAZOO=1 + # Test the file exists and is preprocessed + "$(TEST_HC)" $(TEST_HC_OPTS) -v0 T22044.hs + + |