diff options
author | Ben Gamari <ben@smart-cactus.org> | 2021-11-29 16:12:59 -0500 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-12-07 06:27:47 -0500 |
commit | 7d2283b9788fd5a724b41c0902067890059de3ff (patch) | |
tree | 0aab3b160b59007c148e7076753433c9e030697d /testsuite/tests | |
parent | 0fe45d4346de72d5cf87a03c1eeedea2e2521a5b (diff) | |
download | haskell-7d2283b9788fd5a724b41c0902067890059de3ff.tar.gz |
compiler: Eliminate accidental loop in GHC.SysTools.BaseDir
As noted in #20757, `GHC.SysTools.BaseDir.findToolDir` previously
contained an loop, which would be triggered in the case that the search
failed.
Closes #20757.
Diffstat (limited to 'testsuite/tests')
-rw-r--r-- | testsuite/tests/ghc-api/T20757.hs | 6 | ||||
-rw-r--r-- | testsuite/tests/ghc-api/T20757.stderr | 1 | ||||
-rw-r--r-- | testsuite/tests/ghc-api/all.T | 7 |
3 files changed, 12 insertions, 2 deletions
diff --git a/testsuite/tests/ghc-api/T20757.hs b/testsuite/tests/ghc-api/T20757.hs new file mode 100644 index 0000000000..b6af7815e8 --- /dev/null +++ b/testsuite/tests/ghc-api/T20757.hs @@ -0,0 +1,6 @@ +module Main where + +import GHC.SysTools.BaseDir + +main :: IO () +main = findToolDir False "/" >>= print diff --git a/testsuite/tests/ghc-api/T20757.stderr b/testsuite/tests/ghc-api/T20757.stderr new file mode 100644 index 0000000000..34678db7e3 --- /dev/null +++ b/testsuite/tests/ghc-api/T20757.stderr @@ -0,0 +1 @@ +T20757: could not detect mingw toolchain in the following paths: ["/..//mingw","/..//..//mingw","/..//..//..//mingw"] diff --git a/testsuite/tests/ghc-api/all.T b/testsuite/tests/ghc-api/all.T index 8eecd3c799..4d62a57682 100644 --- a/testsuite/tests/ghc-api/all.T +++ b/testsuite/tests/ghc-api/all.T @@ -30,5 +30,8 @@ test('T18522-dbg-ppr', compile_and_run, ['-package ghc']) test('T19156', extra_run_opts('"' + config.libdir + '"'), - compile_and_run, - ['-package ghc']) + compile_and_run, + ['-package ghc']) +test('T20757', [unless(opsys('mingw32'), skip), exit_code(1)], + compile_and_run, + ['-package ghc']) |