Skip to content

Commit 0f9d410

Browse files
committed
GHC 9.10 compat in testsuite: CPP symbols don't get passed to CC as
eagearly Discussion: #9914 (comment) Related GHC issue: https://gitlab.haskell.org/ghc/ghc/-/issues/21291
1 parent 52ddf1d commit 0f9d410

File tree

4 files changed

+6
-13
lines changed

4 files changed

+6
-13
lines changed

cabal-testsuite/PackageTests/CCompilerOverride/foo.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,8 @@
11

2-
#ifndef NOERROR1
3-
#error "NOERROR1 was not passed"
4-
#endif
5-
62
#ifndef NOERROR2
73
#error "NOERROR2 was not passed"
84
#endif
95

10-
#ifndef NOERROR3
11-
#error "NOERROR3 was not passed"
12-
#endif
13-
146
#ifndef NOERROR4
157
#error "NOERROR4 was not passed"
168
#endif

cabal-testsuite/PackageTests/CCompilerOverride/my.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ executable foo
99
main-is: Main.hs
1010
c-sources: foo.c
1111
build-depends: base
12-
ghc-options: -DNOERROR4
12+
ghc-options: -optc=-DNOERROR4
1313
cc-options: -DNOERROR5 -march=native
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
# Setup configure
22
Configuring my-0.1...
3-
Warning: [misplaced-c-opt] Instead of 'ghc-options: -DNOERROR4' use 'cpp-options: -DNOERROR4'
43
# Setup build

cabal-testsuite/PackageTests/CCompilerOverride/setup.test.hs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ import Test.Cabal.Prelude
33
-- Test that all the respective defines -DNOERROR... specified in various ways
44
-- all end up routed to the C compiler. Otherwise the C file we depend on will
55
-- not compile.
6+
--
7+
-- This has been largely gutted, as ghc 9.10 no longer passes through most
8+
-- of the defines we were testing; see
9+
-- https://gitlab.haskell.org/ghc/ghc/-/commit/8ff3134ed4aa323b0199ad683f72165e51a59ab6
610
main = setupAndCabalTest $ do
711
skipUnlessGhcVersion ">= 8.8"
812
isWin <- isWindows
@@ -14,9 +18,7 @@ main = setupAndCabalTest $ do
1418
pwd ++ "/custom-cc" ++ if isWin then win_suffix else ""
1519

1620
setup "configure"
17-
[ "--ghc-option=-DNOERROR1"
18-
, "--ghc-option=-optc=-DNOERROR2"
19-
, "--ghc-option=-optP=-DNOERROR3"
21+
[ "--ghc-option=-optc=-DNOERROR2"
2022
, "--with-gcc=" ++ customCC
2123
]
2224
setup "build" ["-v2"]

0 commit comments

Comments
 (0)