diff --git a/test/golden/T239/Main.hs b/test/golden/T239/Main.hs new file mode 100644 index 0000000..c79b852 --- /dev/null +++ b/test/golden/T239/Main.hs @@ -0,0 +1,28 @@ +{-# OPTIONS_GHC -O -fno-unoptimized-core-for-interpreter #-} +{-# LANGUAGE BangPatterns #-} + +module Main where + +data Packed = Packed -- Unpacking only happens with optimizations, hence the -O. + { packedLeft :: {-# UNPACK #-} !Char + , packedRight :: {-# UNPACK #-} !Char + } + deriving Show + +data Container = Container + { containerBefore :: Int + , containerPacked :: {-# UNPACK #-} !Packed + , containerPacked2 :: {-# UNPACK #-} !Packed + , containerAfter :: Int + } + deriving Show + +mkContainer :: Container +mkContainer = Container 10 (Packed 'a' 'b') (Packed 'c' 'd') 40 +{-# OPAQUE mkContainer #-} + +main :: IO () +main = do + let !container = mkContainer + const (pure ()) container + print container diff --git a/test/golden/T239/T239.ghc-914.hdb-stdout b/test/golden/T239/T239.ghc-914.hdb-stdout new file mode 100644 index 0000000..041b373 --- /dev/null +++ b/test/golden/T239/T239.ghc-914.hdb-stdout @@ -0,0 +1,13 @@ +[1 of 3] Compiling GHC.Debugger.View.Class ( in-memory:GHC.Debugger.View.Class, interpreted )[haskell-debugger-view-in-memory] +[2 of 3] Compiling Main ( /Main.hs, interpreted )[main] +(hdb) BreakFound {changed = True, breakId = [InternalBreakpointId Main 2], sourceSpan = SourceSpan {file = "/Main.hs", startLine = 26, endLine = 26, startCol = 3, endCol = 28}} +(hdb) Stopped at breakpoint +(hdb) _result : IO () = _ +*** Ignoring breakpoint [/Main.hs:26:3-27] + _result : IO () = _ +container : Container = Container + containerBefore : Int = 10 + containerPacked : Packed = Packed + containerPacked2 : Packed = Packed + containerAfter : Int = 40 +(hdb) diff --git a/test/golden/T239/T239.hdb-stdin b/test/golden/T239/T239.hdb-stdin new file mode 100644 index 0000000..29e60c2 --- /dev/null +++ b/test/golden/T239/T239.hdb-stdin @@ -0,0 +1,4 @@ +break Main.hs 27 +run +variables +exit diff --git a/test/golden/T239/T239.hdb-test b/test/golden/T239/T239.hdb-test new file mode 100644 index 0000000..bd7f6c3 --- /dev/null +++ b/test/golden/T239/T239.hdb-test @@ -0,0 +1 @@ +$HDB Main.hs -v 0 < T239.hdb-stdin