summaryrefslogtreecommitdiff
path: root/testsuite/tests/ghci.debugger/scripts/break022
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/ghci.debugger/scripts/break022')
-rw-r--r--testsuite/tests/ghci.debugger/scripts/break022/A1.hs4
-rw-r--r--testsuite/tests/ghci.debugger/scripts/break022/B.hs5
-rw-r--r--testsuite/tests/ghci.debugger/scripts/break022/B.hs-boot3
-rw-r--r--testsuite/tests/ghci.debugger/scripts/break022/C.hs5
-rw-r--r--testsuite/tests/ghci.debugger/scripts/break022/Makefile3
-rw-r--r--testsuite/tests/ghci.debugger/scripts/break022/all.T4
-rw-r--r--testsuite/tests/ghci.debugger/scripts/break022/break022.script21
-rw-r--r--testsuite/tests/ghci.debugger/scripts/break022/break022.stdout8
8 files changed, 53 insertions, 0 deletions
diff --git a/testsuite/tests/ghci.debugger/scripts/break022/A1.hs b/testsuite/tests/ghci.debugger/scripts/break022/A1.hs
new file mode 100644
index 0000000000..bf903ab11e
--- /dev/null
+++ b/testsuite/tests/ghci.debugger/scripts/break022/A1.hs
@@ -0,0 +1,4 @@
+module A where
+import {-# SOURCE #-} B
+
+a x = b x \ No newline at end of file
diff --git a/testsuite/tests/ghci.debugger/scripts/break022/B.hs b/testsuite/tests/ghci.debugger/scripts/break022/B.hs
new file mode 100644
index 0000000000..cfc9682cbd
--- /dev/null
+++ b/testsuite/tests/ghci.debugger/scripts/break022/B.hs
@@ -0,0 +1,5 @@
+module B where
+
+import A
+
+b x = x \ No newline at end of file
diff --git a/testsuite/tests/ghci.debugger/scripts/break022/B.hs-boot b/testsuite/tests/ghci.debugger/scripts/break022/B.hs-boot
new file mode 100644
index 0000000000..8e73321e9f
--- /dev/null
+++ b/testsuite/tests/ghci.debugger/scripts/break022/B.hs-boot
@@ -0,0 +1,3 @@
+module B where
+
+b :: a -> a \ No newline at end of file
diff --git a/testsuite/tests/ghci.debugger/scripts/break022/C.hs b/testsuite/tests/ghci.debugger/scripts/break022/C.hs
new file mode 100644
index 0000000000..0dd15af7e7
--- /dev/null
+++ b/testsuite/tests/ghci.debugger/scripts/break022/C.hs
@@ -0,0 +1,5 @@
+module C where
+
+import A
+import B
+
diff --git a/testsuite/tests/ghci.debugger/scripts/break022/Makefile b/testsuite/tests/ghci.debugger/scripts/break022/Makefile
new file mode 100644
index 0000000000..1c39d1c1fe
--- /dev/null
+++ b/testsuite/tests/ghci.debugger/scripts/break022/Makefile
@@ -0,0 +1,3 @@
+TOP=../../../..
+include $(TOP)/mk/boilerplate.mk
+include $(TOP)/mk/test.mk
diff --git a/testsuite/tests/ghci.debugger/scripts/break022/all.T b/testsuite/tests/ghci.debugger/scripts/break022/all.T
new file mode 100644
index 0000000000..497ad7e417
--- /dev/null
+++ b/testsuite/tests/ghci.debugger/scripts/break022/all.T
@@ -0,0 +1,4 @@
+setTestOpts(extra_run_opts('-ignore-dot-ghci'))
+setTestOpts(when(compiler_profiled(), skip))
+
+test('break022', extra_clean(['A.hs']), ghci_script, ['break022.script'])
diff --git a/testsuite/tests/ghci.debugger/scripts/break022/break022.script b/testsuite/tests/ghci.debugger/scripts/break022/break022.script
new file mode 100644
index 0000000000..15e505ff71
--- /dev/null
+++ b/testsuite/tests/ghci.debugger/scripts/break022/break022.script
@@ -0,0 +1,21 @@
+
+-- We have this structure of modules:
+
+-- A (imports B.boot)
+-- B (imports A)
+-- B.boot (imports A)
+-- C (imports A and B)
+
+-- And we load C, to debug some function in A which enters B.
+-- But first we touch A, and reload. B.boot will be reloaded, but not B, which will end up with an empty modbreaks. When we :step into B, ghci will die with an out of bounds access in B's break array.
+-- The effect we want is B.boot being reloaded while B is not.
+
+:! cp A1.hs A.hs
+:l C
+:! touch A.hs
+:r
+:break a
+a ()
+:st
+:st
+:st -- here we step into B, and produce the exception \ No newline at end of file
diff --git a/testsuite/tests/ghci.debugger/scripts/break022/break022.stdout b/testsuite/tests/ghci.debugger/scripts/break022/break022.stdout
new file mode 100644
index 0000000000..99ac58dec2
--- /dev/null
+++ b/testsuite/tests/ghci.debugger/scripts/break022/break022.stdout
@@ -0,0 +1,8 @@
+Breakpoint 0 activated at A.hs:4:1-9
+Stopped at A.hs:4:1-9
+_result :: a1 = _
+Stopped at A.hs:4:7-9
+_result :: () = _
+x :: () = ()
+Stopped at B.hs:5:1-7
+_result :: t = _