Commit e02beb18 authored by thomie's avatar thomie

Driver: `ghc ../Test` (without file extension) should work

Reviewed by: bgamari

Differential Revision: https://phabricator.haskell.org/D2331

GHC Trac Issues: #12192
parent 9bb05785
......@@ -348,7 +348,7 @@ isSourceSuffix suff = isHaskellishSuffix suff || isCishSuffix suff
-- specified suffix is a Haskell one.
isHaskellishTarget :: (String, Maybe Phase) -> Bool
isHaskellishTarget (f,Nothing) =
looksLikeModuleName f || isHaskellSrcFilename f || '.' `notElem` f
looksLikeModuleName f || isHaskellSrcFilename f || not (hasExtension f)
isHaskellishTarget (_,Just phase) =
phase `notElem` [ As True, As False, Cc, Cobjc, Cobjcxx, CmmCpp, Cmm
, StopLn]
......
......@@ -306,7 +306,7 @@ partition_args (arg:args) srcs objs
the flag parser, and we want them to generate errors later in
checkOptions, so we class them as source files (#5921)
- and finally we consider everything not containing a '.' to be
- and finally we consider everything without an extension to be
a comp manager input, as shorthand for a .hs or .lhs filename.
Everything else is considered to be a linker object, and passed
......@@ -316,7 +316,7 @@ looks_like_an_input :: String -> Bool
looks_like_an_input m = isSourceFilename m
|| looksLikeModuleName m
|| "-" `isPrefixOf` m
|| '.' `notElem` m
|| not (hasExtension m)
-- -----------------------------------------------------------------------------
-- Option sanity checks
......
......@@ -488,3 +488,6 @@ test('T12135',
extra_clean(['T12135.o', 'T12135.hi', 'T12135', 'T12135a/T12135.h', 'T12135b/T12135.h'])],
run_command,
['$MAKE -s --no-print-directory T12135'])
test('T12192', normal, run_command,
['mkdir foo && (cd foo && {compiler} -v0 ../T12192)'])
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment