Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions test/golden/T239/Main.hs
Original file line number Diff line number Diff line change
@@ -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
13 changes: 13 additions & 0 deletions test/golden/T239/T239.ghc-914.hdb-stdout
Original file line number Diff line number Diff line change
@@ -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 ( <TEMPORARY-DIRECTORY>/Main.hs, interpreted )[main]
(hdb) BreakFound {changed = True, breakId = [InternalBreakpointId Main 2], sourceSpan = SourceSpan {file = "<TEMPORARY-DIRECTORY>/Main.hs", startLine = 26, endLine = 26, startCol = 3, endCol = 28}}
(hdb) Stopped at breakpoint
(hdb) _result : IO () = _
*** Ignoring breakpoint [<TEMPORARY-DIRECTORY>/Main.hs:26:3-27]
_result : IO () = _
container : Container = Container
containerBefore : Int = 10
containerPacked : Packed = Packed
containerPacked2 : Packed = Packed
containerAfter : Int = 40
(hdb)
4 changes: 4 additions & 0 deletions test/golden/T239/T239.hdb-stdin
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
break Main.hs 27
run
variables
exit
1 change: 1 addition & 0 deletions test/golden/T239/T239.hdb-test
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
$HDB Main.hs -v 0 < T239.hdb-stdin
Loading