Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC
Commits:
-
44b8cee2
by Cheng Shao at 2025-06-18T15:34:46-04:00
-
894a04f3
by Cheng Shao at 2025-06-18T15:34:46-04:00
4 changed files:
- compiler/GHC/SysTools/Ar.hs
- + testsuite/tests/ghc-api/T26120.hs
- + testsuite/tests/ghc-api/T26120.stdout
- testsuite/tests/ghc-api/all.T
Changes:
| ... | ... | @@ -168,7 +168,7 @@ putArchEntry (ArchiveEntry name time own grp mode st_size file) = do |
| 168 | 168 | putPaddedInt 6 own
|
| 169 | 169 | putPaddedInt 6 grp
|
| 170 | 170 | putPaddedInt 8 mode
|
| 171 | - putPaddedInt 10 (st_size + pad)
|
|
| 171 | + putPaddedInt 10 st_size
|
|
| 172 | 172 | putByteString "\x60\x0a"
|
| 173 | 173 | putByteString file
|
| 174 | 174 | when (pad == 1) $
|
| 1 | +{-# LANGUAGE OverloadedStrings #-}
|
|
| 2 | + |
|
| 3 | +module Main
|
|
| 4 | + ( main,
|
|
| 5 | + )
|
|
| 6 | +where
|
|
| 7 | + |
|
| 8 | +import Data.Foldable
|
|
| 9 | +import GHC.SysTools.Ar
|
|
| 10 | + |
|
| 11 | +main :: IO ()
|
|
| 12 | +main = for_ [writeBSDAr, writeGNUAr] $ \writer -> do
|
|
| 13 | + writer "test.a" $
|
|
| 14 | + Archive
|
|
| 15 | + [ ArchiveEntry
|
|
| 16 | + { filename = "1",
|
|
| 17 | + filetime = 0,
|
|
| 18 | + fileown = 0,
|
|
| 19 | + filegrp = 0,
|
|
| 20 | + filemode = 644,
|
|
| 21 | + filesize = 1,
|
|
| 22 | + filedata = "\NUL"
|
|
| 23 | + }
|
|
| 24 | + ]
|
|
| 25 | + print =<< loadAr "test.a" |
| 1 | +Archive [ArchiveEntry {filename = "1", filetime = 0, fileown = 0, filegrp = 0, filemode = 644, filesize = 1, filedata = "\NUL"}]
|
|
| 2 | +Archive [ArchiveEntry {filename = "1", filetime = 0, fileown = 0, filegrp = 0, filemode = 644, filesize = 1, filedata = "\NUL"}] |
| ... | ... | @@ -70,3 +70,5 @@ test('T25577', [ extra_run_opts(f'"{config.libdir}"') |
| 70 | 70 | # support
|
| 71 | 71 | , when(arch('wasm32') or arch('javascript'), skip)
|
| 72 | 72 | ], compile_and_run, ['-package ghc'])
|
| 73 | + |
|
| 74 | +test('T26120', [], compile_and_run, ['-package ghc']) |