summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--compiler/main/DriverPhases.hs2
-rw-r--r--ghc/Main.hs4
-rw-r--r--testsuite/tests/driver/T12192.hs1
-rw-r--r--testsuite/tests/driver/all.T3
4 files changed, 7 insertions, 3 deletions
diff --git a/compiler/main/DriverPhases.hs b/compiler/main/DriverPhases.hs
index 84eee1bfb6..650bb15269 100644
--- a/compiler/main/DriverPhases.hs
+++ b/compiler/main/DriverPhases.hs
@@ -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]
diff --git a/ghc/Main.hs b/ghc/Main.hs
index 1a6cbebe3c..4870ce4d22 100644
--- a/ghc/Main.hs
+++ b/ghc/Main.hs
@@ -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
diff --git a/testsuite/tests/driver/T12192.hs b/testsuite/tests/driver/T12192.hs
new file mode 100644
index 0000000000..ce6da0245b
--- /dev/null
+++ b/testsuite/tests/driver/T12192.hs
@@ -0,0 +1 @@
+module T12192 where
diff --git a/testsuite/tests/driver/all.T b/testsuite/tests/driver/all.T
index 54c84bca36..36ba99b6ef 100644
--- a/testsuite/tests/driver/all.T
+++ b/testsuite/tests/driver/all.T
@@ -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)'])