... |
... |
@@ -86,6 +86,16 @@ data TestCompilerArgs = TestCompilerArgs{ |
86
|
86
|
, pkgConfCacheFile :: FilePath }
|
87
|
87
|
deriving (Eq, Show)
|
88
|
88
|
|
|
89
|
+-- | Some archs like wasm32/js used to report have_llvm=True because
|
|
90
|
+-- they are based on LLVM related toolchains like wasi-sdk/emscripten,
|
|
91
|
+-- but these targets don't really support the LLVM backend, and the
|
|
92
|
+-- optllvm test way doesn't work. We used to special-case wasm32/js to
|
|
93
|
+-- avoid auto-adding optllvm way in testsuite/config/ghc, but this is
|
|
94
|
+-- still problematic if someone writes a new LLVM-related test and
|
|
95
|
+-- uses something like when(have_llvm(), extra_ways(["optllvm"])). So
|
|
96
|
+-- better just enforce have_llvm=False for these targets here.
|
|
97
|
+allowHaveLLVM :: String -> Bool
|
|
98
|
+allowHaveLLVM = not . (`elem` ["wasm32", "javascript"])
|
89
|
99
|
|
90
|
100
|
-- | If the tree is in-compiler then we already know how we will build it so
|
91
|
101
|
-- don't build anything in order to work out what we will build.
|
... |
... |
@@ -129,7 +139,7 @@ inTreeCompilerArgs stg = do |
129
|
139
|
|
130
|
140
|
llc_cmd <- queryTargetTarget tgtLlc
|
131
|
141
|
llvm_as_cmd <- queryTargetTarget tgtLlvmAs
|
132
|
|
- let have_llvm = all isJust [llc_cmd, llvm_as_cmd]
|
|
142
|
+ let have_llvm = allowHaveLLVM arch && all isJust [llc_cmd, llvm_as_cmd]
|
133
|
143
|
|
134
|
144
|
top <- topDirectory
|
135
|
145
|
|
... |
... |
@@ -176,7 +186,7 @@ outOfTreeCompilerArgs = do |
176
|
186
|
let debugged = "debug" `isInfixOf` rtsWay
|
177
|
187
|
|
178
|
188
|
llc_cmd <- getTestSetting TestLLC
|
179
|
|
- have_llvm <- liftIO (isJust <$> findExecutable llc_cmd)
|
|
189
|
+ have_llvm <- (allowHaveLLVM arch &&) <$> liftIO (isJust <$> findExecutable llc_cmd)
|
180
|
190
|
profiled <- getBooleanSetting TestGhcProfiled
|
181
|
191
|
|
182
|
192
|
pkgConfCacheFile <- getTestSetting TestGhcPackageDb <&> (</> "package.cache")
|