summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/tests/ghci.debugger/scripts/T14628.hs14
-rw-r--r--testsuite/tests/ghci.debugger/scripts/T14628.script4
-rw-r--r--testsuite/tests/ghci.debugger/scripts/T14628.stderr12
-rw-r--r--testsuite/tests/ghci.debugger/scripts/T14628.stdout5
-rw-r--r--testsuite/tests/ghci.debugger/scripts/all.T1
5 files changed, 36 insertions, 0 deletions
diff --git a/testsuite/tests/ghci.debugger/scripts/T14628.hs b/testsuite/tests/ghci.debugger/scripts/T14628.hs
new file mode 100644
index 0000000000..b94d9e736e
--- /dev/null
+++ b/testsuite/tests/ghci.debugger/scripts/T14628.hs
@@ -0,0 +1,14 @@
+module T14628 where
+
+import System.IO
+import Control.Monad.IO.Class
+import Control.Monad.Trans.State
+import Text.Printf
+
+putArrayBytes :: Handle -- ^ output file handle
+ -> [String] -- ^ byte-strings
+ -> IO Int -- ^ total number of bytes written
+putArrayBytes outfile xs = do
+ let writeCount x = modify' (+ length x) >> liftIO (putLine x) :: MonadIO m => StateT Int m ()
+ execStateT (mapM_ writeCount xs) 0
+ where putLine = hPutStrLn outfile . (" "++) . concatMap (printf "0x%02X,")
diff --git a/testsuite/tests/ghci.debugger/scripts/T14628.script b/testsuite/tests/ghci.debugger/scripts/T14628.script
new file mode 100644
index 0000000000..4675b515de
--- /dev/null
+++ b/testsuite/tests/ghci.debugger/scripts/T14628.script
@@ -0,0 +1,4 @@
+:l T14628.hs
+:br 12 46
+:trace putArrayBytes stdout [['1'..'9'],['2'..'8'],['3'..'7']]
+snd $ runStateT _result 0
diff --git a/testsuite/tests/ghci.debugger/scripts/T14628.stderr b/testsuite/tests/ghci.debugger/scripts/T14628.stderr
new file mode 100644
index 0000000000..276d63ff38
--- /dev/null
+++ b/testsuite/tests/ghci.debugger/scripts/T14628.stderr
@@ -0,0 +1,12 @@
+<interactive>:4:7:
+ Couldn't match type ‘m’ with ‘(,) a0’
+ ‘m’ is untouchable
+ inside the constraints: ()
+ bound by the inferred type of it :: ((), Int)
+ at <interactive>:4:1-25
+ ‘m’ is an interactive-debugger skolem
+ Expected type: (a0, ((), Int))
+ Actual type: m ((), Int)
+ In the second argument of ‘($)’, namely ‘runStateT _result 0’
+ In the expression: snd $ runStateT _result 0
+ In an equation for ‘it’: it = snd $ runStateT _result 0
diff --git a/testsuite/tests/ghci.debugger/scripts/T14628.stdout b/testsuite/tests/ghci.debugger/scripts/T14628.stdout
new file mode 100644
index 0000000000..9564271f8f
--- /dev/null
+++ b/testsuite/tests/ghci.debugger/scripts/T14628.stdout
@@ -0,0 +1,5 @@
+Breakpoint 0 activated at T14628.hs:12:46-63
+Stopped in T14628.putArrayBytes.writeCount, T14628.hs:12:46-63
+_result :: StateT Int m () = _
+putLine :: [Char] -> IO () = _
+x :: [Char] = "123456789"
diff --git a/testsuite/tests/ghci.debugger/scripts/all.T b/testsuite/tests/ghci.debugger/scripts/all.T
index 297b4c2b76..01662361c4 100644
--- a/testsuite/tests/ghci.debugger/scripts/all.T
+++ b/testsuite/tests/ghci.debugger/scripts/all.T
@@ -113,6 +113,7 @@ test('T13825-debugger',
[when(arch('powerpc64'), expect_broken(14455)),
when(arch('arm'), fragile_for(17557, ['ghci-ext']))],
ghci_script, ['T13825-debugger.script'])
+test('T14628', normal, ghci_script, ['T14628.script'])
test('T14690', normal, ghci_script, ['T14690.script'])
test('T16700', normal, ghci_script, ['T16700.script'])