
[Git][ghc/ghc][master] haddock: Parse math even after ordinary characters
by Marge Bot (@marge-bot) 06 Jun '25
by Marge Bot (@marge-bot) 06 Jun '25
06 Jun '25
Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC
Commits:
6558467c by Ryan Hendrickson at 2025-06-06T05:46:58-04:00
haddock: Parse math even after ordinary characters
Fixes a bug where math sections were not recognized if preceded by a
character that isn't special (like space or a markup character).
- - - - -
2 changed files:
- utils/haddock/haddock-library/src/Documentation/Haddock/Parser.hs
- utils/haddock/haddock-library/test/Documentation/Haddock/ParserSpec.hs
Changes:
=====================================
utils/haddock/haddock-library/src/Documentation/Haddock/Parser.hs
=====================================
@@ -1,3 +1,4 @@
+{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ViewPatterns #-}
@@ -28,6 +29,7 @@ import Control.Applicative
import Control.Arrow (first)
import Control.Monad
import Data.Char (chr, isAlpha, isSpace, isUpper)
+import Data.Functor (($>))
import Data.List (elemIndex, intercalate, intersperse, unfoldr)
import Data.Maybe (fromMaybe, mapMaybe)
import Data.Monoid
@@ -186,11 +188,29 @@ specialChar = "_/<@\"&'`#[ "
-- to ensure that we have already given a chance to more meaningful parsers
-- before capturing their characters.
string' :: Parser (DocH mod a)
-string' = DocString . unescape . T.unpack <$> takeWhile1_ (`notElem` specialChar)
+string' =
+ DocString
+ <$> ((:) <$> rawOrEscChar "" <*> many (rawOrEscChar "(["))
+ -- After the first character, stop for @\(@ or @\[@ math starters. (The
+ -- first character won't start a valid math string because this parser
+ -- should follow math parsers. But this parser is expected to accept at
+ -- least one character from all inputs that don't start with special
+ -- characters, so the first character parser can't have the @"(["@
+ -- restriction.)
where
- unescape "" = ""
- unescape ('\\' : x : xs) = x : unescape xs
- unescape (x : xs) = x : unescape xs
+ -- | Parse a single logical character, either raw or escaped. Don't accept
+ -- escaped characters from the argument string.
+ rawOrEscChar :: [Char] -> Parser Char
+ rawOrEscChar restrictedEscapes = try $ Parsec.noneOf specialChar >>= \case
+ -- Handle backslashes:
+ -- - Fail on forbidden escape characters.
+ -- - Non-forbidden characters: simply unescape, e.g. parse "\b" as 'b',
+ -- - Trailing backslash: treat it as a raw backslash, not an escape
+ -- sequence. (This is the logic that this parser followed when this
+ -- comment was written; it is not necessarily intentional but now I
+ -- don't want to break anything relying on it.)
+ '\\' -> Parsec.noneOf restrictedEscapes <|> Parsec.eof $> '\\'
+ c -> pure c
-- | Skips a single special character and treats it as a plain string.
-- This is done to skip over any special characters belonging to other
=====================================
utils/haddock/haddock-library/test/Documentation/Haddock/ParserSpec.hs
=====================================
@@ -284,6 +284,13 @@ spec = do
it "supports title for deprecated picture syntax" $ do
"<<b a z>>" `shouldParseTo` image "b" "a z"
+ context "when parsing inline math" $ do
+ it "accepts inline math immediately after punctuation" $ do
+ "(\\(1 + 2 = 3\\) is an example of addition)"
+ `shouldParseTo` "("
+ <> DocMathInline "1 + 2 = 3"
+ <> " is an example of addition)"
+
context "when parsing display math" $ do
it "accepts markdown syntax for display math containing newlines" $ do
"\\[\\pi\n\\pi\\]" `shouldParseTo` DocMathDisplay "\\pi\n\\pi"
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/6558467c0e3a9b97141ec9f0cdbadf3…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/6558467c0e3a9b97141ec9f0cdbadf3…
You're receiving this email because of your account on gitlab.haskell.org.
1
0

06 Jun '25
Apoorv Ingle pushed to branch wip/spj-apporv-Oct24 at Glasgow Haskell Compiler / GHC
Commits:
880146d6 by Apoorv Ingle at 2025-06-05T22:40:47-05:00
do not suppress pprArising
- - - - -
3 changed files:
- compiler/GHC/Tc/Errors/Ppr.hs
- compiler/GHC/Tc/Gen/Expr.hs
- testsuite/tests/indexed-types/should_fail/T5439.stderr
Changes:
=====================================
compiler/GHC/Tc/Errors/Ppr.hs
=====================================
@@ -5327,7 +5327,6 @@ pprArising :: CtLoc -> SDoc
-- Used for the main, top-level error message
-- We've done special processing for TypeEq, KindEq, givens
pprArising ct_loc
- | in_generated_code = empty -- See Note ["Arising from" messages in generated code]
| suppress_origin = empty
| otherwise = pprCtOrigin orig
where
=====================================
compiler/GHC/Tc/Gen/Expr.hs
=====================================
@@ -295,7 +295,7 @@ tcExpr :: HsExpr GhcRn
-- These constructors are the union of
-- - ones taken apart by GHC.Tc.Gen.Head.splitHsApps
-- - ones understood by GHC.Tc.Gen.Head.tcInferAppHead_maybe
--- See Note [Application chains and heads] in GHC.Tc.Gen.Ap
+-- See Note [Application chains and heads] in GHC.Tc.Gen.App
tcExpr e@(HsVar {}) res_ty = tcApp (exprCtOrigin e) e res_ty
tcExpr e@(HsApp {}) res_ty = tcApp (exprCtOrigin e) e res_ty
tcExpr e@(OpApp {}) res_ty = tcApp (exprCtOrigin e) e res_ty
=====================================
testsuite/tests/indexed-types/should_fail/T5439.stderr
=====================================
@@ -1,4 +1,3 @@
-
T5439.hs:83:33: error: [GHC-83865]
• Couldn't match expected type: Attempt (HElemOf rs)
with actual type: Attempt (HHead (HDrop n0 l0))
@@ -6,8 +5,7 @@ T5439.hs:83:33: error: [GHC-83865]
• Probable cause: ‘($)’ is applied to too few arguments
In the second argument of ‘($)’, namely
‘inj $ Failure (e :: SomeException)’
- In a stmt of a 'do' block:
- c <- complete ev $ inj $ Failure (e :: SomeException)
+ In the expression: complete ev $ inj $ Failure (e :: SomeException)
In the expression:
do c <- complete ev $ inj $ Failure (e :: SomeException)
return $ c || not first
@@ -28,5 +26,5 @@ T5439.hs:83:39: error: [GHC-83865]
‘Failure (e :: SomeException)’
In the second argument of ‘($)’, namely
‘inj $ Failure (e :: SomeException)’
- In a stmt of a 'do' block:
- c <- complete ev $ inj $ Failure (e :: SomeException)
+ In the expression: complete ev $ inj $ Failure (e :: SomeException)
+
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/880146d68eee678c82002c89e92bac2…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/880146d68eee678c82002c89e92bac2…
You're receiving this email because of your account on gitlab.haskell.org.
1
0

[Git][ghc/ghc][wip/marge_bot_batch_merge_job] 4 commits: haddock: Parse math even after ordinary characters
by Marge Bot (@marge-bot) 06 Jun '25
by Marge Bot (@marge-bot) 06 Jun '25
06 Jun '25
Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC
Commits:
54bc301b by Ryan Hendrickson at 2025-06-05T22:46:14-04:00
haddock: Parse math even after ordinary characters
Fixes a bug where math sections were not recognized if preceded by a
character that isn't special (like space or a markup character).
- - - - -
945dc0a8 by ARATA Mizuki at 2025-06-05T22:46:20-04:00
AArch64 NCG: Fix sub-word arithmetic right shift
As noted in Note [Signed arithmetic on AArch64], we should zero-extend sub-word values.
Fixes #26061
- - - - -
572cf06a by Simon Hengel at 2025-06-05T22:46:23-04:00
Allow Unicode in "message" and "hints" with -fdiagnostics-as-json
(fixes #26075)
- - - - -
eec6dd1b by ARATA Mizuki at 2025-06-05T22:46:26-04:00
x86 NCG: Fix code generation of bswap64 on i386
Co-authored-by: sheaf <sam.derbyshire(a)gmail.com>
Fix #25601
- - - - -
14 changed files:
- compiler/GHC/CmmToAsm/AArch64/CodeGen.hs
- compiler/GHC/CmmToAsm/X86/CodeGen.hs
- compiler/GHC/Types/Error.hs
- + testsuite/tests/cmm/should_run/T25601.hs
- + testsuite/tests/cmm/should_run/T25601.stdout
- + testsuite/tests/cmm/should_run/T25601a.cmm
- testsuite/tests/cmm/should_run/all.T
- + testsuite/tests/codeGen/should_run/T26061.hs
- + testsuite/tests/codeGen/should_run/T26061.stdout
- testsuite/tests/codeGen/should_run/all.T
- testsuite/tests/driver/json.stderr
- testsuite/tests/driver/json_warn.stderr
- utils/haddock/haddock-library/src/Documentation/Haddock/Parser.hs
- utils/haddock/haddock-library/test/Documentation/Haddock/ParserSpec.hs
Changes:
=====================================
compiler/GHC/CmmToAsm/AArch64/CodeGen.hs
=====================================
@@ -928,21 +928,25 @@ getRegister' config plat expr
CmmMachOp (MO_S_Shr w) [x, (CmmLit (CmmInt n _))] | w == W8, 0 <= n, n < 8 -> do
(reg_x, _format_x, code_x) <- getSomeReg x
- return $ Any (intFormat w) (\dst -> code_x `snocOL` annExpr expr (SBFX (OpReg w dst) (OpReg w reg_x) (OpImm (ImmInteger n)) (OpImm (ImmInteger (8-n)))))
+ return $ Any (intFormat w) (\dst -> code_x `snocOL` annExpr expr (SBFX (OpReg w dst) (OpReg w reg_x) (OpImm (ImmInteger n)) (OpImm (ImmInteger (8-n))))
+ `snocOL` (UXTB (OpReg w dst) (OpReg w dst))) -- See Note [Signed arithmetic on AArch64]
CmmMachOp (MO_S_Shr w) [x, y] | w == W8 -> do
(reg_x, _format_x, code_x) <- getSomeReg x
(reg_y, _format_y, code_y) <- getSomeReg y
return $ Any (intFormat w) (\dst -> code_x `appOL` code_y `snocOL` annExpr expr (SXTB (OpReg w reg_x) (OpReg w reg_x)) `snocOL`
- (ASR (OpReg w dst) (OpReg w reg_x) (OpReg w reg_y)))
+ (ASR (OpReg w dst) (OpReg w reg_x) (OpReg w reg_y)) `snocOL`
+ (UXTB (OpReg w dst) (OpReg w dst))) -- See Note [Signed arithmetic on AArch64]
CmmMachOp (MO_S_Shr w) [x, (CmmLit (CmmInt n _))] | w == W16, 0 <= n, n < 16 -> do
(reg_x, _format_x, code_x) <- getSomeReg x
- return $ Any (intFormat w) (\dst -> code_x `snocOL` annExpr expr (SBFX (OpReg w dst) (OpReg w reg_x) (OpImm (ImmInteger n)) (OpImm (ImmInteger (16-n)))))
+ return $ Any (intFormat w) (\dst -> code_x `snocOL` annExpr expr (SBFX (OpReg w dst) (OpReg w reg_x) (OpImm (ImmInteger n)) (OpImm (ImmInteger (16-n))))
+ `snocOL` (UXTH (OpReg w dst) (OpReg w dst))) -- See Note [Signed arithmetic on AArch64]
CmmMachOp (MO_S_Shr w) [x, y] | w == W16 -> do
(reg_x, _format_x, code_x) <- getSomeReg x
(reg_y, _format_y, code_y) <- getSomeReg y
return $ Any (intFormat w) (\dst -> code_x `appOL` code_y `snocOL` annExpr expr (SXTH (OpReg w reg_x) (OpReg w reg_x)) `snocOL`
- (ASR (OpReg w dst) (OpReg w reg_x) (OpReg w reg_y)))
+ (ASR (OpReg w dst) (OpReg w reg_x) (OpReg w reg_y)) `snocOL`
+ (UXTH (OpReg w dst) (OpReg w dst))) -- See Note [Signed arithmetic on AArch64]
CmmMachOp (MO_S_Shr w) [x, (CmmLit (CmmInt n _))]
| w == W32 || w == W64
=====================================
compiler/GHC/CmmToAsm/X86/CodeGen.hs
=====================================
@@ -6067,10 +6067,23 @@ genByteSwap width dst src = do
W64 | is32Bit -> do
let Reg64 dst_hi dst_lo = localReg64 dst
RegCode64 vcode rhi rlo <- iselExpr64 src
- return $ vcode `appOL`
- toOL [ MOV II32 (OpReg rlo) (OpReg dst_hi),
- MOV II32 (OpReg rhi) (OpReg dst_lo),
- BSWAP II32 dst_hi,
+ tmp <- getNewRegNat II32
+ -- Swap the low and high halves of the register.
+ --
+ -- NB: if dst_hi == rhi, we must make sure to preserve the contents
+ -- of rhi before writing to dst_hi (#25601).
+ let shuffle = if dst_hi == rhi && dst_lo == rlo then
+ toOL [ MOV II32 (OpReg rhi) (OpReg tmp),
+ MOV II32 (OpReg rlo) (OpReg dst_hi),
+ MOV II32 (OpReg tmp) (OpReg dst_lo) ]
+ else if dst_hi == rhi then
+ toOL [ MOV II32 (OpReg rhi) (OpReg dst_lo),
+ MOV II32 (OpReg rlo) (OpReg dst_hi) ]
+ else
+ toOL [ MOV II32 (OpReg rlo) (OpReg dst_hi),
+ MOV II32 (OpReg rhi) (OpReg dst_lo) ]
+ return $ vcode `appOL` shuffle `appOL`
+ toOL [ BSWAP II32 dst_hi,
BSWAP II32 dst_lo ]
W16 -> do
let dst_r = getLocalRegReg dst
=====================================
compiler/GHC/Types/Error.hs
=====================================
@@ -602,8 +602,14 @@ instance Diagnostic e => ToJson (MsgEnvelope e) where
where
diag = errMsgDiagnostic m
opts = defaultDiagnosticOpts @e
- style = mkErrStyle (errMsgContext m)
- ctx = defaultSDocContext {sdocStyle = style }
+ ctx = defaultSDocContext {
+ sdocStyle = mkErrStyle (errMsgContext m)
+ , sdocCanUseUnicode = True
+ -- Using Unicode makes it easier to consume the JSON output,
+ -- e.g. a suggestion to use foldl' will be displayed as
+ -- \u2018foldl'\u2019, which is not easily confused with
+ -- the quoted ‘foldl’ (note: no tick).
+ }
diagMsg = filter (not . isEmpty ctx) (unDecorated (diagnosticMessage (opts) diag))
renderToJSString :: SDoc -> JsonDoc
renderToJSString = JSString . (renderWithContext ctx)
=====================================
testsuite/tests/cmm/should_run/T25601.hs
=====================================
@@ -0,0 +1,22 @@
+{-# LANGUAGE UnboxedTuples #-}
+{-# LANGUAGE MagicHash #-}
+{-# LANGUAGE ForeignFunctionInterface #-}
+{-# LANGUAGE GHCForeignImportPrim #-}
+{-# LANGUAGE UnliftedFFITypes #-}
+
+import Numeric
+import GHC.Prim
+import GHC.Word
+import GHC.IO
+import GHC.Ptr
+import Data.List
+import qualified Data.ByteString as BS
+
+foreign import prim "test" c_test :: Addr# -> State# RealWorld -> (# State# RealWorld, Word64# #)
+
+main :: IO ()
+main = do
+ let bs = BS.pack $ take 100000 [ fromIntegral i | i <- [(1 :: Int) ..] ]
+ n <- BS.useAsCString bs $ \(Ptr addr) -> IO $ \s ->
+ case c_test addr s of (# s', n #) -> (# s', W64# n #)
+ print $ showHex n ""
=====================================
testsuite/tests/cmm/should_run/T25601.stdout
=====================================
@@ -0,0 +1 @@
+"f3f1ffffffffffff"
=====================================
testsuite/tests/cmm/should_run/T25601a.cmm
=====================================
@@ -0,0 +1,7 @@
+#include "Cmm.h"
+
+test ( W_ buffer ) {
+ bits64 ret;
+ (ret) = prim %bswap64(%neg(%zx64(bits16[buffer + (12 :: W_)])));
+ return (ret);
+}
=====================================
testsuite/tests/cmm/should_run/all.T
=====================================
@@ -47,3 +47,8 @@ test('AtomicFetch',
],
multi_compile_and_run,
['AtomicFetch', [('AtomicFetch_cmm.cmm', '')], ''])
+
+test('T25601',
+ [req_cmm],
+ multi_compile_and_run,
+ ['T25601', [('T25601a.cmm', '')], ''])
=====================================
testsuite/tests/codeGen/should_run/T26061.hs
=====================================
@@ -0,0 +1,41 @@
+{-# LANGUAGE MagicHash #-}
+{-# LANGUAGE ExtendedLiterals #-}
+import GHC.Word
+import GHC.Exts
+
+f :: Int16# -> Word16#
+f x = let !w = int16ToWord16# (x `uncheckedShiftRAInt16#` 1#)
+ in w `remWord16#` 13#Word16
+{-# NOINLINE f #-}
+
+g :: Int8# -> Word8#
+g x = let !w = int8ToWord8# (x `uncheckedShiftRAInt8#` 1#)
+ in w `remWord8#` 19#Word8
+{-# NOINLINE g #-}
+
+h :: Int16# -> Int# -> Word16#
+h x y = let !w = int16ToWord16# (x `uncheckedShiftRAInt16#` y)
+ in w `remWord16#` 13#Word16
+{-# NOINLINE h #-}
+
+i :: Int8# -> Int# -> Word8#
+i x y = let !w = int8ToWord8# (x `uncheckedShiftRAInt8#` y)
+ in w `remWord8#` 19#Word8
+{-# NOINLINE i #-}
+
+main :: IO ()
+main = do
+ print (W16# (f (-100#Int16)))
+ print (W8# (g (-100#Int8)))
+ print (W16# (h (-100#Int16) 1#))
+ print (W8# (i (-100#Int8) 1#))
+
+-- int16ToWord16 (-100 `shiftR` 1) `rem` 13
+-- = int16ToWord16 (-50) `rem` 13
+-- = 65486 `rem` 13
+-- = 5
+
+-- int8ToWord8 (-100 `shiftR` 1) `rem` 19
+-- = int8ToWord8 (-50) `rem` 19
+-- = 206 `rem` 19
+-- = 16
=====================================
testsuite/tests/codeGen/should_run/T26061.stdout
=====================================
@@ -0,0 +1,4 @@
+5
+16
+5
+16
=====================================
testsuite/tests/codeGen/should_run/all.T
=====================================
@@ -255,3 +255,4 @@ test('T24893', normal, compile_and_run, ['-O'])
test('CCallConv', [req_c], compile_and_run, ['CCallConv_c.c'])
test('T25364', normal, compile_and_run, [''])
+test('T26061', normal, compile_and_run, [''])
=====================================
testsuite/tests/driver/json.stderr
=====================================
@@ -1 +1 @@
-{"version":"1.1","ghcVersion":"ghc-9.13.20241113","span":{"file":"json.hs","start":{"line":9,"column":11},"end":{"line":9,"column":21}},"severity":"Error","code":48010,"message":["Empty list of alternatives in case expression"],"hints":["Perhaps you intended to use the `EmptyCase' extension"]}
+{"version":"1.1","ghcVersion":"ghc-9.13.20250529","span":{"file":"json.hs","start":{"line":9,"column":11},"end":{"line":9,"column":21}},"severity":"Error","code":48010,"message":["Empty list of alternatives in case expression"],"hints":["Perhaps you intended to use the \u2018EmptyCase\u2019 extension"]}
=====================================
testsuite/tests/driver/json_warn.stderr
=====================================
@@ -1,2 +1,2 @@
-{"version":"1.1","ghcVersion":"ghc-9.13.20241113","span":{"file":"json_warn.hs","start":{"line":4,"column":3},"end":{"line":4,"column":4}},"severity":"Warning","code":40910,"message":["Defined but not used: `x'"],"hints":[],"reason":{"flags":["unused-matches"]}}
-{"version":"1.1","ghcVersion":"ghc-9.13.20241113","span":{"file":"json_warn.hs","start":{"line":7,"column":5},"end":{"line":7,"column":9}},"severity":"Warning","code":63394,"message":["In the use of `head'\n(imported from Prelude, but defined in GHC.Internal.List):\n\"This is a partial function, it throws an error on empty lists. Use pattern matching, 'Data.List.uncons' or 'Data.Maybe.listToMaybe' instead. Consider refactoring to use \"Data.List.NonEmpty\".\""],"hints":[],"reason":{"category":"x-partial"}}
+{"version":"1.1","ghcVersion":"ghc-9.13.20250529","span":{"file":"json_warn.hs","start":{"line":4,"column":3},"end":{"line":4,"column":4}},"severity":"Warning","code":40910,"message":["Defined but not used: \u2018x\u2019"],"hints":[],"reason":{"flags":["unused-matches"]}}
+{"version":"1.1","ghcVersion":"ghc-9.13.20250529","span":{"file":"json_warn.hs","start":{"line":7,"column":5},"end":{"line":7,"column":9}},"severity":"Warning","code":63394,"message":["In the use of \u2018head\u2019\n(imported from Prelude, but defined in GHC.Internal.List):\n\"This is a partial function, it throws an error on empty lists. Use pattern matching, 'Data.List.uncons' or 'Data.Maybe.listToMaybe' instead. Consider refactoring to use \"Data.List.NonEmpty\".\""],"hints":[],"reason":{"category":"x-partial"}}
=====================================
utils/haddock/haddock-library/src/Documentation/Haddock/Parser.hs
=====================================
@@ -1,3 +1,4 @@
+{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ViewPatterns #-}
@@ -28,6 +29,7 @@ import Control.Applicative
import Control.Arrow (first)
import Control.Monad
import Data.Char (chr, isAlpha, isSpace, isUpper)
+import Data.Functor (($>))
import Data.List (elemIndex, intercalate, intersperse, unfoldr)
import Data.Maybe (fromMaybe, mapMaybe)
import Data.Monoid
@@ -186,11 +188,29 @@ specialChar = "_/<@\"&'`#[ "
-- to ensure that we have already given a chance to more meaningful parsers
-- before capturing their characters.
string' :: Parser (DocH mod a)
-string' = DocString . unescape . T.unpack <$> takeWhile1_ (`notElem` specialChar)
+string' =
+ DocString
+ <$> ((:) <$> rawOrEscChar "" <*> many (rawOrEscChar "(["))
+ -- After the first character, stop for @\(@ or @\[@ math starters. (The
+ -- first character won't start a valid math string because this parser
+ -- should follow math parsers. But this parser is expected to accept at
+ -- least one character from all inputs that don't start with special
+ -- characters, so the first character parser can't have the @"(["@
+ -- restriction.)
where
- unescape "" = ""
- unescape ('\\' : x : xs) = x : unescape xs
- unescape (x : xs) = x : unescape xs
+ -- | Parse a single logical character, either raw or escaped. Don't accept
+ -- escaped characters from the argument string.
+ rawOrEscChar :: [Char] -> Parser Char
+ rawOrEscChar restrictedEscapes = try $ Parsec.noneOf specialChar >>= \case
+ -- Handle backslashes:
+ -- - Fail on forbidden escape characters.
+ -- - Non-forbidden characters: simply unescape, e.g. parse "\b" as 'b',
+ -- - Trailing backslash: treat it as a raw backslash, not an escape
+ -- sequence. (This is the logic that this parser followed when this
+ -- comment was written; it is not necessarily intentional but now I
+ -- don't want to break anything relying on it.)
+ '\\' -> Parsec.noneOf restrictedEscapes <|> Parsec.eof $> '\\'
+ c -> pure c
-- | Skips a single special character and treats it as a plain string.
-- This is done to skip over any special characters belonging to other
=====================================
utils/haddock/haddock-library/test/Documentation/Haddock/ParserSpec.hs
=====================================
@@ -284,6 +284,13 @@ spec = do
it "supports title for deprecated picture syntax" $ do
"<<b a z>>" `shouldParseTo` image "b" "a z"
+ context "when parsing inline math" $ do
+ it "accepts inline math immediately after punctuation" $ do
+ "(\\(1 + 2 = 3\\) is an example of addition)"
+ `shouldParseTo` "("
+ <> DocMathInline "1 + 2 = 3"
+ <> " is an example of addition)"
+
context "when parsing display math" $ do
it "accepts markdown syntax for display math containing newlines" $ do
"\\[\\pi\n\\pi\\]" `shouldParseTo` DocMathDisplay "\\pi\n\\pi"
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/04df08c3abcf0e15b60ba003978c14…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/04df08c3abcf0e15b60ba003978c14…
You're receiving this email because of your account on gitlab.haskell.org.
1
0

[Git][ghc/ghc][wip/spj-apporv-Oct24] 20 commits: Make GHCi commands compatible with multiple home units
by Apoorv Ingle (@ani) 05 Jun '25
by Apoorv Ingle (@ani) 05 Jun '25
05 Jun '25
Apoorv Ingle pushed to branch wip/spj-apporv-Oct24 at Glasgow Haskell Compiler / GHC
Commits:
5f213bff by fendor at 2025-06-02T09:16:24+02:00
Make GHCi commands compatible with multiple home units
=== Design
We enable all GHCi features that were previously guarded by the `inMulti`
option.
GHCi supported multiple home units up to a certain degree for quite a while now.
The supported feature set was limited, due to a design impasse:
One of the home units must be "active", e.g., there must be one `HomeUnit`
whose `UnitId` is "active" which is returned when calling
```haskell
do
hscActiveUnitId <$> getSession
```
This makes sense in a GHC session, since you are always compiling a particular
Module, but it makes less intuitive sense in an interactive session.
Given an expression to evaluate, we can't easily tell in which "context" the expression
should be parsed, typechecked and evaluated.
That's why initially, most of GHCi features, except for `:reload`ing were disabled
if the GHCi session had more than one `HomeUnitEnv`.
We lift this restriction, enabling all features of GHCi for the multiple home unit case.
To do this, we fundamentally change the `HomeUnitEnv` graph to be multiple home unit first.
Instead of differentiating the case were we have a single home unit and multiple,
we now always set up a multiple home unit session that scales seamlessly to an arbitrary
amount of home units.
We introduce two new `HomeUnitEnv`s that are always added to the `HomeUnitGraph`.
They are:
The "interactive-ghci", called the `interactiveGhciUnit`, contains the same
`DynFlags` that are used by the `InteractiveContext` for interactive evaluation
of expressions.
This `HomeUnitEnv` is only used on the prompt of GHCi, so we may refer to it as
"interactive-prompt" unit.
See Note [Relation between the `InteractiveContext` and `interactiveGhciUnitId`]
for discussing its role.
And the "interactive-session"", called `interactiveSessionUnit` or
`interactiveSessionUnitId`, which is used for loading Scripts into
GHCi that are not `Target`s of any home unit, via `:load` or `:add`.
Both of these "interactive" home units depend on all other `HomeUnitEnv`s that
are passed as arguments on the cli.
Additionally, the "interactive-ghci" unit depends on `interactive-session`.
We always evaluate expressions in the context of the
"interactive-ghci" session.
Since "interactive-ghci" depends on all home units, we can import any `Module`
from the other home units with ease.
As we have a clear `HomeUnitGraph` hierarchy, we can set `interactiveGhciUnitId`
as the active home unit for the full duration of the GHCi session.
In GHCi, we always set `interactiveGhciUnitId` to be the currently active home unit.
=== Implementation Details
Given this design idea, the implementation is relatively straight
forward.
The core insight is that a `ModuleName` is not sufficient to identify a
`Module` in the `HomeUnitGraph`. Thus, large parts of the PR is simply
about refactoring usages of `ModuleName` to prefer `Module`, which has a
`Unit` attached and is unique over the `HomeUnitGraph`.
Consequentially, most usages of `lookupHPT` are likely to be incorrect and have
been replaced by `lookupHugByModule` which is keyed by a `Module`.
In `GHCi/UI.hs`, we make sure there is only one location where we are
actually translating `ModuleName` to a `Module`:
* `lookupQualifiedModuleName`
If a `ModuleName` is ambiguous, we detect this and report it to the
user.
To avoid repeated lookups of `ModuleName`s, we store the `Module` in the
`InteractiveImport`, which additionally simplifies the interface
loading.
A subtle detail is that the `DynFlags` of the `InteractiveContext` are
now stored both in the `HomeUnitGraph` and in the `InteractiveContext`.
In UI.hs, there are multiple code paths where we are careful to update
the `DynFlags` in both locations.
Most importantly in `addToProgramDynFlags`.
---
There is one metric increase in this commit:
-------------------------
Metric Increase:
T4029
-------------------------
It is an increase from 14.4 MB to 16.1 MB (+11.8%) which sounds like a
pretty big regression at first.
However, we argue this increase is solely caused by using more data
structures for managing multiple home units in the GHCi session.
In particular, due to the design decision of using three home units, the
base memory usage increases... but by how much?
A big contributor is the `UnitState`, of which we have three now, which
on its own 260 KB per instance. That makes an additional memory usage of
520 KB, already explaining a third of the overall memory usage increase.
Then we store more elements in the `HomeUnitGraph`, we have more
`HomeUnitEnv` entries, etc...
While we didn't chase down each byte, we looked at the memory usage over time
for both `-hi` and `-hT` profiles and can say with confidence while the memory
usage increased slightly, we did not introduce any space leak, as
the graph looks almost identical as the memory usage graph of GHC HEAD.
---
Adds testcases for GHCi multiple home units session
* Test truly multiple home unit sessions, testing reload logic and code evaluation.
* Test that GHCi commands such as `:all-types`, `:browse`, etc., work
* Object code reloading for home modules
* GHCi debugger multiple home units session
- - - - -
de603d01 by fendor at 2025-06-02T09:16:24+02:00
Update "loading compiled code" GHCi documentation
To use object code in GHCi, the module needs to be compiled for use in
GHCi. To do that, users need to compile their modules with:
* `-dynamic`
* `-this-unit-id interactive-session`
Otherwise, the interface files will not match.
- - - - -
b255a8ca by Vladislav Zavialov at 2025-06-02T16:00:12-04:00
docs: Fix code example for NoListTuplePuns
Without the fix, the example produces an error:
Test.hs:11:3: error: [GHC-45219]
• Data constructor ‘Tuple’ returns type ‘Tuple2 a b’
instead of an instance of its parent type ‘Tuple a’
• In the definition of data constructor ‘Tuple’
In the data type declaration for ‘Tuple’
Fortunately, a one line change makes it compile.
- - - - -
9f51d952 by Apoorv Ingle at 2025-06-05T17:15:45-05:00
- Remove one `SrcSpan` field from `VAExpansion`. It is no longer needed.
- Make `tcExpr` take a `Maybe HsThingRn` which will be passed on to tcApp and used by splitHsApps to determine a more accurate `AppCtx`
- `tcXExpr` is less hacky now
- do not look through HsExpansion applications
- kill OrigPat and remove HsThingRn From VAExpansion
- look through XExpr ExpandedThingRn while inferring type of head
- always set in generated code after stepping inside a ExpandedThingRn
- fixing record update error messages
- remove special case of tcbody from tcLambdaMatches
- wrap last stmt expansion in a HsPar so that the error messages are prettier
- remove special case of dsExpr for ExpandedThingTc
- make EExpand (HsExpr GhcRn) instead of EExpand HsThingRn
- fixing error messages for rebindable
- - - - -
86251b13 by Apoorv Ingle at 2025-06-05T17:15:45-05:00
some progress on tick
- - - - -
2fd9e8ce by Apoorv Ingle at 2025-06-05T17:15:45-05:00
remove adhoc cases from ticks
- - - - -
11f767e6 by Apoorv Ingle at 2025-06-05T17:15:45-05:00
fix the case where head of the application chain is an expanded expression and the argument is a type application c.f. T19167.hs
- - - - -
c9e2bdd1 by Apoorv Ingle at 2025-06-05T17:15:45-05:00
move setQLInstLevel inside tcInstFun
- - - - -
becc473a by Apoorv Ingle at 2025-06-05T17:15:45-05:00
ignore ds warnings originating from gen locations
- - - - -
e88f1687 by Apoorv Ingle at 2025-06-05T17:15:45-05:00
filter expr stmts error msgs
- - - - -
cfd7e10a by Apoorv Ingle at 2025-06-05T17:15:45-05:00
exception for AppDo while making error ctxt
- - - - -
b2195635 by Apoorv Ingle at 2025-06-05T17:15:45-05:00
moving around things for locations and error ctxts
- - - - -
2823806b by Apoorv Ingle at 2025-06-05T17:15:45-05:00
popErrCtxt doesn't push contexts and popErrCtxts in the first argument to bind and >> in do expansion statements
- - - - -
f3b6eb3c by Apoorv Ingle at 2025-06-05T17:15:45-05:00
accept test cases with changed error messages
-------------------------
Metric Decrease:
T9020
-------------------------
- - - - -
6d259023 by Apoorv Ingle at 2025-06-05T17:15:45-05:00
look through PopErrCtxt while splitting exprs in application chains
- - - - -
43db9ee8 by Apoorv Ingle at 2025-06-05T17:15:45-05:00
remove special case for HsExpanded in Ticks
- - - - -
743ad9d5 by Apoorv Ingle at 2025-06-05T17:15:45-05:00
check the right origin for record selector incomplete warnings
- - - - -
cd6c239c by Apoorv Ingle at 2025-06-05T17:15:45-05:00
kill VAExpansion
- - - - -
800ac3cd by Apoorv Ingle at 2025-06-05T17:15:46-05:00
pass CtOrigin to tcApp for instantiateSigma
- - - - -
169edd9c by Apoorv Ingle at 2025-06-05T17:15:46-05:00
do not suppress pprArising
- - - - -
172 changed files:
- compiler/GHC.hs
- compiler/GHC/Driver/Downsweep.hs
- compiler/GHC/Driver/Session.hs
- compiler/GHC/Hs/Expr.hs
- compiler/GHC/HsToCore/Expr.hs
- compiler/GHC/HsToCore/Match.hs
- compiler/GHC/HsToCore/Pmc.hs
- compiler/GHC/HsToCore/Quote.hs
- compiler/GHC/HsToCore/Ticks.hs
- compiler/GHC/Iface/Load.hs
- compiler/GHC/Rename/Expr.hs
- compiler/GHC/Rename/Unbound.hs
- compiler/GHC/Runtime/Context.hs
- compiler/GHC/Runtime/Eval.hs
- compiler/GHC/StgToByteCode.hs
- compiler/GHC/StgToJS/Linker/Linker.hs
- compiler/GHC/Tc/Errors/Ppr.hs
- compiler/GHC/Tc/Gen/App.hs
- + compiler/GHC/Tc/Gen/App.hs-boot
- compiler/GHC/Tc/Gen/Do.hs
- compiler/GHC/Tc/Gen/Expr.hs
- compiler/GHC/Tc/Gen/Head.hs
- compiler/GHC/Tc/Gen/Match.hs
- compiler/GHC/Tc/Instance/Class.hs
- compiler/GHC/Tc/Module.hs
- compiler/GHC/Tc/Types/Origin.hs
- compiler/GHC/Tc/Utils/Monad.hs
- compiler/GHC/Types/Name/Ppr.hs
- compiler/GHC/Unit/Env.hs
- compiler/GHC/Unit/Home/Graph.hs
- compiler/GHC/Unit/Types.hs
- docs/users_guide/exts/data_kinds.rst
- docs/users_guide/ghci.rst
- ghc/GHCi/UI.hs
- ghc/GHCi/UI/Exception.hs
- ghc/GHCi/UI/Info.hs
- ghc/GHCi/UI/Monad.hs
- ghc/Main.hs
- testsuite/driver/testlib.py
- testsuite/tests/deSugar/should_compile/T10662.stderr
- testsuite/tests/deSugar/should_compile/T3263-1.stderr
- testsuite/tests/deSugar/should_compile/T3263-2.stderr
- testsuite/tests/default/default-fail05.stderr
- testsuite/tests/driver/T8526/T8526.stdout
- testsuite/tests/driver/fat-iface/fat014.stdout
- testsuite/tests/driver/multipleHomeUnits/multiGHCi.stderr
- testsuite/tests/ghc-api/T6145.hs
- testsuite/tests/ghc-api/annotations-literals/literals.hs
- testsuite/tests/ghc-api/annotations-literals/parsed.hs
- testsuite/tests/ghc-api/apirecomp001/myghc.hs
- testsuite/tests/ghc-api/fixed-nodes/T1.hs
- + testsuite/tests/ghci.debugger/scripts/break031/Makefile
- + testsuite/tests/ghci.debugger/scripts/break031/a/A.hs
- + testsuite/tests/ghci.debugger/scripts/break031/all.T
- + testsuite/tests/ghci.debugger/scripts/break031/b/B.hs
- + testsuite/tests/ghci.debugger/scripts/break031/break031a.script
- + testsuite/tests/ghci.debugger/scripts/break031/break031a.stdout
- + testsuite/tests/ghci.debugger/scripts/break031/break031b.script
- + testsuite/tests/ghci.debugger/scripts/break031/break031b.stderr
- + testsuite/tests/ghci.debugger/scripts/break031/break031b.stdout
- + testsuite/tests/ghci.debugger/scripts/break031/unitA
- + testsuite/tests/ghci.debugger/scripts/break031/unitB
- testsuite/tests/ghci/linking/dyn/T3372.hs
- + testsuite/tests/ghci/prog-mhu001/Makefile
- + testsuite/tests/ghci/prog-mhu001/all.T
- + testsuite/tests/ghci/prog-mhu001/e/E.hs
- + testsuite/tests/ghci/prog-mhu001/prog-mhu001a.script
- + testsuite/tests/ghci/prog-mhu001/prog-mhu001a.stdout
- + testsuite/tests/ghci/prog-mhu001/prog-mhu001b.script
- + testsuite/tests/ghci/prog-mhu001/prog-mhu001b.stdout
- + testsuite/tests/ghci/prog-mhu001/prog-mhu001c.script
- + testsuite/tests/ghci/prog-mhu001/prog-mhu001c.stdout
- + testsuite/tests/ghci/prog-mhu001/prog-mhu001d.script
- + testsuite/tests/ghci/prog-mhu001/prog-mhu001d.stdout
- + testsuite/tests/ghci/prog-mhu001/prog-mhu001e.script
- + testsuite/tests/ghci/prog-mhu001/prog-mhu001e.stdout
- + testsuite/tests/ghci/prog-mhu001/prog-mhu001f.script
- + testsuite/tests/ghci/prog-mhu001/prog-mhu001f.stdout
- + testsuite/tests/ghci/prog-mhu001/unitE
- + testsuite/tests/ghci/prog-mhu001/unitE-main-is
- + testsuite/tests/ghci/prog-mhu002/Makefile
- + testsuite/tests/ghci/prog-mhu002/a/A.hs
- + testsuite/tests/ghci/prog-mhu002/all.T
- + testsuite/tests/ghci/prog-mhu002/b/B.hs
- + testsuite/tests/ghci/prog-mhu002/c/C.hs
- + testsuite/tests/ghci/prog-mhu002/d/Main.hs
- + testsuite/tests/ghci/prog-mhu002/prog-mhu002a.script
- + testsuite/tests/ghci/prog-mhu002/prog-mhu002a.stderr
- + testsuite/tests/ghci/prog-mhu002/prog-mhu002a.stdout
- + testsuite/tests/ghci/prog-mhu002/prog-mhu002b.script
- + testsuite/tests/ghci/prog-mhu002/prog-mhu002b.stderr
- + testsuite/tests/ghci/prog-mhu002/prog-mhu002b.stdout
- + testsuite/tests/ghci/prog-mhu002/prog-mhu002c.script
- + testsuite/tests/ghci/prog-mhu002/prog-mhu002c.stdout
- + testsuite/tests/ghci/prog-mhu002/prog-mhu002d.script
- + testsuite/tests/ghci/prog-mhu002/prog-mhu002d.stdout
- + testsuite/tests/ghci/prog-mhu002/prog-mhu002e.script
- + testsuite/tests/ghci/prog-mhu002/prog-mhu002e.stdout
- + testsuite/tests/ghci/prog-mhu002/prog-mhu002f.script
- + testsuite/tests/ghci/prog-mhu002/prog-mhu002f.stdout
- + testsuite/tests/ghci/prog-mhu002/unitA
- + testsuite/tests/ghci/prog-mhu002/unitB
- + testsuite/tests/ghci/prog-mhu002/unitC
- + testsuite/tests/ghci/prog-mhu002/unitD
- + testsuite/tests/ghci/prog-mhu003/Makefile
- + testsuite/tests/ghci/prog-mhu003/a/A.hs
- + testsuite/tests/ghci/prog-mhu003/all.T
- + testsuite/tests/ghci/prog-mhu003/b/Foo.hs
- + testsuite/tests/ghci/prog-mhu003/c/C.hs
- + testsuite/tests/ghci/prog-mhu003/d/Foo.hs
- + testsuite/tests/ghci/prog-mhu003/prog-mhu003.script
- + testsuite/tests/ghci/prog-mhu003/prog-mhu003.stderr
- + testsuite/tests/ghci/prog-mhu003/prog-mhu003.stdout
- + testsuite/tests/ghci/prog-mhu003/unitA
- + testsuite/tests/ghci/prog-mhu003/unitB
- + testsuite/tests/ghci/prog-mhu003/unitC
- + testsuite/tests/ghci/prog-mhu003/unitD
- + testsuite/tests/ghci/prog-mhu004/Makefile
- + testsuite/tests/ghci/prog-mhu004/a/Foo.hs
- + testsuite/tests/ghci/prog-mhu004/all.T
- + testsuite/tests/ghci/prog-mhu004/b/Foo.hs
- + testsuite/tests/ghci/prog-mhu004/prog-mhu004a.script
- + testsuite/tests/ghci/prog-mhu004/prog-mhu004a.stderr
- + testsuite/tests/ghci/prog-mhu004/prog-mhu004a.stdout
- + testsuite/tests/ghci/prog-mhu004/prog-mhu004b.script
- + testsuite/tests/ghci/prog-mhu004/prog-mhu004b.stdout
- + testsuite/tests/ghci/prog-mhu004/unitA
- + testsuite/tests/ghci/prog-mhu004/unitB
- testsuite/tests/ghci/prog010/ghci.prog010.script
- testsuite/tests/ghci/prog018/prog018.stdout
- + testsuite/tests/ghci/prog020/A.hs
- + testsuite/tests/ghci/prog020/B.hs
- + testsuite/tests/ghci/prog020/Makefile
- + testsuite/tests/ghci/prog020/all.T
- + testsuite/tests/ghci/prog020/ghci.prog020.script
- + testsuite/tests/ghci/prog020/ghci.prog020.stderr
- + testsuite/tests/ghci/prog020/ghci.prog020.stdout
- testsuite/tests/ghci/scripts/T13869.stdout
- testsuite/tests/ghci/scripts/T13997.stdout
- testsuite/tests/ghci/scripts/T17669.stdout
- testsuite/tests/ghci/scripts/T18330.stdout
- testsuite/tests/ghci/scripts/T1914.stdout
- testsuite/tests/ghci/scripts/T20217.stdout
- testsuite/tests/ghci/scripts/T20587.stdout
- testsuite/tests/ghci/scripts/T21110.stderr
- testsuite/tests/ghci/scripts/T6105.stdout
- testsuite/tests/ghci/scripts/T8042.stdout
- testsuite/tests/ghci/scripts/T8042recomp.stdout
- testsuite/tests/ghci/scripts/ghci024.stdout
- testsuite/tests/ghci/scripts/ghci024.stdout-mingw32
- testsuite/tests/ghci/scripts/ghci058.script
- testsuite/tests/ghci/should_run/TopEnvIface.stdout
- testsuite/tests/indexed-types/should_fail/T2693.stderr
- testsuite/tests/indexed-types/should_fail/T5439.stderr
- testsuite/tests/plugins/test-defaulting-plugin.stderr
- testsuite/tests/polykinds/T13393.stderr
- testsuite/tests/printer/T17697.stderr
- testsuite/tests/quasiquotation/T7918.hs
- testsuite/tests/typecheck/should_compile/T14590.stderr
- testsuite/tests/typecheck/should_compile/valid_hole_fits.stderr
- testsuite/tests/typecheck/should_fail/DoExpansion1.stderr
- testsuite/tests/typecheck/should_fail/DoExpansion2.stderr
- testsuite/tests/typecheck/should_fail/T10971d.stderr
- testsuite/tests/typecheck/should_fail/T13311.stderr
- testsuite/tests/typecheck/should_fail/T24064.stderr
- testsuite/tests/typecheck/should_fail/T3613.stderr
- testsuite/tests/typecheck/should_fail/T7851.stderr
- testsuite/tests/typecheck/should_fail/T8603.stderr
- testsuite/tests/typecheck/should_fail/T9612.stderr
- testsuite/tests/typecheck/should_fail/tcfail128.stderr
- testsuite/tests/typecheck/should_fail/tcfail168.stderr
- testsuite/tests/warnings/should_fail/CaretDiagnostics1.stderr
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/b312c7ba5b6b358c124e2c633fecd6…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/b312c7ba5b6b358c124e2c633fecd6…
You're receiving this email because of your account on gitlab.haskell.org.
1
0

[Git][ghc/ghc][wip/marge_bot_batch_merge_job] 4 commits: haddock: Parse math even after ordinary characters
by Marge Bot (@marge-bot) 05 Jun '25
by Marge Bot (@marge-bot) 05 Jun '25
05 Jun '25
Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC
Commits:
fe1c24ca by Ryan Hendrickson at 2025-06-05T17:14:41-04:00
haddock: Parse math even after ordinary characters
Fixes a bug where math sections were not recognized if preceded by a
character that isn't special (like space or a markup character).
- - - - -
08225327 by ARATA Mizuki at 2025-06-05T17:14:46-04:00
AArch64 NCG: Fix sub-word arithmetic right shift
As noted in Note [Signed arithmetic on AArch64], we should zero-extend sub-word values.
Fixes #26061
- - - - -
343653e8 by Simon Hengel at 2025-06-05T17:14:48-04:00
Allow Unicode in "message" and "hints" with -fdiagnostics-as-json
(fixes #26075)
- - - - -
04df08c3 by ARATA Mizuki at 2025-06-05T17:14:52-04:00
x86 NCG: Fix code generation of bswap64 on i386
Co-authored-by: sheaf <sam.derbyshire(a)gmail.com>
Fix #25601
- - - - -
14 changed files:
- compiler/GHC/CmmToAsm/AArch64/CodeGen.hs
- compiler/GHC/CmmToAsm/X86/CodeGen.hs
- compiler/GHC/Types/Error.hs
- + testsuite/tests/cmm/should_run/T25601.hs
- + testsuite/tests/cmm/should_run/T25601.stdout
- + testsuite/tests/cmm/should_run/T25601a.cmm
- testsuite/tests/cmm/should_run/all.T
- + testsuite/tests/codeGen/should_run/T26061.hs
- + testsuite/tests/codeGen/should_run/T26061.stdout
- testsuite/tests/codeGen/should_run/all.T
- testsuite/tests/driver/json.stderr
- testsuite/tests/driver/json_warn.stderr
- utils/haddock/haddock-library/src/Documentation/Haddock/Parser.hs
- utils/haddock/haddock-library/test/Documentation/Haddock/ParserSpec.hs
Changes:
=====================================
compiler/GHC/CmmToAsm/AArch64/CodeGen.hs
=====================================
@@ -928,21 +928,25 @@ getRegister' config plat expr
CmmMachOp (MO_S_Shr w) [x, (CmmLit (CmmInt n _))] | w == W8, 0 <= n, n < 8 -> do
(reg_x, _format_x, code_x) <- getSomeReg x
- return $ Any (intFormat w) (\dst -> code_x `snocOL` annExpr expr (SBFX (OpReg w dst) (OpReg w reg_x) (OpImm (ImmInteger n)) (OpImm (ImmInteger (8-n)))))
+ return $ Any (intFormat w) (\dst -> code_x `snocOL` annExpr expr (SBFX (OpReg w dst) (OpReg w reg_x) (OpImm (ImmInteger n)) (OpImm (ImmInteger (8-n))))
+ `snocOL` (UXTB (OpReg w dst) (OpReg w dst))) -- See Note [Signed arithmetic on AArch64]
CmmMachOp (MO_S_Shr w) [x, y] | w == W8 -> do
(reg_x, _format_x, code_x) <- getSomeReg x
(reg_y, _format_y, code_y) <- getSomeReg y
return $ Any (intFormat w) (\dst -> code_x `appOL` code_y `snocOL` annExpr expr (SXTB (OpReg w reg_x) (OpReg w reg_x)) `snocOL`
- (ASR (OpReg w dst) (OpReg w reg_x) (OpReg w reg_y)))
+ (ASR (OpReg w dst) (OpReg w reg_x) (OpReg w reg_y)) `snocOL`
+ (UXTB (OpReg w dst) (OpReg w dst))) -- See Note [Signed arithmetic on AArch64]
CmmMachOp (MO_S_Shr w) [x, (CmmLit (CmmInt n _))] | w == W16, 0 <= n, n < 16 -> do
(reg_x, _format_x, code_x) <- getSomeReg x
- return $ Any (intFormat w) (\dst -> code_x `snocOL` annExpr expr (SBFX (OpReg w dst) (OpReg w reg_x) (OpImm (ImmInteger n)) (OpImm (ImmInteger (16-n)))))
+ return $ Any (intFormat w) (\dst -> code_x `snocOL` annExpr expr (SBFX (OpReg w dst) (OpReg w reg_x) (OpImm (ImmInteger n)) (OpImm (ImmInteger (16-n))))
+ `snocOL` (UXTH (OpReg w dst) (OpReg w dst))) -- See Note [Signed arithmetic on AArch64]
CmmMachOp (MO_S_Shr w) [x, y] | w == W16 -> do
(reg_x, _format_x, code_x) <- getSomeReg x
(reg_y, _format_y, code_y) <- getSomeReg y
return $ Any (intFormat w) (\dst -> code_x `appOL` code_y `snocOL` annExpr expr (SXTH (OpReg w reg_x) (OpReg w reg_x)) `snocOL`
- (ASR (OpReg w dst) (OpReg w reg_x) (OpReg w reg_y)))
+ (ASR (OpReg w dst) (OpReg w reg_x) (OpReg w reg_y)) `snocOL`
+ (UXTH (OpReg w dst) (OpReg w dst))) -- See Note [Signed arithmetic on AArch64]
CmmMachOp (MO_S_Shr w) [x, (CmmLit (CmmInt n _))]
| w == W32 || w == W64
=====================================
compiler/GHC/CmmToAsm/X86/CodeGen.hs
=====================================
@@ -6067,10 +6067,23 @@ genByteSwap width dst src = do
W64 | is32Bit -> do
let Reg64 dst_hi dst_lo = localReg64 dst
RegCode64 vcode rhi rlo <- iselExpr64 src
- return $ vcode `appOL`
- toOL [ MOV II32 (OpReg rlo) (OpReg dst_hi),
- MOV II32 (OpReg rhi) (OpReg dst_lo),
- BSWAP II32 dst_hi,
+ tmp <- getNewRegNat II32
+ -- Swap the low and high halves of the register.
+ --
+ -- NB: if dst_hi == rhi, we must make sure to preserve the contents
+ -- of rhi before writing to dst_hi (#25601).
+ let shuffle = if dst_hi == rhi && dst_lo == rlo then
+ toOL [ MOV II32 (OpReg rhi) (OpReg tmp),
+ MOV II32 (OpReg rlo) (OpReg dst_hi),
+ MOV II32 (OpReg tmp) (OpReg dst_lo) ]
+ else if dst_hi == rhi then
+ toOL [ MOV II32 (OpReg rhi) (OpReg dst_lo),
+ MOV II32 (OpReg rlo) (OpReg dst_hi) ]
+ else
+ toOL [ MOV II32 (OpReg rlo) (OpReg dst_hi),
+ MOV II32 (OpReg rhi) (OpReg dst_lo) ]
+ return $ vcode `appOL` shuffle `appOL`
+ toOL [ BSWAP II32 dst_hi,
BSWAP II32 dst_lo ]
W16 -> do
let dst_r = getLocalRegReg dst
=====================================
compiler/GHC/Types/Error.hs
=====================================
@@ -602,8 +602,14 @@ instance Diagnostic e => ToJson (MsgEnvelope e) where
where
diag = errMsgDiagnostic m
opts = defaultDiagnosticOpts @e
- style = mkErrStyle (errMsgContext m)
- ctx = defaultSDocContext {sdocStyle = style }
+ ctx = defaultSDocContext {
+ sdocStyle = mkErrStyle (errMsgContext m)
+ , sdocCanUseUnicode = True
+ -- Using Unicode makes it easier to consume the JSON output,
+ -- e.g. a suggestion to use foldl' will be displayed as
+ -- \u2018foldl'\u2019, which is not easily confused with
+ -- the quoted ‘foldl’ (note: no tick).
+ }
diagMsg = filter (not . isEmpty ctx) (unDecorated (diagnosticMessage (opts) diag))
renderToJSString :: SDoc -> JsonDoc
renderToJSString = JSString . (renderWithContext ctx)
=====================================
testsuite/tests/cmm/should_run/T25601.hs
=====================================
@@ -0,0 +1,22 @@
+{-# LANGUAGE UnboxedTuples #-}
+{-# LANGUAGE MagicHash #-}
+{-# LANGUAGE ForeignFunctionInterface #-}
+{-# LANGUAGE GHCForeignImportPrim #-}
+{-# LANGUAGE UnliftedFFITypes #-}
+
+import Numeric
+import GHC.Prim
+import GHC.Word
+import GHC.IO
+import GHC.Ptr
+import Data.List
+import qualified Data.ByteString as BS
+
+foreign import prim "test" c_test :: Addr# -> State# RealWorld -> (# State# RealWorld, Word64# #)
+
+main :: IO ()
+main = do
+ let bs = BS.pack $ take 100000 [ fromIntegral i | i <- [(1 :: Int) ..] ]
+ n <- BS.useAsCString bs $ \(Ptr addr) -> IO $ \s ->
+ case c_test addr s of (# s', n #) -> (# s', W64# n #)
+ print $ showHex n ""
=====================================
testsuite/tests/cmm/should_run/T25601.stdout
=====================================
@@ -0,0 +1 @@
+"f3f1ffffffffffff"
=====================================
testsuite/tests/cmm/should_run/T25601a.cmm
=====================================
@@ -0,0 +1,7 @@
+#include "Cmm.h"
+
+test ( W_ buffer ) {
+ bits64 ret;
+ (ret) = prim %bswap64(%neg(%zx64(bits16[buffer + (12 :: W_)])));
+ return (ret);
+}
=====================================
testsuite/tests/cmm/should_run/all.T
=====================================
@@ -47,3 +47,8 @@ test('AtomicFetch',
],
multi_compile_and_run,
['AtomicFetch', [('AtomicFetch_cmm.cmm', '')], ''])
+
+test('T25601',
+ [req_cmm],
+ multi_compile_and_run,
+ ['T25601', [('T25601a.cmm', '')], ''])
=====================================
testsuite/tests/codeGen/should_run/T26061.hs
=====================================
@@ -0,0 +1,41 @@
+{-# LANGUAGE MagicHash #-}
+{-# LANGUAGE ExtendedLiterals #-}
+import GHC.Word
+import GHC.Exts
+
+f :: Int16# -> Word16#
+f x = let !w = int16ToWord16# (x `uncheckedShiftRAInt16#` 1#)
+ in w `remWord16#` 13#Word16
+{-# NOINLINE f #-}
+
+g :: Int8# -> Word8#
+g x = let !w = int8ToWord8# (x `uncheckedShiftRAInt8#` 1#)
+ in w `remWord8#` 19#Word8
+{-# NOINLINE g #-}
+
+h :: Int16# -> Int# -> Word16#
+h x y = let !w = int16ToWord16# (x `uncheckedShiftRAInt16#` y)
+ in w `remWord16#` 13#Word16
+{-# NOINLINE h #-}
+
+i :: Int8# -> Int# -> Word8#
+i x y = let !w = int8ToWord8# (x `uncheckedShiftRAInt8#` y)
+ in w `remWord8#` 19#Word8
+{-# NOINLINE i #-}
+
+main :: IO ()
+main = do
+ print (W16# (f (-100#Int16)))
+ print (W8# (g (-100#Int8)))
+ print (W16# (h (-100#Int16) 1#))
+ print (W8# (i (-100#Int8) 1#))
+
+-- int16ToWord16 (-100 `shiftR` 1) `rem` 13
+-- = int16ToWord16 (-50) `rem` 13
+-- = 65486 `rem` 13
+-- = 5
+
+-- int8ToWord8 (-100 `shiftR` 1) `rem` 19
+-- = int8ToWord8 (-50) `rem` 19
+-- = 206 `rem` 19
+-- = 16
=====================================
testsuite/tests/codeGen/should_run/T26061.stdout
=====================================
@@ -0,0 +1,4 @@
+5
+16
+5
+16
=====================================
testsuite/tests/codeGen/should_run/all.T
=====================================
@@ -255,3 +255,4 @@ test('T24893', normal, compile_and_run, ['-O'])
test('CCallConv', [req_c], compile_and_run, ['CCallConv_c.c'])
test('T25364', normal, compile_and_run, [''])
+test('T26061', normal, compile_and_run, [''])
=====================================
testsuite/tests/driver/json.stderr
=====================================
@@ -1 +1 @@
-{"version":"1.1","ghcVersion":"ghc-9.13.20241113","span":{"file":"json.hs","start":{"line":9,"column":11},"end":{"line":9,"column":21}},"severity":"Error","code":48010,"message":["Empty list of alternatives in case expression"],"hints":["Perhaps you intended to use the `EmptyCase' extension"]}
+{"version":"1.1","ghcVersion":"ghc-9.13.20250529","span":{"file":"json.hs","start":{"line":9,"column":11},"end":{"line":9,"column":21}},"severity":"Error","code":48010,"message":["Empty list of alternatives in case expression"],"hints":["Perhaps you intended to use the \u2018EmptyCase\u2019 extension"]}
=====================================
testsuite/tests/driver/json_warn.stderr
=====================================
@@ -1,2 +1,2 @@
-{"version":"1.1","ghcVersion":"ghc-9.13.20241113","span":{"file":"json_warn.hs","start":{"line":4,"column":3},"end":{"line":4,"column":4}},"severity":"Warning","code":40910,"message":["Defined but not used: `x'"],"hints":[],"reason":{"flags":["unused-matches"]}}
-{"version":"1.1","ghcVersion":"ghc-9.13.20241113","span":{"file":"json_warn.hs","start":{"line":7,"column":5},"end":{"line":7,"column":9}},"severity":"Warning","code":63394,"message":["In the use of `head'\n(imported from Prelude, but defined in GHC.Internal.List):\n\"This is a partial function, it throws an error on empty lists. Use pattern matching, 'Data.List.uncons' or 'Data.Maybe.listToMaybe' instead. Consider refactoring to use \"Data.List.NonEmpty\".\""],"hints":[],"reason":{"category":"x-partial"}}
+{"version":"1.1","ghcVersion":"ghc-9.13.20250529","span":{"file":"json_warn.hs","start":{"line":4,"column":3},"end":{"line":4,"column":4}},"severity":"Warning","code":40910,"message":["Defined but not used: \u2018x\u2019"],"hints":[],"reason":{"flags":["unused-matches"]}}
+{"version":"1.1","ghcVersion":"ghc-9.13.20250529","span":{"file":"json_warn.hs","start":{"line":7,"column":5},"end":{"line":7,"column":9}},"severity":"Warning","code":63394,"message":["In the use of \u2018head\u2019\n(imported from Prelude, but defined in GHC.Internal.List):\n\"This is a partial function, it throws an error on empty lists. Use pattern matching, 'Data.List.uncons' or 'Data.Maybe.listToMaybe' instead. Consider refactoring to use \"Data.List.NonEmpty\".\""],"hints":[],"reason":{"category":"x-partial"}}
=====================================
utils/haddock/haddock-library/src/Documentation/Haddock/Parser.hs
=====================================
@@ -1,3 +1,4 @@
+{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ViewPatterns #-}
@@ -28,6 +29,7 @@ import Control.Applicative
import Control.Arrow (first)
import Control.Monad
import Data.Char (chr, isAlpha, isSpace, isUpper)
+import Data.Functor (($>))
import Data.List (elemIndex, intercalate, intersperse, unfoldr)
import Data.Maybe (fromMaybe, mapMaybe)
import Data.Monoid
@@ -186,11 +188,29 @@ specialChar = "_/<@\"&'`#[ "
-- to ensure that we have already given a chance to more meaningful parsers
-- before capturing their characters.
string' :: Parser (DocH mod a)
-string' = DocString . unescape . T.unpack <$> takeWhile1_ (`notElem` specialChar)
+string' =
+ DocString
+ <$> ((:) <$> rawOrEscChar "" <*> many (rawOrEscChar "(["))
+ -- After the first character, stop for @\(@ or @\[@ math starters. (The
+ -- first character won't start a valid math string because this parser
+ -- should follow math parsers. But this parser is expected to accept at
+ -- least one character from all inputs that don't start with special
+ -- characters, so the first character parser can't have the @"(["@
+ -- restriction.)
where
- unescape "" = ""
- unescape ('\\' : x : xs) = x : unescape xs
- unescape (x : xs) = x : unescape xs
+ -- | Parse a single logical character, either raw or escaped. Don't accept
+ -- escaped characters from the argument string.
+ rawOrEscChar :: [Char] -> Parser Char
+ rawOrEscChar restrictedEscapes = try $ Parsec.noneOf specialChar >>= \case
+ -- Handle backslashes:
+ -- - Fail on forbidden escape characters.
+ -- - Non-forbidden characters: simply unescape, e.g. parse "\b" as 'b',
+ -- - Trailing backslash: treat it as a raw backslash, not an escape
+ -- sequence. (This is the logic that this parser followed when this
+ -- comment was written; it is not necessarily intentional but now I
+ -- don't want to break anything relying on it.)
+ '\\' -> Parsec.noneOf restrictedEscapes <|> Parsec.eof $> '\\'
+ c -> pure c
-- | Skips a single special character and treats it as a plain string.
-- This is done to skip over any special characters belonging to other
=====================================
utils/haddock/haddock-library/test/Documentation/Haddock/ParserSpec.hs
=====================================
@@ -284,6 +284,13 @@ spec = do
it "supports title for deprecated picture syntax" $ do
"<<b a z>>" `shouldParseTo` image "b" "a z"
+ context "when parsing inline math" $ do
+ it "accepts inline math immediately after punctuation" $ do
+ "(\\(1 + 2 = 3\\) is an example of addition)"
+ `shouldParseTo` "("
+ <> DocMathInline "1 + 2 = 3"
+ <> " is an example of addition)"
+
context "when parsing display math" $ do
it "accepts markdown syntax for display math containing newlines" $ do
"\\[\\pi\n\\pi\\]" `shouldParseTo` DocMathDisplay "\\pi\n\\pi"
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/06314b7c234a4025f0a238116dcef7…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/06314b7c234a4025f0a238116dcef7…
You're receiving this email because of your account on gitlab.haskell.org.
1
0

[Git][ghc/ghc][wip/marge_bot_batch_merge_job] 5 commits: hadrian: Place user options after package arguments
by Marge Bot (@marge-bot) 05 Jun '25
by Marge Bot (@marge-bot) 05 Jun '25
05 Jun '25
Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC
Commits:
4ee303a8 by Ben Gamari at 2025-06-05T10:11:44-04:00
hadrian: Place user options after package arguments
This makes it easier for the user to override the default package
arguments with `UserSettings.hs`.
Fixes #25821.
- - - - -
1c1332bc by Ryan Hendrickson at 2025-06-05T10:11:48-04:00
haddock: Parse math even after ordinary characters
Fixes a bug where math sections were not recognized if preceded by a
character that isn't special (like space or a markup character).
- - - - -
3c14eb83 by ARATA Mizuki at 2025-06-05T10:11:53-04:00
AArch64 NCG: Fix sub-word arithmetic right shift
As noted in Note [Signed arithmetic on AArch64], we should zero-extend sub-word values.
Fixes #26061
- - - - -
b07b3b3f by Simon Hengel at 2025-06-05T10:11:56-04:00
Allow Unicode in "message" and "hints" with -fdiagnostics-as-json
(fixes #26075)
- - - - -
06314b7c by ARATA Mizuki at 2025-06-05T10:11:59-04:00
x86 NCG: Fix code generation of bswap64 on i386
Co-authored-by: sheaf <sam.derbyshire(a)gmail.com>
Fix #25601
- - - - -
15 changed files:
- compiler/GHC/CmmToAsm/AArch64/CodeGen.hs
- compiler/GHC/CmmToAsm/X86/CodeGen.hs
- compiler/GHC/Types/Error.hs
- hadrian/src/Settings.hs
- + testsuite/tests/cmm/should_run/T25601.hs
- + testsuite/tests/cmm/should_run/T25601.stdout
- + testsuite/tests/cmm/should_run/T25601a.cmm
- testsuite/tests/cmm/should_run/all.T
- + testsuite/tests/codeGen/should_run/T26061.hs
- + testsuite/tests/codeGen/should_run/T26061.stdout
- testsuite/tests/codeGen/should_run/all.T
- testsuite/tests/driver/json.stderr
- testsuite/tests/driver/json_warn.stderr
- utils/haddock/haddock-library/src/Documentation/Haddock/Parser.hs
- utils/haddock/haddock-library/test/Documentation/Haddock/ParserSpec.hs
Changes:
=====================================
compiler/GHC/CmmToAsm/AArch64/CodeGen.hs
=====================================
@@ -928,21 +928,25 @@ getRegister' config plat expr
CmmMachOp (MO_S_Shr w) [x, (CmmLit (CmmInt n _))] | w == W8, 0 <= n, n < 8 -> do
(reg_x, _format_x, code_x) <- getSomeReg x
- return $ Any (intFormat w) (\dst -> code_x `snocOL` annExpr expr (SBFX (OpReg w dst) (OpReg w reg_x) (OpImm (ImmInteger n)) (OpImm (ImmInteger (8-n)))))
+ return $ Any (intFormat w) (\dst -> code_x `snocOL` annExpr expr (SBFX (OpReg w dst) (OpReg w reg_x) (OpImm (ImmInteger n)) (OpImm (ImmInteger (8-n))))
+ `snocOL` (UXTB (OpReg w dst) (OpReg w dst))) -- See Note [Signed arithmetic on AArch64]
CmmMachOp (MO_S_Shr w) [x, y] | w == W8 -> do
(reg_x, _format_x, code_x) <- getSomeReg x
(reg_y, _format_y, code_y) <- getSomeReg y
return $ Any (intFormat w) (\dst -> code_x `appOL` code_y `snocOL` annExpr expr (SXTB (OpReg w reg_x) (OpReg w reg_x)) `snocOL`
- (ASR (OpReg w dst) (OpReg w reg_x) (OpReg w reg_y)))
+ (ASR (OpReg w dst) (OpReg w reg_x) (OpReg w reg_y)) `snocOL`
+ (UXTB (OpReg w dst) (OpReg w dst))) -- See Note [Signed arithmetic on AArch64]
CmmMachOp (MO_S_Shr w) [x, (CmmLit (CmmInt n _))] | w == W16, 0 <= n, n < 16 -> do
(reg_x, _format_x, code_x) <- getSomeReg x
- return $ Any (intFormat w) (\dst -> code_x `snocOL` annExpr expr (SBFX (OpReg w dst) (OpReg w reg_x) (OpImm (ImmInteger n)) (OpImm (ImmInteger (16-n)))))
+ return $ Any (intFormat w) (\dst -> code_x `snocOL` annExpr expr (SBFX (OpReg w dst) (OpReg w reg_x) (OpImm (ImmInteger n)) (OpImm (ImmInteger (16-n))))
+ `snocOL` (UXTH (OpReg w dst) (OpReg w dst))) -- See Note [Signed arithmetic on AArch64]
CmmMachOp (MO_S_Shr w) [x, y] | w == W16 -> do
(reg_x, _format_x, code_x) <- getSomeReg x
(reg_y, _format_y, code_y) <- getSomeReg y
return $ Any (intFormat w) (\dst -> code_x `appOL` code_y `snocOL` annExpr expr (SXTH (OpReg w reg_x) (OpReg w reg_x)) `snocOL`
- (ASR (OpReg w dst) (OpReg w reg_x) (OpReg w reg_y)))
+ (ASR (OpReg w dst) (OpReg w reg_x) (OpReg w reg_y)) `snocOL`
+ (UXTH (OpReg w dst) (OpReg w dst))) -- See Note [Signed arithmetic on AArch64]
CmmMachOp (MO_S_Shr w) [x, (CmmLit (CmmInt n _))]
| w == W32 || w == W64
=====================================
compiler/GHC/CmmToAsm/X86/CodeGen.hs
=====================================
@@ -6067,10 +6067,23 @@ genByteSwap width dst src = do
W64 | is32Bit -> do
let Reg64 dst_hi dst_lo = localReg64 dst
RegCode64 vcode rhi rlo <- iselExpr64 src
- return $ vcode `appOL`
- toOL [ MOV II32 (OpReg rlo) (OpReg dst_hi),
- MOV II32 (OpReg rhi) (OpReg dst_lo),
- BSWAP II32 dst_hi,
+ tmp <- getNewRegNat II32
+ -- Swap the low and high halves of the register.
+ --
+ -- NB: if dst_hi == rhi, we must make sure to preserve the contents
+ -- of rhi before writing to dst_hi (#25601).
+ let shuffle = if dst_hi == rhi && dst_lo == rlo then
+ toOL [ MOV II32 (OpReg rhi) (OpReg tmp),
+ MOV II32 (OpReg rlo) (OpReg dst_hi),
+ MOV II32 (OpReg tmp) (OpReg dst_lo) ]
+ else if dst_hi == rhi then
+ toOL [ MOV II32 (OpReg rhi) (OpReg dst_lo),
+ MOV II32 (OpReg rlo) (OpReg dst_hi) ]
+ else
+ toOL [ MOV II32 (OpReg rlo) (OpReg dst_hi),
+ MOV II32 (OpReg rhi) (OpReg dst_lo) ]
+ return $ vcode `appOL` shuffle `appOL`
+ toOL [ BSWAP II32 dst_hi,
BSWAP II32 dst_lo ]
W16 -> do
let dst_r = getLocalRegReg dst
=====================================
compiler/GHC/Types/Error.hs
=====================================
@@ -602,8 +602,14 @@ instance Diagnostic e => ToJson (MsgEnvelope e) where
where
diag = errMsgDiagnostic m
opts = defaultDiagnosticOpts @e
- style = mkErrStyle (errMsgContext m)
- ctx = defaultSDocContext {sdocStyle = style }
+ ctx = defaultSDocContext {
+ sdocStyle = mkErrStyle (errMsgContext m)
+ , sdocCanUseUnicode = True
+ -- Using Unicode makes it easier to consume the JSON output,
+ -- e.g. a suggestion to use foldl' will be displayed as
+ -- \u2018foldl'\u2019, which is not easily confused with
+ -- the quoted ‘foldl’ (note: no tick).
+ }
diagMsg = filter (not . isEmpty ctx) (unDecorated (diagnosticMessage (opts) diag))
renderToJSString :: SDoc -> JsonDoc
renderToJSString = JSString . (renderWithContext ctx)
=====================================
hadrian/src/Settings.hs
=====================================
@@ -35,7 +35,7 @@ getExtraArgs :: Args
getExtraArgs = expr flavour >>= extraArgs
getArgs :: Args
-getArgs = mconcat [ defaultBuilderArgs, getExtraArgs, defaultPackageArgs ]
+getArgs = mconcat [ defaultBuilderArgs, defaultPackageArgs, getExtraArgs ]
getLibraryWays :: Ways
getLibraryWays = expr flavour >>= libraryWays
=====================================
testsuite/tests/cmm/should_run/T25601.hs
=====================================
@@ -0,0 +1,22 @@
+{-# LANGUAGE UnboxedTuples #-}
+{-# LANGUAGE MagicHash #-}
+{-# LANGUAGE ForeignFunctionInterface #-}
+{-# LANGUAGE GHCForeignImportPrim #-}
+{-# LANGUAGE UnliftedFFITypes #-}
+
+import Numeric
+import GHC.Prim
+import GHC.Word
+import GHC.IO
+import GHC.Ptr
+import Data.List
+import qualified Data.ByteString as BS
+
+foreign import prim "test" c_test :: Addr# -> State# RealWorld -> (# State# RealWorld, Word64# #)
+
+main :: IO ()
+main = do
+ let bs = BS.pack $ take 100000 [ fromIntegral i | i <- [(1 :: Int) ..] ]
+ n <- BS.useAsCString bs $ \(Ptr addr) -> IO $ \s ->
+ case c_test addr s of (# s', n #) -> (# s', W64# n #)
+ print $ showHex n ""
=====================================
testsuite/tests/cmm/should_run/T25601.stdout
=====================================
@@ -0,0 +1 @@
+"f3f1ffffffffffff"
=====================================
testsuite/tests/cmm/should_run/T25601a.cmm
=====================================
@@ -0,0 +1,7 @@
+#include "Cmm.h"
+
+test ( W_ buffer ) {
+ bits64 ret;
+ (ret) = prim %bswap64(%neg(%zx64(bits16[buffer + (12 :: W_)])));
+ return (ret);
+}
=====================================
testsuite/tests/cmm/should_run/all.T
=====================================
@@ -47,3 +47,8 @@ test('AtomicFetch',
],
multi_compile_and_run,
['AtomicFetch', [('AtomicFetch_cmm.cmm', '')], ''])
+
+test('T25601',
+ [req_cmm],
+ multi_compile_and_run,
+ ['T25601', [('T25601a.cmm', '')], ''])
=====================================
testsuite/tests/codeGen/should_run/T26061.hs
=====================================
@@ -0,0 +1,41 @@
+{-# LANGUAGE MagicHash #-}
+{-# LANGUAGE ExtendedLiterals #-}
+import GHC.Word
+import GHC.Exts
+
+f :: Int16# -> Word16#
+f x = let !w = int16ToWord16# (x `uncheckedShiftRAInt16#` 1#)
+ in w `remWord16#` 13#Word16
+{-# NOINLINE f #-}
+
+g :: Int8# -> Word8#
+g x = let !w = int8ToWord8# (x `uncheckedShiftRAInt8#` 1#)
+ in w `remWord8#` 19#Word8
+{-# NOINLINE g #-}
+
+h :: Int16# -> Int# -> Word16#
+h x y = let !w = int16ToWord16# (x `uncheckedShiftRAInt16#` y)
+ in w `remWord16#` 13#Word16
+{-# NOINLINE h #-}
+
+i :: Int8# -> Int# -> Word8#
+i x y = let !w = int8ToWord8# (x `uncheckedShiftRAInt8#` y)
+ in w `remWord8#` 19#Word8
+{-# NOINLINE i #-}
+
+main :: IO ()
+main = do
+ print (W16# (f (-100#Int16)))
+ print (W8# (g (-100#Int8)))
+ print (W16# (h (-100#Int16) 1#))
+ print (W8# (i (-100#Int8) 1#))
+
+-- int16ToWord16 (-100 `shiftR` 1) `rem` 13
+-- = int16ToWord16 (-50) `rem` 13
+-- = 65486 `rem` 13
+-- = 5
+
+-- int8ToWord8 (-100 `shiftR` 1) `rem` 19
+-- = int8ToWord8 (-50) `rem` 19
+-- = 206 `rem` 19
+-- = 16
=====================================
testsuite/tests/codeGen/should_run/T26061.stdout
=====================================
@@ -0,0 +1,4 @@
+5
+16
+5
+16
=====================================
testsuite/tests/codeGen/should_run/all.T
=====================================
@@ -255,3 +255,4 @@ test('T24893', normal, compile_and_run, ['-O'])
test('CCallConv', [req_c], compile_and_run, ['CCallConv_c.c'])
test('T25364', normal, compile_and_run, [''])
+test('T26061', normal, compile_and_run, [''])
=====================================
testsuite/tests/driver/json.stderr
=====================================
@@ -1 +1 @@
-{"version":"1.1","ghcVersion":"ghc-9.13.20241113","span":{"file":"json.hs","start":{"line":9,"column":11},"end":{"line":9,"column":21}},"severity":"Error","code":48010,"message":["Empty list of alternatives in case expression"],"hints":["Perhaps you intended to use the `EmptyCase' extension"]}
+{"version":"1.1","ghcVersion":"ghc-9.13.20250529","span":{"file":"json.hs","start":{"line":9,"column":11},"end":{"line":9,"column":21}},"severity":"Error","code":48010,"message":["Empty list of alternatives in case expression"],"hints":["Perhaps you intended to use the \u2018EmptyCase\u2019 extension"]}
=====================================
testsuite/tests/driver/json_warn.stderr
=====================================
@@ -1,2 +1,2 @@
-{"version":"1.1","ghcVersion":"ghc-9.13.20241113","span":{"file":"json_warn.hs","start":{"line":4,"column":3},"end":{"line":4,"column":4}},"severity":"Warning","code":40910,"message":["Defined but not used: `x'"],"hints":[],"reason":{"flags":["unused-matches"]}}
-{"version":"1.1","ghcVersion":"ghc-9.13.20241113","span":{"file":"json_warn.hs","start":{"line":7,"column":5},"end":{"line":7,"column":9}},"severity":"Warning","code":63394,"message":["In the use of `head'\n(imported from Prelude, but defined in GHC.Internal.List):\n\"This is a partial function, it throws an error on empty lists. Use pattern matching, 'Data.List.uncons' or 'Data.Maybe.listToMaybe' instead. Consider refactoring to use \"Data.List.NonEmpty\".\""],"hints":[],"reason":{"category":"x-partial"}}
+{"version":"1.1","ghcVersion":"ghc-9.13.20250529","span":{"file":"json_warn.hs","start":{"line":4,"column":3},"end":{"line":4,"column":4}},"severity":"Warning","code":40910,"message":["Defined but not used: \u2018x\u2019"],"hints":[],"reason":{"flags":["unused-matches"]}}
+{"version":"1.1","ghcVersion":"ghc-9.13.20250529","span":{"file":"json_warn.hs","start":{"line":7,"column":5},"end":{"line":7,"column":9}},"severity":"Warning","code":63394,"message":["In the use of \u2018head\u2019\n(imported from Prelude, but defined in GHC.Internal.List):\n\"This is a partial function, it throws an error on empty lists. Use pattern matching, 'Data.List.uncons' or 'Data.Maybe.listToMaybe' instead. Consider refactoring to use \"Data.List.NonEmpty\".\""],"hints":[],"reason":{"category":"x-partial"}}
=====================================
utils/haddock/haddock-library/src/Documentation/Haddock/Parser.hs
=====================================
@@ -1,3 +1,4 @@
+{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ViewPatterns #-}
@@ -28,6 +29,7 @@ import Control.Applicative
import Control.Arrow (first)
import Control.Monad
import Data.Char (chr, isAlpha, isSpace, isUpper)
+import Data.Functor (($>))
import Data.List (elemIndex, intercalate, intersperse, unfoldr)
import Data.Maybe (fromMaybe, mapMaybe)
import Data.Monoid
@@ -186,11 +188,29 @@ specialChar = "_/<@\"&'`#[ "
-- to ensure that we have already given a chance to more meaningful parsers
-- before capturing their characters.
string' :: Parser (DocH mod a)
-string' = DocString . unescape . T.unpack <$> takeWhile1_ (`notElem` specialChar)
+string' =
+ DocString
+ <$> ((:) <$> rawOrEscChar "" <*> many (rawOrEscChar "(["))
+ -- After the first character, stop for @\(@ or @\[@ math starters. (The
+ -- first character won't start a valid math string because this parser
+ -- should follow math parsers. But this parser is expected to accept at
+ -- least one character from all inputs that don't start with special
+ -- characters, so the first character parser can't have the @"(["@
+ -- restriction.)
where
- unescape "" = ""
- unescape ('\\' : x : xs) = x : unescape xs
- unescape (x : xs) = x : unescape xs
+ -- | Parse a single logical character, either raw or escaped. Don't accept
+ -- escaped characters from the argument string.
+ rawOrEscChar :: [Char] -> Parser Char
+ rawOrEscChar restrictedEscapes = try $ Parsec.noneOf specialChar >>= \case
+ -- Handle backslashes:
+ -- - Fail on forbidden escape characters.
+ -- - Non-forbidden characters: simply unescape, e.g. parse "\b" as 'b',
+ -- - Trailing backslash: treat it as a raw backslash, not an escape
+ -- sequence. (This is the logic that this parser followed when this
+ -- comment was written; it is not necessarily intentional but now I
+ -- don't want to break anything relying on it.)
+ '\\' -> Parsec.noneOf restrictedEscapes <|> Parsec.eof $> '\\'
+ c -> pure c
-- | Skips a single special character and treats it as a plain string.
-- This is done to skip over any special characters belonging to other
=====================================
utils/haddock/haddock-library/test/Documentation/Haddock/ParserSpec.hs
=====================================
@@ -284,6 +284,13 @@ spec = do
it "supports title for deprecated picture syntax" $ do
"<<b a z>>" `shouldParseTo` image "b" "a z"
+ context "when parsing inline math" $ do
+ it "accepts inline math immediately after punctuation" $ do
+ "(\\(1 + 2 = 3\\) is an example of addition)"
+ `shouldParseTo` "("
+ <> DocMathInline "1 + 2 = 3"
+ <> " is an example of addition)"
+
context "when parsing display math" $ do
it "accepts markdown syntax for display math containing newlines" $ do
"\\[\\pi\n\\pi\\]" `shouldParseTo` DocMathDisplay "\\pi\n\\pi"
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/4de53bb43a0b92fcade65847d0841b…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/4de53bb43a0b92fcade65847d0841b…
You're receiving this email because of your account on gitlab.haskell.org.
1
0

[Git][ghc/ghc][wip/marge_bot_batch_merge_job] 8 commits: CI: Fix and clean up capture of timings
by Marge Bot (@marge-bot) 05 Jun '25
by Marge Bot (@marge-bot) 05 Jun '25
05 Jun '25
Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC
Commits:
6b694590 by Bryan Richter at 2025-06-05T03:49:45-04:00
CI: Fix and clean up capture of timings
* Fixes the typo that caused 'cat ci-timings' to report "no such file or
directory"
* Gave ci_timings.txt a file extension so it may play better with other
systems
* Fixed the use of time_it so all times are recorded
* Fixed time_it to print name along with timing
- - - - -
1b3c1560 by Bryan Richter at 2025-06-05T03:49:45-04:00
CI: Update collapsible section usage
The syntax apparently changed at some point.
- - - - -
ab12e581 by Bryan Richter at 2025-06-05T03:49:45-04:00
CI: Add more collapsible sections
- - - - -
9d0272d4 by Ben Gamari at 2025-06-05T03:49:46-04:00
hadrian: Place user options after package arguments
This makes it easier for the user to override the default package
arguments with `UserSettings.hs`.
Fixes #25821.
- - - - -
b1a315c5 by Ryan Hendrickson at 2025-06-05T03:49:50-04:00
haddock: Parse math even after ordinary characters
Fixes a bug where math sections were not recognized if preceded by a
character that isn't special (like space or a markup character).
- - - - -
5ed1298e by ARATA Mizuki at 2025-06-05T03:49:54-04:00
AArch64 NCG: Fix sub-word arithmetic right shift
As noted in Note [Signed arithmetic on AArch64], we should zero-extend sub-word values.
Fixes #26061
- - - - -
847fd785 by Simon Hengel at 2025-06-05T03:49:58-04:00
Allow Unicode in "message" and "hints" with -fdiagnostics-as-json
(fixes #26075)
- - - - -
4de53bb4 by ARATA Mizuki at 2025-06-05T03:50:02-04:00
x86 NCG: Fix code generation of bswap64 on i386
Co-authored-by: sheaf <sam.derbyshire(a)gmail.com>
Fix #25601
- - - - -
20 changed files:
- .gitlab-ci.yml
- .gitlab/ci.sh
- .gitlab/common.sh
- .gitlab/generate-ci/gen_ci.hs
- .gitlab/jobs.yaml
- compiler/GHC/CmmToAsm/AArch64/CodeGen.hs
- compiler/GHC/CmmToAsm/X86/CodeGen.hs
- compiler/GHC/Types/Error.hs
- hadrian/src/Settings.hs
- + testsuite/tests/cmm/should_run/T25601.hs
- + testsuite/tests/cmm/should_run/T25601.stdout
- + testsuite/tests/cmm/should_run/T25601a.cmm
- testsuite/tests/cmm/should_run/all.T
- + testsuite/tests/codeGen/should_run/T26061.hs
- + testsuite/tests/codeGen/should_run/T26061.stdout
- testsuite/tests/codeGen/should_run/all.T
- testsuite/tests/driver/json.stderr
- testsuite/tests/driver/json_warn.stderr
- utils/haddock/haddock-library/src/Documentation/Haddock/Parser.hs
- utils/haddock/haddock-library/test/Documentation/Haddock/ParserSpec.hs
Changes:
=====================================
.gitlab-ci.yml
=====================================
@@ -367,7 +367,7 @@ lint-submods-branch:
- .gitlab/ci.sh setup
after_script:
- .gitlab/ci.sh save_cache
- - cat ci-timings
+ - cat ci_timings.txt
variables:
GHC_FLAGS: -Werror
cache:
@@ -419,7 +419,7 @@ hadrian-ghc-in-ghci:
- echo ":q" | HADRIAN_ARGS=-j$CORES hadrian/ghci -j$CORES | tail -n2 | grep "Ok,"
after_script:
- .gitlab/ci.sh save_cache
- - cat ci-timings
+ - cat ci_timings.txt
cache:
key: hadrian-ghci-$CACHE_REV
paths:
=====================================
.gitlab/ci.sh
=====================================
@@ -34,7 +34,11 @@ function time_it() {
local delta=$(expr $end - $start)
echo "$name took $delta seconds"
- printf "%15s | $delta" > ci-timings
+ if [[ ! -e ci_timings.txt ]]; then
+ echo "=== TIMINGS ===" > ci_timings.txt
+ fi
+
+ printf "%15s | $delta\n" $name >> ci_timings.txt
return $res
}
@@ -239,8 +243,6 @@ function cabal_update() {
# Extract GHC toolchain
function setup() {
- echo "=== TIMINGS ===" > ci-timings
-
if [ -d "$CABAL_CACHE" ]; then
info "Extracting cabal cache from $CABAL_CACHE to $CABAL_DIR..."
mkdir -p "$CABAL_DIR"
@@ -279,7 +281,7 @@ function fetch_ghc() {
fail "neither GHC nor GHC_VERSION are not set"
fi
- start_section "fetch GHC"
+ start_section fetch-ghc "Fetch GHC"
url="https://downloads.haskell.org/~ghc/${GHC_VERSION}/ghc-${GHC_VERSION}-${boot…"
info "Fetching GHC binary distribution from $url..."
curl "$url" > ghc.tar.xz || fail "failed to fetch GHC binary distribution"
@@ -296,7 +298,7 @@ function fetch_ghc() {
;;
esac
rm -Rf "ghc-${GHC_VERSION}" ghc.tar.xz
- end_section "fetch GHC"
+ end_section fetch-ghc
fi
}
@@ -308,7 +310,7 @@ function fetch_cabal() {
fail "neither CABAL nor CABAL_INSTALL_VERSION are not set"
fi
- start_section "fetch cabal"
+ start_section fetch-cabal "Fetch Cabal"
case "$(uname)" in
# N.B. Windows uses zip whereas all others use .tar.xz
MSYS_*|MINGW*)
@@ -341,7 +343,7 @@ function fetch_cabal() {
fi
;;
esac
- end_section "fetch cabal"
+ end_section fetch-cabal
fi
}
@@ -349,6 +351,7 @@ function fetch_cabal() {
# here. For Docker platforms this is done in the Docker image
# build.
function setup_toolchain() {
+ start_section setup-toolchain "Setup toolchain"
fetch_ghc
fetch_cabal
cabal_update
@@ -371,10 +374,11 @@ function setup_toolchain() {
info "Building alex..."
$cabal_install alex --constraint="alex>=$MIN_ALEX_VERSION"
+ end_section setup-toolchain
}
function cleanup_submodules() {
- start_section "clean submodules"
+ start_section clean-submodules "Clean submodules"
if [ -d .git ]; then
info "Cleaning submodules..."
# On Windows submodules can inexplicably get into funky states where git
@@ -386,7 +390,7 @@ function cleanup_submodules() {
else
info "Not cleaning submodules, not in a git repo"
fi;
- end_section "clean submodules"
+ end_section clean-submodules
}
function configure() {
@@ -486,6 +490,8 @@ function check_release_build() {
}
function build_hadrian() {
+ start_section build-hadrian "Build via Hadrian"
+
if [ -z "${BIN_DIST_NAME:-}" ]; then
fail "BIN_DIST_NAME not set"
fi
@@ -519,7 +525,7 @@ function build_hadrian() {
;;
esac
fi
-
+ end_section build-hadrian
}
# run's `make DESTDIR=$1 install` and then
@@ -545,6 +551,7 @@ function make_install_destdir() {
# install the binary distribution in directory $1 to $2.
function install_bindist() {
+ start_section install-bindist "Install bindist"
case "${CONFIGURE_WRAPPER:-}" in
emconfigure) source "$EMSDK/emsdk_env.sh" ;;
*) ;;
@@ -584,9 +591,11 @@ function install_bindist() {
;;
esac
popd
+ end_section install-bindist
}
function test_hadrian() {
+ start_section test-hadrian "Test via Hadrian"
check_msys2_deps _build/stage1/bin/ghc --version
check_release_build
@@ -708,6 +717,7 @@ function test_hadrian() {
info "STAGE2_TEST=$?"
fi
+ end_section test-hadrian
}
function summarise_hi_files() {
@@ -742,7 +752,7 @@ function cabal_abi_test() {
pushd $DIR
echo $PWD
- start_section "Cabal test: $OUT"
+ start_section cabal-abi-test "Cabal ABI test: $OUT"
mkdir -p "$OUT"
"$HC" \
-hidir tmp -odir tmp -fforce-recomp -haddock \
@@ -752,7 +762,7 @@ function cabal_abi_test() {
summarise_hi_files
summarise_o_files
popd
- end_section "Cabal test: $OUT"
+ end_section cabal-abi-test
}
function cabal_test() {
@@ -760,7 +770,7 @@ function cabal_test() {
fail "OUT not set"
fi
- start_section "Cabal test: $OUT"
+ start_section cabal-test "Cabal test: $OUT"
mkdir -p "$OUT"
run "$HC" \
-hidir tmp -odir tmp -fforce-recomp \
@@ -769,7 +779,7 @@ function cabal_test() {
-ilibraries/Cabal/Cabal/src -XNoPolyKinds Distribution.Simple \
"$@" 2>&1 | tee $OUT/log
rm -Rf tmp
- end_section "Cabal test: $OUT"
+ end_section cabal-test
}
function run_perf_test() {
=====================================
.gitlab/common.sh
=====================================
@@ -20,15 +20,18 @@ WHITE="1;37"
LT_GRAY="0;37"
# GitLab Pipelines log section delimiters
-# https://gitlab.com/gitlab-org/gitlab-foss/issues/14664
-start_section() {
- name="$1"
- echo -e "section_start:$(date +%s):$name\015\033[0K"
+# https://docs.gitlab.com/ci/jobs/job_logs/#custom-collapsible-sections
+function start_section () {
+ local section_title="${1}"
+ local section_description="${2:-$section_title}"
+
+ echo -e "section_start:$(date +%s):${section_title}[collapsed=true]\r\e[0K${section_description}"
}
-end_section() {
- name="$1"
- echo -e "section_end:$(date +%s):$name\015\033[0K"
+function end_section () {
+ local section_title="${1}"
+
+ echo -e "section_end:$(date +%s):${section_title}\r\e[0K"
}
echo_color() {
=====================================
.gitlab/generate-ci/gen_ci.hs
=====================================
@@ -870,7 +870,7 @@ job arch opsys buildConfig = NamedJob { name = jobName, jobInfo = Job {..} }
[ ".gitlab/ci.sh save_cache"
, ".gitlab/ci.sh save_test_output"
, ".gitlab/ci.sh clean"
- , "cat ci_timings"
+ , "cat ci_timings.txt"
]
jobFlavour = mkJobFlavour buildConfig
=====================================
.gitlab/jobs.yaml
=====================================
@@ -5,7 +5,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -71,7 +71,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -134,7 +134,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -196,7 +196,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -258,7 +258,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -482,7 +482,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": true,
"artifacts": {
@@ -545,7 +545,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -607,7 +607,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -669,7 +669,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -736,7 +736,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -800,7 +800,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -863,7 +863,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -926,7 +926,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -1153,7 +1153,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": true,
"artifacts": {
@@ -1217,7 +1217,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -1280,7 +1280,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -1343,7 +1343,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -1413,7 +1413,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -1479,7 +1479,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": true,
"artifacts": {
@@ -1543,7 +1543,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -1607,7 +1607,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -1671,7 +1671,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -1735,7 +1735,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -1800,7 +1800,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -1865,7 +1865,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -1930,7 +1930,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -1993,7 +1993,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -2056,7 +2056,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -2121,7 +2121,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -2187,7 +2187,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -2250,7 +2250,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -2313,7 +2313,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": true,
"artifacts": {
@@ -2376,7 +2376,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -2440,7 +2440,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -2503,7 +2503,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -2568,7 +2568,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -2631,7 +2631,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -2694,7 +2694,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -2757,7 +2757,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -2820,7 +2820,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": true,
"artifacts": {
@@ -2885,7 +2885,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -2948,7 +2948,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -3011,7 +3011,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -3076,7 +3076,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -3142,7 +3142,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -3207,7 +3207,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -3270,7 +3270,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -3333,7 +3333,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -3396,7 +3396,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -3459,7 +3459,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -3587,7 +3587,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -3776,7 +3776,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -3844,7 +3844,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -3909,7 +3909,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -3973,7 +3973,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -4037,7 +4037,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": true,
"artifacts": {
@@ -4102,7 +4102,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -4166,7 +4166,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -4230,7 +4230,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -4301,7 +4301,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -4368,7 +4368,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": true,
"artifacts": {
@@ -4433,7 +4433,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -4498,7 +4498,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -4563,7 +4563,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -4628,7 +4628,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -4692,7 +4692,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -4756,7 +4756,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -4820,7 +4820,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -4884,7 +4884,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -4948,7 +4948,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -5014,7 +5014,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -5080,7 +5080,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -5147,7 +5147,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -5211,7 +5211,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -5275,7 +5275,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -5339,7 +5339,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -5403,7 +5403,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -5467,7 +5467,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -5659,7 +5659,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -5728,7 +5728,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -5793,7 +5793,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": true,
"artifacts": {
@@ -5856,7 +5856,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -5919,7 +5919,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -5982,7 +5982,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -6045,7 +6045,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -6109,7 +6109,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -6174,7 +6174,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -6239,7 +6239,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -6301,7 +6301,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -6363,7 +6363,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -6427,7 +6427,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -6492,7 +6492,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -6554,7 +6554,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -6616,7 +6616,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -6679,7 +6679,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -6742,7 +6742,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -6804,7 +6804,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -6868,7 +6868,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -6930,7 +6930,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -6992,7 +6992,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -7054,7 +7054,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -7116,7 +7116,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": true,
"artifacts": {
@@ -7181,7 +7181,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -7243,7 +7243,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -7305,7 +7305,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -7369,7 +7369,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -7434,7 +7434,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -7498,7 +7498,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -7560,7 +7560,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -7622,7 +7622,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -7684,7 +7684,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -7746,7 +7746,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -7872,7 +7872,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
=====================================
compiler/GHC/CmmToAsm/AArch64/CodeGen.hs
=====================================
@@ -928,21 +928,25 @@ getRegister' config plat expr
CmmMachOp (MO_S_Shr w) [x, (CmmLit (CmmInt n _))] | w == W8, 0 <= n, n < 8 -> do
(reg_x, _format_x, code_x) <- getSomeReg x
- return $ Any (intFormat w) (\dst -> code_x `snocOL` annExpr expr (SBFX (OpReg w dst) (OpReg w reg_x) (OpImm (ImmInteger n)) (OpImm (ImmInteger (8-n)))))
+ return $ Any (intFormat w) (\dst -> code_x `snocOL` annExpr expr (SBFX (OpReg w dst) (OpReg w reg_x) (OpImm (ImmInteger n)) (OpImm (ImmInteger (8-n))))
+ `snocOL` (UXTB (OpReg w dst) (OpReg w dst))) -- See Note [Signed arithmetic on AArch64]
CmmMachOp (MO_S_Shr w) [x, y] | w == W8 -> do
(reg_x, _format_x, code_x) <- getSomeReg x
(reg_y, _format_y, code_y) <- getSomeReg y
return $ Any (intFormat w) (\dst -> code_x `appOL` code_y `snocOL` annExpr expr (SXTB (OpReg w reg_x) (OpReg w reg_x)) `snocOL`
- (ASR (OpReg w dst) (OpReg w reg_x) (OpReg w reg_y)))
+ (ASR (OpReg w dst) (OpReg w reg_x) (OpReg w reg_y)) `snocOL`
+ (UXTB (OpReg w dst) (OpReg w dst))) -- See Note [Signed arithmetic on AArch64]
CmmMachOp (MO_S_Shr w) [x, (CmmLit (CmmInt n _))] | w == W16, 0 <= n, n < 16 -> do
(reg_x, _format_x, code_x) <- getSomeReg x
- return $ Any (intFormat w) (\dst -> code_x `snocOL` annExpr expr (SBFX (OpReg w dst) (OpReg w reg_x) (OpImm (ImmInteger n)) (OpImm (ImmInteger (16-n)))))
+ return $ Any (intFormat w) (\dst -> code_x `snocOL` annExpr expr (SBFX (OpReg w dst) (OpReg w reg_x) (OpImm (ImmInteger n)) (OpImm (ImmInteger (16-n))))
+ `snocOL` (UXTH (OpReg w dst) (OpReg w dst))) -- See Note [Signed arithmetic on AArch64]
CmmMachOp (MO_S_Shr w) [x, y] | w == W16 -> do
(reg_x, _format_x, code_x) <- getSomeReg x
(reg_y, _format_y, code_y) <- getSomeReg y
return $ Any (intFormat w) (\dst -> code_x `appOL` code_y `snocOL` annExpr expr (SXTH (OpReg w reg_x) (OpReg w reg_x)) `snocOL`
- (ASR (OpReg w dst) (OpReg w reg_x) (OpReg w reg_y)))
+ (ASR (OpReg w dst) (OpReg w reg_x) (OpReg w reg_y)) `snocOL`
+ (UXTH (OpReg w dst) (OpReg w dst))) -- See Note [Signed arithmetic on AArch64]
CmmMachOp (MO_S_Shr w) [x, (CmmLit (CmmInt n _))]
| w == W32 || w == W64
=====================================
compiler/GHC/CmmToAsm/X86/CodeGen.hs
=====================================
@@ -6067,10 +6067,23 @@ genByteSwap width dst src = do
W64 | is32Bit -> do
let Reg64 dst_hi dst_lo = localReg64 dst
RegCode64 vcode rhi rlo <- iselExpr64 src
- return $ vcode `appOL`
- toOL [ MOV II32 (OpReg rlo) (OpReg dst_hi),
- MOV II32 (OpReg rhi) (OpReg dst_lo),
- BSWAP II32 dst_hi,
+ tmp <- getNewRegNat II32
+ -- Swap the low and high halves of the register.
+ --
+ -- NB: if dst_hi == rhi, we must make sure to preserve the contents
+ -- of rhi before writing to dst_hi (#25601).
+ let shuffle = if dst_hi == rhi && dst_lo == rlo then
+ toOL [ MOV II32 (OpReg rhi) (OpReg tmp),
+ MOV II32 (OpReg rlo) (OpReg dst_hi),
+ MOV II32 (OpReg tmp) (OpReg dst_lo) ]
+ else if dst_hi == rhi then
+ toOL [ MOV II32 (OpReg rhi) (OpReg dst_lo),
+ MOV II32 (OpReg rlo) (OpReg dst_hi) ]
+ else
+ toOL [ MOV II32 (OpReg rlo) (OpReg dst_hi),
+ MOV II32 (OpReg rhi) (OpReg dst_lo) ]
+ return $ vcode `appOL` shuffle `appOL`
+ toOL [ BSWAP II32 dst_hi,
BSWAP II32 dst_lo ]
W16 -> do
let dst_r = getLocalRegReg dst
=====================================
compiler/GHC/Types/Error.hs
=====================================
@@ -602,8 +602,14 @@ instance Diagnostic e => ToJson (MsgEnvelope e) where
where
diag = errMsgDiagnostic m
opts = defaultDiagnosticOpts @e
- style = mkErrStyle (errMsgContext m)
- ctx = defaultSDocContext {sdocStyle = style }
+ ctx = defaultSDocContext {
+ sdocStyle = mkErrStyle (errMsgContext m)
+ , sdocCanUseUnicode = True
+ -- Using Unicode makes it easier to consume the JSON output,
+ -- e.g. a suggestion to use foldl' will be displayed as
+ -- \u2018foldl'\u2019, which is not easily confused with
+ -- the quoted ‘foldl’ (note: no tick).
+ }
diagMsg = filter (not . isEmpty ctx) (unDecorated (diagnosticMessage (opts) diag))
renderToJSString :: SDoc -> JsonDoc
renderToJSString = JSString . (renderWithContext ctx)
=====================================
hadrian/src/Settings.hs
=====================================
@@ -35,7 +35,7 @@ getExtraArgs :: Args
getExtraArgs = expr flavour >>= extraArgs
getArgs :: Args
-getArgs = mconcat [ defaultBuilderArgs, getExtraArgs, defaultPackageArgs ]
+getArgs = mconcat [ defaultBuilderArgs, defaultPackageArgs, getExtraArgs ]
getLibraryWays :: Ways
getLibraryWays = expr flavour >>= libraryWays
=====================================
testsuite/tests/cmm/should_run/T25601.hs
=====================================
@@ -0,0 +1,22 @@
+{-# LANGUAGE UnboxedTuples #-}
+{-# LANGUAGE MagicHash #-}
+{-# LANGUAGE ForeignFunctionInterface #-}
+{-# LANGUAGE GHCForeignImportPrim #-}
+{-# LANGUAGE UnliftedFFITypes #-}
+
+import Numeric
+import GHC.Prim
+import GHC.Word
+import GHC.IO
+import GHC.Ptr
+import Data.List
+import qualified Data.ByteString as BS
+
+foreign import prim "test" c_test :: Addr# -> State# RealWorld -> (# State# RealWorld, Word64# #)
+
+main :: IO ()
+main = do
+ let bs = BS.pack $ take 100000 [ fromIntegral i | i <- [(1 :: Int) ..] ]
+ n <- BS.useAsCString bs $ \(Ptr addr) -> IO $ \s ->
+ case c_test addr s of (# s', n #) -> (# s', W64# n #)
+ print $ showHex n ""
=====================================
testsuite/tests/cmm/should_run/T25601.stdout
=====================================
@@ -0,0 +1 @@
+"f3f1ffffffffffff"
=====================================
testsuite/tests/cmm/should_run/T25601a.cmm
=====================================
@@ -0,0 +1,7 @@
+#include "Cmm.h"
+
+test ( W_ buffer ) {
+ bits64 ret;
+ (ret) = prim %bswap64(%neg(%zx64(bits16[buffer + (12 :: W_)])));
+ return (ret);
+}
=====================================
testsuite/tests/cmm/should_run/all.T
=====================================
@@ -47,3 +47,8 @@ test('AtomicFetch',
],
multi_compile_and_run,
['AtomicFetch', [('AtomicFetch_cmm.cmm', '')], ''])
+
+test('T25601',
+ [req_cmm],
+ multi_compile_and_run,
+ ['T25601', [('T25601a.cmm', '')], ''])
=====================================
testsuite/tests/codeGen/should_run/T26061.hs
=====================================
@@ -0,0 +1,41 @@
+{-# LANGUAGE MagicHash #-}
+{-# LANGUAGE ExtendedLiterals #-}
+import GHC.Word
+import GHC.Exts
+
+f :: Int16# -> Word16#
+f x = let !w = int16ToWord16# (x `uncheckedShiftRAInt16#` 1#)
+ in w `remWord16#` 13#Word16
+{-# NOINLINE f #-}
+
+g :: Int8# -> Word8#
+g x = let !w = int8ToWord8# (x `uncheckedShiftRAInt8#` 1#)
+ in w `remWord8#` 19#Word8
+{-# NOINLINE g #-}
+
+h :: Int16# -> Int# -> Word16#
+h x y = let !w = int16ToWord16# (x `uncheckedShiftRAInt16#` y)
+ in w `remWord16#` 13#Word16
+{-# NOINLINE h #-}
+
+i :: Int8# -> Int# -> Word8#
+i x y = let !w = int8ToWord8# (x `uncheckedShiftRAInt8#` y)
+ in w `remWord8#` 19#Word8
+{-# NOINLINE i #-}
+
+main :: IO ()
+main = do
+ print (W16# (f (-100#Int16)))
+ print (W8# (g (-100#Int8)))
+ print (W16# (h (-100#Int16) 1#))
+ print (W8# (i (-100#Int8) 1#))
+
+-- int16ToWord16 (-100 `shiftR` 1) `rem` 13
+-- = int16ToWord16 (-50) `rem` 13
+-- = 65486 `rem` 13
+-- = 5
+
+-- int8ToWord8 (-100 `shiftR` 1) `rem` 19
+-- = int8ToWord8 (-50) `rem` 19
+-- = 206 `rem` 19
+-- = 16
=====================================
testsuite/tests/codeGen/should_run/T26061.stdout
=====================================
@@ -0,0 +1,4 @@
+5
+16
+5
+16
=====================================
testsuite/tests/codeGen/should_run/all.T
=====================================
@@ -255,3 +255,4 @@ test('T24893', normal, compile_and_run, ['-O'])
test('CCallConv', [req_c], compile_and_run, ['CCallConv_c.c'])
test('T25364', normal, compile_and_run, [''])
+test('T26061', normal, compile_and_run, [''])
=====================================
testsuite/tests/driver/json.stderr
=====================================
@@ -1 +1 @@
-{"version":"1.1","ghcVersion":"ghc-9.13.20241113","span":{"file":"json.hs","start":{"line":9,"column":11},"end":{"line":9,"column":21}},"severity":"Error","code":48010,"message":["Empty list of alternatives in case expression"],"hints":["Perhaps you intended to use the `EmptyCase' extension"]}
+{"version":"1.1","ghcVersion":"ghc-9.13.20250529","span":{"file":"json.hs","start":{"line":9,"column":11},"end":{"line":9,"column":21}},"severity":"Error","code":48010,"message":["Empty list of alternatives in case expression"],"hints":["Perhaps you intended to use the \u2018EmptyCase\u2019 extension"]}
=====================================
testsuite/tests/driver/json_warn.stderr
=====================================
@@ -1,2 +1,2 @@
-{"version":"1.1","ghcVersion":"ghc-9.13.20241113","span":{"file":"json_warn.hs","start":{"line":4,"column":3},"end":{"line":4,"column":4}},"severity":"Warning","code":40910,"message":["Defined but not used: `x'"],"hints":[],"reason":{"flags":["unused-matches"]}}
-{"version":"1.1","ghcVersion":"ghc-9.13.20241113","span":{"file":"json_warn.hs","start":{"line":7,"column":5},"end":{"line":7,"column":9}},"severity":"Warning","code":63394,"message":["In the use of `head'\n(imported from Prelude, but defined in GHC.Internal.List):\n\"This is a partial function, it throws an error on empty lists. Use pattern matching, 'Data.List.uncons' or 'Data.Maybe.listToMaybe' instead. Consider refactoring to use \"Data.List.NonEmpty\".\""],"hints":[],"reason":{"category":"x-partial"}}
+{"version":"1.1","ghcVersion":"ghc-9.13.20250529","span":{"file":"json_warn.hs","start":{"line":4,"column":3},"end":{"line":4,"column":4}},"severity":"Warning","code":40910,"message":["Defined but not used: \u2018x\u2019"],"hints":[],"reason":{"flags":["unused-matches"]}}
+{"version":"1.1","ghcVersion":"ghc-9.13.20250529","span":{"file":"json_warn.hs","start":{"line":7,"column":5},"end":{"line":7,"column":9}},"severity":"Warning","code":63394,"message":["In the use of \u2018head\u2019\n(imported from Prelude, but defined in GHC.Internal.List):\n\"This is a partial function, it throws an error on empty lists. Use pattern matching, 'Data.List.uncons' or 'Data.Maybe.listToMaybe' instead. Consider refactoring to use \"Data.List.NonEmpty\".\""],"hints":[],"reason":{"category":"x-partial"}}
=====================================
utils/haddock/haddock-library/src/Documentation/Haddock/Parser.hs
=====================================
@@ -1,3 +1,4 @@
+{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ViewPatterns #-}
@@ -28,6 +29,7 @@ import Control.Applicative
import Control.Arrow (first)
import Control.Monad
import Data.Char (chr, isAlpha, isSpace, isUpper)
+import Data.Functor (($>))
import Data.List (elemIndex, intercalate, intersperse, unfoldr)
import Data.Maybe (fromMaybe, mapMaybe)
import Data.Monoid
@@ -186,11 +188,29 @@ specialChar = "_/<@\"&'`#[ "
-- to ensure that we have already given a chance to more meaningful parsers
-- before capturing their characters.
string' :: Parser (DocH mod a)
-string' = DocString . unescape . T.unpack <$> takeWhile1_ (`notElem` specialChar)
+string' =
+ DocString
+ <$> ((:) <$> rawOrEscChar "" <*> many (rawOrEscChar "(["))
+ -- After the first character, stop for @\(@ or @\[@ math starters. (The
+ -- first character won't start a valid math string because this parser
+ -- should follow math parsers. But this parser is expected to accept at
+ -- least one character from all inputs that don't start with special
+ -- characters, so the first character parser can't have the @"(["@
+ -- restriction.)
where
- unescape "" = ""
- unescape ('\\' : x : xs) = x : unescape xs
- unescape (x : xs) = x : unescape xs
+ -- | Parse a single logical character, either raw or escaped. Don't accept
+ -- escaped characters from the argument string.
+ rawOrEscChar :: [Char] -> Parser Char
+ rawOrEscChar restrictedEscapes = try $ Parsec.noneOf specialChar >>= \case
+ -- Handle backslashes:
+ -- - Fail on forbidden escape characters.
+ -- - Non-forbidden characters: simply unescape, e.g. parse "\b" as 'b',
+ -- - Trailing backslash: treat it as a raw backslash, not an escape
+ -- sequence. (This is the logic that this parser followed when this
+ -- comment was written; it is not necessarily intentional but now I
+ -- don't want to break anything relying on it.)
+ '\\' -> Parsec.noneOf restrictedEscapes <|> Parsec.eof $> '\\'
+ c -> pure c
-- | Skips a single special character and treats it as a plain string.
-- This is done to skip over any special characters belonging to other
=====================================
utils/haddock/haddock-library/test/Documentation/Haddock/ParserSpec.hs
=====================================
@@ -284,6 +284,13 @@ spec = do
it "supports title for deprecated picture syntax" $ do
"<<b a z>>" `shouldParseTo` image "b" "a z"
+ context "when parsing inline math" $ do
+ it "accepts inline math immediately after punctuation" $ do
+ "(\\(1 + 2 = 3\\) is an example of addition)"
+ `shouldParseTo` "("
+ <> DocMathInline "1 + 2 = 3"
+ <> " is an example of addition)"
+
context "when parsing display math" $ do
it "accepts markdown syntax for display math containing newlines" $ do
"\\[\\pi\n\\pi\\]" `shouldParseTo` DocMathDisplay "\\pi\n\\pi"
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/5f82459a63facc821317a1b88f9db4…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/5f82459a63facc821317a1b88f9db4…
You're receiving this email because of your account on gitlab.haskell.org.
1
0

[Git][ghc/ghc][wip/amg/T26037] ghci: Mention active language edition in startup banner
by Adam Gundry (@adamgundry) 05 Jun '25
by Adam Gundry (@adamgundry) 05 Jun '25
05 Jun '25
Adam Gundry pushed to branch wip/amg/T26037 at Glasgow Haskell Compiler / GHC
Commits:
d099d2e9 by Adam Gundry at 2025-06-05T07:50:57+02:00
ghci: Mention active language edition in startup banner
Per GHC proposal 632, this makes the GHCi startup banner include
the active language edition, plus an indication of whether this
was the default (as opposed to being explicitly selected via an
option such as `-XGHC2024`). For example:
```
$ ghci
GHCi, version 9.14.1: https://www.haskell.org/ghc/ :? for help
Using default language edition: GHC2024
ghci>
```
Fixes #26037.
- - - - -
2 changed files:
- ghc/GHCi/UI.hs
- ghc/Main.hs
Changes:
=====================================
ghc/GHCi/UI.hs
=====================================
@@ -28,7 +28,8 @@ module GHCi.UI (
GhciSettings(..),
defaultGhciSettings,
ghciCommands,
- ghciWelcomeMsg
+ ghciWelcomeMsg,
+ languageEditionMsg
) where
-- GHCi
@@ -199,6 +200,10 @@ ghciWelcomeMsg :: String
ghciWelcomeMsg = "GHCi, version " ++ cProjectVersion ++
": https://www.haskell.org/ghc/ :? for help"
+languageEditionMsg :: Maybe Language -> String
+languageEditionMsg Nothing = "Using default language edition: " ++ show defaultLanguage
+languageEditionMsg (Just lang) = "Using language edition: " ++ show lang
+
ghciCommands :: [Command]
ghciCommands = map mkCmd [
-- Hugs users are accustomed to :e, so make sure it doesn't overlap
=====================================
ghc/Main.hs
=====================================
@@ -38,7 +38,7 @@ import GHC.Platform
import GHC.Platform.Host
#if defined(HAVE_INTERNAL_INTERPRETER)
-import GHCi.UI ( interactiveUI, ghciWelcomeMsg, defaultGhciSettings )
+import GHCi.UI ( interactiveUI, ghciWelcomeMsg, defaultGhciSettings, languageEditionMsg )
#endif
import GHC.Runtime.Loader ( loadFrontendPlugin, initializeSessionPlugins )
@@ -334,7 +334,9 @@ showBanner _postLoadMode dflags = do
#if defined(HAVE_INTERNAL_INTERPRETER)
-- Show the GHCi banner
- when (isInteractiveMode _postLoadMode && verb >= 1) $ putStrLn ghciWelcomeMsg
+ when (isInteractiveMode _postLoadMode && verb >= 1) $
+ do putStrLn ghciWelcomeMsg
+ putStrLn $ languageEditionMsg (language dflags)
#endif
-- Display details of the configuration in verbose mode
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/d099d2e9d93fb3a21c42d846d2b642d…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/d099d2e9d93fb3a21c42d846d2b642d…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
Adam Gundry pushed new branch wip/amg/T26037 at Glasgow Haskell Compiler / GHC
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/amg/T26037
You're receiving this email because of your account on gitlab.haskell.org.
1
0

[Git][ghc/ghc][wip/marge_bot_batch_merge_job] 7 commits: CI: Fix and clean up capture of timings
by Marge Bot (@marge-bot) 04 Jun '25
by Marge Bot (@marge-bot) 04 Jun '25
04 Jun '25
Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC
Commits:
2ff51b88 by Bryan Richter at 2025-06-04T19:25:41-04:00
CI: Fix and clean up capture of timings
* Fixes the typo that caused 'cat ci-timings' to report "no such file or
directory"
* Gave ci_timings.txt a file extension so it may play better with other
systems
* Fixed the use of time_it so all times are recorded
* Fixed time_it to print name along with timing
- - - - -
8955f8ba by Bryan Richter at 2025-06-04T19:25:41-04:00
CI: Update collapsible section usage
The syntax apparently changed at some point.
- - - - -
ee671567 by Bryan Richter at 2025-06-04T19:25:42-04:00
CI: Add more collapsible sections
- - - - -
2b68cdb1 by Ben Gamari at 2025-06-04T19:25:43-04:00
hadrian: Place user options after package arguments
This makes it easier for the user to override the default package
arguments with `UserSettings.hs`.
Fixes #25821.
- - - - -
44e7faa4 by Ryan Hendrickson at 2025-06-04T19:25:47-04:00
haddock: Parse math even after ordinary characters
Fixes a bug where math sections were not recognized if preceded by a
character that isn't special (like space or a markup character).
- - - - -
5890917f by ARATA Mizuki at 2025-06-04T19:25:53-04:00
AArch64 NCG: Fix sub-word arithmetic right shift
As noted in Note [Signed arithmetic on AArch64], we should zero-extend sub-word values.
Fixes #26061
- - - - -
5f82459a by ARATA Mizuki at 2025-06-04T19:25:58-04:00
x86 NCG: Fix code generation of bswap64 on i386
Co-authored-by: sheaf <sam.derbyshire(a)gmail.com>
Fix #25601
- - - - -
17 changed files:
- .gitlab-ci.yml
- .gitlab/ci.sh
- .gitlab/common.sh
- .gitlab/generate-ci/gen_ci.hs
- .gitlab/jobs.yaml
- compiler/GHC/CmmToAsm/AArch64/CodeGen.hs
- compiler/GHC/CmmToAsm/X86/CodeGen.hs
- hadrian/src/Settings.hs
- + testsuite/tests/cmm/should_run/T25601.hs
- + testsuite/tests/cmm/should_run/T25601.stdout
- + testsuite/tests/cmm/should_run/T25601a.cmm
- testsuite/tests/cmm/should_run/all.T
- + testsuite/tests/codeGen/should_run/T26061.hs
- + testsuite/tests/codeGen/should_run/T26061.stdout
- testsuite/tests/codeGen/should_run/all.T
- utils/haddock/haddock-library/src/Documentation/Haddock/Parser.hs
- utils/haddock/haddock-library/test/Documentation/Haddock/ParserSpec.hs
Changes:
=====================================
.gitlab-ci.yml
=====================================
@@ -367,7 +367,7 @@ lint-submods-branch:
- .gitlab/ci.sh setup
after_script:
- .gitlab/ci.sh save_cache
- - cat ci-timings
+ - cat ci_timings.txt
variables:
GHC_FLAGS: -Werror
cache:
@@ -419,7 +419,7 @@ hadrian-ghc-in-ghci:
- echo ":q" | HADRIAN_ARGS=-j$CORES hadrian/ghci -j$CORES | tail -n2 | grep "Ok,"
after_script:
- .gitlab/ci.sh save_cache
- - cat ci-timings
+ - cat ci_timings.txt
cache:
key: hadrian-ghci-$CACHE_REV
paths:
=====================================
.gitlab/ci.sh
=====================================
@@ -34,7 +34,11 @@ function time_it() {
local delta=$(expr $end - $start)
echo "$name took $delta seconds"
- printf "%15s | $delta" > ci-timings
+ if [[ ! -e ci_timings.txt ]]; then
+ echo "=== TIMINGS ===" > ci_timings.txt
+ fi
+
+ printf "%15s | $delta\n" $name >> ci_timings.txt
return $res
}
@@ -239,8 +243,6 @@ function cabal_update() {
# Extract GHC toolchain
function setup() {
- echo "=== TIMINGS ===" > ci-timings
-
if [ -d "$CABAL_CACHE" ]; then
info "Extracting cabal cache from $CABAL_CACHE to $CABAL_DIR..."
mkdir -p "$CABAL_DIR"
@@ -279,7 +281,7 @@ function fetch_ghc() {
fail "neither GHC nor GHC_VERSION are not set"
fi
- start_section "fetch GHC"
+ start_section fetch-ghc "Fetch GHC"
url="https://downloads.haskell.org/~ghc/${GHC_VERSION}/ghc-${GHC_VERSION}-${boot…"
info "Fetching GHC binary distribution from $url..."
curl "$url" > ghc.tar.xz || fail "failed to fetch GHC binary distribution"
@@ -296,7 +298,7 @@ function fetch_ghc() {
;;
esac
rm -Rf "ghc-${GHC_VERSION}" ghc.tar.xz
- end_section "fetch GHC"
+ end_section fetch-ghc
fi
}
@@ -308,7 +310,7 @@ function fetch_cabal() {
fail "neither CABAL nor CABAL_INSTALL_VERSION are not set"
fi
- start_section "fetch cabal"
+ start_section fetch-cabal "Fetch Cabal"
case "$(uname)" in
# N.B. Windows uses zip whereas all others use .tar.xz
MSYS_*|MINGW*)
@@ -341,7 +343,7 @@ function fetch_cabal() {
fi
;;
esac
- end_section "fetch cabal"
+ end_section fetch-cabal
fi
}
@@ -349,6 +351,7 @@ function fetch_cabal() {
# here. For Docker platforms this is done in the Docker image
# build.
function setup_toolchain() {
+ start_section setup-toolchain "Setup toolchain"
fetch_ghc
fetch_cabal
cabal_update
@@ -371,10 +374,11 @@ function setup_toolchain() {
info "Building alex..."
$cabal_install alex --constraint="alex>=$MIN_ALEX_VERSION"
+ end_section setup-toolchain
}
function cleanup_submodules() {
- start_section "clean submodules"
+ start_section clean-submodules "Clean submodules"
if [ -d .git ]; then
info "Cleaning submodules..."
# On Windows submodules can inexplicably get into funky states where git
@@ -386,7 +390,7 @@ function cleanup_submodules() {
else
info "Not cleaning submodules, not in a git repo"
fi;
- end_section "clean submodules"
+ end_section clean-submodules
}
function configure() {
@@ -486,6 +490,8 @@ function check_release_build() {
}
function build_hadrian() {
+ start_section build-hadrian "Build via Hadrian"
+
if [ -z "${BIN_DIST_NAME:-}" ]; then
fail "BIN_DIST_NAME not set"
fi
@@ -519,7 +525,7 @@ function build_hadrian() {
;;
esac
fi
-
+ end_section build-hadrian
}
# run's `make DESTDIR=$1 install` and then
@@ -545,6 +551,7 @@ function make_install_destdir() {
# install the binary distribution in directory $1 to $2.
function install_bindist() {
+ start_section install-bindist "Install bindist"
case "${CONFIGURE_WRAPPER:-}" in
emconfigure) source "$EMSDK/emsdk_env.sh" ;;
*) ;;
@@ -584,9 +591,11 @@ function install_bindist() {
;;
esac
popd
+ end_section install-bindist
}
function test_hadrian() {
+ start_section test-hadrian "Test via Hadrian"
check_msys2_deps _build/stage1/bin/ghc --version
check_release_build
@@ -708,6 +717,7 @@ function test_hadrian() {
info "STAGE2_TEST=$?"
fi
+ end_section test-hadrian
}
function summarise_hi_files() {
@@ -742,7 +752,7 @@ function cabal_abi_test() {
pushd $DIR
echo $PWD
- start_section "Cabal test: $OUT"
+ start_section cabal-abi-test "Cabal ABI test: $OUT"
mkdir -p "$OUT"
"$HC" \
-hidir tmp -odir tmp -fforce-recomp -haddock \
@@ -752,7 +762,7 @@ function cabal_abi_test() {
summarise_hi_files
summarise_o_files
popd
- end_section "Cabal test: $OUT"
+ end_section cabal-abi-test
}
function cabal_test() {
@@ -760,7 +770,7 @@ function cabal_test() {
fail "OUT not set"
fi
- start_section "Cabal test: $OUT"
+ start_section cabal-test "Cabal test: $OUT"
mkdir -p "$OUT"
run "$HC" \
-hidir tmp -odir tmp -fforce-recomp \
@@ -769,7 +779,7 @@ function cabal_test() {
-ilibraries/Cabal/Cabal/src -XNoPolyKinds Distribution.Simple \
"$@" 2>&1 | tee $OUT/log
rm -Rf tmp
- end_section "Cabal test: $OUT"
+ end_section cabal-test
}
function run_perf_test() {
=====================================
.gitlab/common.sh
=====================================
@@ -20,15 +20,18 @@ WHITE="1;37"
LT_GRAY="0;37"
# GitLab Pipelines log section delimiters
-# https://gitlab.com/gitlab-org/gitlab-foss/issues/14664
-start_section() {
- name="$1"
- echo -e "section_start:$(date +%s):$name\015\033[0K"
+# https://docs.gitlab.com/ci/jobs/job_logs/#custom-collapsible-sections
+function start_section () {
+ local section_title="${1}"
+ local section_description="${2:-$section_title}"
+
+ echo -e "section_start:$(date +%s):${section_title}[collapsed=true]\r\e[0K${section_description}"
}
-end_section() {
- name="$1"
- echo -e "section_end:$(date +%s):$name\015\033[0K"
+function end_section () {
+ local section_title="${1}"
+
+ echo -e "section_end:$(date +%s):${section_title}\r\e[0K"
}
echo_color() {
=====================================
.gitlab/generate-ci/gen_ci.hs
=====================================
@@ -870,7 +870,7 @@ job arch opsys buildConfig = NamedJob { name = jobName, jobInfo = Job {..} }
[ ".gitlab/ci.sh save_cache"
, ".gitlab/ci.sh save_test_output"
, ".gitlab/ci.sh clean"
- , "cat ci_timings"
+ , "cat ci_timings.txt"
]
jobFlavour = mkJobFlavour buildConfig
=====================================
.gitlab/jobs.yaml
=====================================
@@ -5,7 +5,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -71,7 +71,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -134,7 +134,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -196,7 +196,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -258,7 +258,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -482,7 +482,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": true,
"artifacts": {
@@ -545,7 +545,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -607,7 +607,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -669,7 +669,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -736,7 +736,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -800,7 +800,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -863,7 +863,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -926,7 +926,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -1153,7 +1153,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": true,
"artifacts": {
@@ -1217,7 +1217,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -1280,7 +1280,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -1343,7 +1343,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -1413,7 +1413,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -1479,7 +1479,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": true,
"artifacts": {
@@ -1543,7 +1543,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -1607,7 +1607,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -1671,7 +1671,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -1735,7 +1735,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -1800,7 +1800,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -1865,7 +1865,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -1930,7 +1930,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -1993,7 +1993,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -2056,7 +2056,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -2121,7 +2121,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -2187,7 +2187,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -2250,7 +2250,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -2313,7 +2313,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": true,
"artifacts": {
@@ -2376,7 +2376,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -2440,7 +2440,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -2503,7 +2503,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -2568,7 +2568,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -2631,7 +2631,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -2694,7 +2694,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -2757,7 +2757,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -2820,7 +2820,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": true,
"artifacts": {
@@ -2885,7 +2885,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -2948,7 +2948,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -3011,7 +3011,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -3076,7 +3076,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -3142,7 +3142,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -3207,7 +3207,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -3270,7 +3270,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -3333,7 +3333,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -3396,7 +3396,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -3459,7 +3459,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -3587,7 +3587,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -3776,7 +3776,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -3844,7 +3844,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -3909,7 +3909,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -3973,7 +3973,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -4037,7 +4037,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": true,
"artifacts": {
@@ -4102,7 +4102,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -4166,7 +4166,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -4230,7 +4230,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -4301,7 +4301,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -4368,7 +4368,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": true,
"artifacts": {
@@ -4433,7 +4433,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -4498,7 +4498,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -4563,7 +4563,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -4628,7 +4628,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -4692,7 +4692,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -4756,7 +4756,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -4820,7 +4820,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -4884,7 +4884,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -4948,7 +4948,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -5014,7 +5014,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -5080,7 +5080,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -5147,7 +5147,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -5211,7 +5211,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -5275,7 +5275,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -5339,7 +5339,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -5403,7 +5403,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -5467,7 +5467,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -5659,7 +5659,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -5728,7 +5728,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -5793,7 +5793,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": true,
"artifacts": {
@@ -5856,7 +5856,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -5919,7 +5919,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -5982,7 +5982,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -6045,7 +6045,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -6109,7 +6109,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -6174,7 +6174,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -6239,7 +6239,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -6301,7 +6301,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -6363,7 +6363,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -6427,7 +6427,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -6492,7 +6492,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -6554,7 +6554,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -6616,7 +6616,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -6679,7 +6679,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -6742,7 +6742,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -6804,7 +6804,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -6868,7 +6868,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -6930,7 +6930,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -6992,7 +6992,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -7054,7 +7054,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -7116,7 +7116,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": true,
"artifacts": {
@@ -7181,7 +7181,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -7243,7 +7243,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -7305,7 +7305,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -7369,7 +7369,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -7434,7 +7434,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -7498,7 +7498,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -7560,7 +7560,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -7622,7 +7622,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -7684,7 +7684,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -7746,7 +7746,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
@@ -7872,7 +7872,7 @@
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
".gitlab/ci.sh clean",
- "cat ci_timings"
+ "cat ci_timings.txt"
],
"allow_failure": false,
"artifacts": {
=====================================
compiler/GHC/CmmToAsm/AArch64/CodeGen.hs
=====================================
@@ -928,21 +928,25 @@ getRegister' config plat expr
CmmMachOp (MO_S_Shr w) [x, (CmmLit (CmmInt n _))] | w == W8, 0 <= n, n < 8 -> do
(reg_x, _format_x, code_x) <- getSomeReg x
- return $ Any (intFormat w) (\dst -> code_x `snocOL` annExpr expr (SBFX (OpReg w dst) (OpReg w reg_x) (OpImm (ImmInteger n)) (OpImm (ImmInteger (8-n)))))
+ return $ Any (intFormat w) (\dst -> code_x `snocOL` annExpr expr (SBFX (OpReg w dst) (OpReg w reg_x) (OpImm (ImmInteger n)) (OpImm (ImmInteger (8-n))))
+ `snocOL` (UXTB (OpReg w dst) (OpReg w dst))) -- See Note [Signed arithmetic on AArch64]
CmmMachOp (MO_S_Shr w) [x, y] | w == W8 -> do
(reg_x, _format_x, code_x) <- getSomeReg x
(reg_y, _format_y, code_y) <- getSomeReg y
return $ Any (intFormat w) (\dst -> code_x `appOL` code_y `snocOL` annExpr expr (SXTB (OpReg w reg_x) (OpReg w reg_x)) `snocOL`
- (ASR (OpReg w dst) (OpReg w reg_x) (OpReg w reg_y)))
+ (ASR (OpReg w dst) (OpReg w reg_x) (OpReg w reg_y)) `snocOL`
+ (UXTB (OpReg w dst) (OpReg w dst))) -- See Note [Signed arithmetic on AArch64]
CmmMachOp (MO_S_Shr w) [x, (CmmLit (CmmInt n _))] | w == W16, 0 <= n, n < 16 -> do
(reg_x, _format_x, code_x) <- getSomeReg x
- return $ Any (intFormat w) (\dst -> code_x `snocOL` annExpr expr (SBFX (OpReg w dst) (OpReg w reg_x) (OpImm (ImmInteger n)) (OpImm (ImmInteger (16-n)))))
+ return $ Any (intFormat w) (\dst -> code_x `snocOL` annExpr expr (SBFX (OpReg w dst) (OpReg w reg_x) (OpImm (ImmInteger n)) (OpImm (ImmInteger (16-n))))
+ `snocOL` (UXTH (OpReg w dst) (OpReg w dst))) -- See Note [Signed arithmetic on AArch64]
CmmMachOp (MO_S_Shr w) [x, y] | w == W16 -> do
(reg_x, _format_x, code_x) <- getSomeReg x
(reg_y, _format_y, code_y) <- getSomeReg y
return $ Any (intFormat w) (\dst -> code_x `appOL` code_y `snocOL` annExpr expr (SXTH (OpReg w reg_x) (OpReg w reg_x)) `snocOL`
- (ASR (OpReg w dst) (OpReg w reg_x) (OpReg w reg_y)))
+ (ASR (OpReg w dst) (OpReg w reg_x) (OpReg w reg_y)) `snocOL`
+ (UXTH (OpReg w dst) (OpReg w dst))) -- See Note [Signed arithmetic on AArch64]
CmmMachOp (MO_S_Shr w) [x, (CmmLit (CmmInt n _))]
| w == W32 || w == W64
=====================================
compiler/GHC/CmmToAsm/X86/CodeGen.hs
=====================================
@@ -6067,10 +6067,23 @@ genByteSwap width dst src = do
W64 | is32Bit -> do
let Reg64 dst_hi dst_lo = localReg64 dst
RegCode64 vcode rhi rlo <- iselExpr64 src
- return $ vcode `appOL`
- toOL [ MOV II32 (OpReg rlo) (OpReg dst_hi),
- MOV II32 (OpReg rhi) (OpReg dst_lo),
- BSWAP II32 dst_hi,
+ tmp <- getNewRegNat II32
+ -- Swap the low and high halves of the register.
+ --
+ -- NB: if dst_hi == rhi, we must make sure to preserve the contents
+ -- of rhi before writing to dst_hi (#25601).
+ let shuffle = if dst_hi == rhi && dst_lo == rlo then
+ toOL [ MOV II32 (OpReg rhi) (OpReg tmp),
+ MOV II32 (OpReg rlo) (OpReg dst_hi),
+ MOV II32 (OpReg tmp) (OpReg dst_lo) ]
+ else if dst_hi == rhi then
+ toOL [ MOV II32 (OpReg rhi) (OpReg dst_lo),
+ MOV II32 (OpReg rlo) (OpReg dst_hi) ]
+ else
+ toOL [ MOV II32 (OpReg rlo) (OpReg dst_hi),
+ MOV II32 (OpReg rhi) (OpReg dst_lo) ]
+ return $ vcode `appOL` shuffle `appOL`
+ toOL [ BSWAP II32 dst_hi,
BSWAP II32 dst_lo ]
W16 -> do
let dst_r = getLocalRegReg dst
=====================================
hadrian/src/Settings.hs
=====================================
@@ -35,7 +35,7 @@ getExtraArgs :: Args
getExtraArgs = expr flavour >>= extraArgs
getArgs :: Args
-getArgs = mconcat [ defaultBuilderArgs, getExtraArgs, defaultPackageArgs ]
+getArgs = mconcat [ defaultBuilderArgs, defaultPackageArgs, getExtraArgs ]
getLibraryWays :: Ways
getLibraryWays = expr flavour >>= libraryWays
=====================================
testsuite/tests/cmm/should_run/T25601.hs
=====================================
@@ -0,0 +1,22 @@
+{-# LANGUAGE UnboxedTuples #-}
+{-# LANGUAGE MagicHash #-}
+{-# LANGUAGE ForeignFunctionInterface #-}
+{-# LANGUAGE GHCForeignImportPrim #-}
+{-# LANGUAGE UnliftedFFITypes #-}
+
+import Numeric
+import GHC.Prim
+import GHC.Word
+import GHC.IO
+import GHC.Ptr
+import Data.List
+import qualified Data.ByteString as BS
+
+foreign import prim "test" c_test :: Addr# -> State# RealWorld -> (# State# RealWorld, Word64# #)
+
+main :: IO ()
+main = do
+ let bs = BS.pack $ take 100000 [ fromIntegral i | i <- [(1 :: Int) ..] ]
+ n <- BS.useAsCString bs $ \(Ptr addr) -> IO $ \s ->
+ case c_test addr s of (# s', n #) -> (# s', W64# n #)
+ print $ showHex n ""
=====================================
testsuite/tests/cmm/should_run/T25601.stdout
=====================================
@@ -0,0 +1 @@
+"f3f1ffffffffffff"
=====================================
testsuite/tests/cmm/should_run/T25601a.cmm
=====================================
@@ -0,0 +1,7 @@
+#include "Cmm.h"
+
+test ( W_ buffer ) {
+ bits64 ret;
+ (ret) = prim %bswap64(%neg(%zx64(bits16[buffer + (12 :: W_)])));
+ return (ret);
+}
=====================================
testsuite/tests/cmm/should_run/all.T
=====================================
@@ -47,3 +47,8 @@ test('AtomicFetch',
],
multi_compile_and_run,
['AtomicFetch', [('AtomicFetch_cmm.cmm', '')], ''])
+
+test('T25601',
+ [req_cmm],
+ multi_compile_and_run,
+ ['T25601', [('T25601a.cmm', '')], ''])
=====================================
testsuite/tests/codeGen/should_run/T26061.hs
=====================================
@@ -0,0 +1,41 @@
+{-# LANGUAGE MagicHash #-}
+{-# LANGUAGE ExtendedLiterals #-}
+import GHC.Word
+import GHC.Exts
+
+f :: Int16# -> Word16#
+f x = let !w = int16ToWord16# (x `uncheckedShiftRAInt16#` 1#)
+ in w `remWord16#` 13#Word16
+{-# NOINLINE f #-}
+
+g :: Int8# -> Word8#
+g x = let !w = int8ToWord8# (x `uncheckedShiftRAInt8#` 1#)
+ in w `remWord8#` 19#Word8
+{-# NOINLINE g #-}
+
+h :: Int16# -> Int# -> Word16#
+h x y = let !w = int16ToWord16# (x `uncheckedShiftRAInt16#` y)
+ in w `remWord16#` 13#Word16
+{-# NOINLINE h #-}
+
+i :: Int8# -> Int# -> Word8#
+i x y = let !w = int8ToWord8# (x `uncheckedShiftRAInt8#` y)
+ in w `remWord8#` 19#Word8
+{-# NOINLINE i #-}
+
+main :: IO ()
+main = do
+ print (W16# (f (-100#Int16)))
+ print (W8# (g (-100#Int8)))
+ print (W16# (h (-100#Int16) 1#))
+ print (W8# (i (-100#Int8) 1#))
+
+-- int16ToWord16 (-100 `shiftR` 1) `rem` 13
+-- = int16ToWord16 (-50) `rem` 13
+-- = 65486 `rem` 13
+-- = 5
+
+-- int8ToWord8 (-100 `shiftR` 1) `rem` 19
+-- = int8ToWord8 (-50) `rem` 19
+-- = 206 `rem` 19
+-- = 16
=====================================
testsuite/tests/codeGen/should_run/T26061.stdout
=====================================
@@ -0,0 +1,4 @@
+5
+16
+5
+16
=====================================
testsuite/tests/codeGen/should_run/all.T
=====================================
@@ -255,3 +255,4 @@ test('T24893', normal, compile_and_run, ['-O'])
test('CCallConv', [req_c], compile_and_run, ['CCallConv_c.c'])
test('T25364', normal, compile_and_run, [''])
+test('T26061', normal, compile_and_run, [''])
=====================================
utils/haddock/haddock-library/src/Documentation/Haddock/Parser.hs
=====================================
@@ -1,3 +1,4 @@
+{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ViewPatterns #-}
@@ -28,6 +29,7 @@ import Control.Applicative
import Control.Arrow (first)
import Control.Monad
import Data.Char (chr, isAlpha, isSpace, isUpper)
+import Data.Functor (($>))
import Data.List (elemIndex, intercalate, intersperse, unfoldr)
import Data.Maybe (fromMaybe, mapMaybe)
import Data.Monoid
@@ -186,11 +188,29 @@ specialChar = "_/<@\"&'`#[ "
-- to ensure that we have already given a chance to more meaningful parsers
-- before capturing their characters.
string' :: Parser (DocH mod a)
-string' = DocString . unescape . T.unpack <$> takeWhile1_ (`notElem` specialChar)
+string' =
+ DocString
+ <$> ((:) <$> rawOrEscChar "" <*> many (rawOrEscChar "(["))
+ -- After the first character, stop for @\(@ or @\[@ math starters. (The
+ -- first character won't start a valid math string because this parser
+ -- should follow math parsers. But this parser is expected to accept at
+ -- least one character from all inputs that don't start with special
+ -- characters, so the first character parser can't have the @"(["@
+ -- restriction.)
where
- unescape "" = ""
- unescape ('\\' : x : xs) = x : unescape xs
- unescape (x : xs) = x : unescape xs
+ -- | Parse a single logical character, either raw or escaped. Don't accept
+ -- escaped characters from the argument string.
+ rawOrEscChar :: [Char] -> Parser Char
+ rawOrEscChar restrictedEscapes = try $ Parsec.noneOf specialChar >>= \case
+ -- Handle backslashes:
+ -- - Fail on forbidden escape characters.
+ -- - Non-forbidden characters: simply unescape, e.g. parse "\b" as 'b',
+ -- - Trailing backslash: treat it as a raw backslash, not an escape
+ -- sequence. (This is the logic that this parser followed when this
+ -- comment was written; it is not necessarily intentional but now I
+ -- don't want to break anything relying on it.)
+ '\\' -> Parsec.noneOf restrictedEscapes <|> Parsec.eof $> '\\'
+ c -> pure c
-- | Skips a single special character and treats it as a plain string.
-- This is done to skip over any special characters belonging to other
=====================================
utils/haddock/haddock-library/test/Documentation/Haddock/ParserSpec.hs
=====================================
@@ -284,6 +284,13 @@ spec = do
it "supports title for deprecated picture syntax" $ do
"<<b a z>>" `shouldParseTo` image "b" "a z"
+ context "when parsing inline math" $ do
+ it "accepts inline math immediately after punctuation" $ do
+ "(\\(1 + 2 = 3\\) is an example of addition)"
+ `shouldParseTo` "("
+ <> DocMathInline "1 + 2 = 3"
+ <> " is an example of addition)"
+
context "when parsing display math" $ do
it "accepts markdown syntax for display math containing newlines" $ do
"\\[\\pi\n\\pi\\]" `shouldParseTo` DocMathDisplay "\\pi\n\\pi"
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/d99c423041d31e080d2102c271dd56…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/d99c423041d31e080d2102c271dd56…
You're receiving this email because of your account on gitlab.haskell.org.
1
0