summaryrefslogtreecommitdiff
path: root/testsuite/tests/ghci/should_run
diff options
context:
space:
mode:
authorRoland Senn <rsx@bluewin.ch>2018-12-07 23:22:40 -0500
committerBen Gamari <ben@smart-cactus.org>2018-12-07 23:22:50 -0500
commit57c9b1ae4cafd0ee763451f2d4bc10220eef9689 (patch)
tree722f03f041237dd4664c724a516fa3222fcadebb /testsuite/tests/ghci/should_run
parentc5ced679a6f5421eb53acf1fd1d212088145c971 (diff)
downloadhaskell-57c9b1ae4cafd0ee763451f2d4bc10220eef9689.tar.gz
Fix #15369: GHCi doesn't honor :set +c when loading for a second time
The decision to (re)collect the type info for a (re)loaded module is now taken only by comparing the file timestamps of the .hs file of the module. (Or form the .o file if the .hs file is missing). If the file timestamp changes, we (re)collect the type info. The timestamp of the processing time of the last collect is no longer used. Test Plan: make test TEST=T15369 Reviewers: alanz, hvr, monoidal, osa1, thomie, bgamari, tdammers Reviewed By: tdammers Subscribers: rwbarton, carter GHC Trac Issues: #15369 Differential Revision: https://phabricator.haskell.org/D5376
Diffstat (limited to 'testsuite/tests/ghci/should_run')
-rw-r--r--testsuite/tests/ghci/should_run/T15369.hs3
-rw-r--r--testsuite/tests/ghci/should_run/T15369.script13
-rw-r--r--testsuite/tests/ghci/should_run/T15369.stdout8
-rw-r--r--testsuite/tests/ghci/should_run/all.T1
4 files changed, 25 insertions, 0 deletions
diff --git a/testsuite/tests/ghci/should_run/T15369.hs b/testsuite/tests/ghci/should_run/T15369.hs
new file mode 100644
index 0000000000..53779999bd
--- /dev/null
+++ b/testsuite/tests/ghci/should_run/T15369.hs
@@ -0,0 +1,3 @@
+module T15369 where
+x :: Int
+x = 1
diff --git a/testsuite/tests/ghci/should_run/T15369.script b/testsuite/tests/ghci/should_run/T15369.script
new file mode 100644
index 0000000000..5232c6aadc
--- /dev/null
+++ b/testsuite/tests/ghci/should_run/T15369.script
@@ -0,0 +1,13 @@
+-- create an .o file
+:set -fobject-code
+:l T15369.hs
+:set -fbyte-code
+-- start the test
+:set +c
+:l *T15369.hs
+:all-types
+:l *T15369.hs
+:all-types
+:! sed -i 's/Int/Double/g' T15369.hs
+:l *T15369.hs
+:all-types
diff --git a/testsuite/tests/ghci/should_run/T15369.stdout b/testsuite/tests/ghci/should_run/T15369.stdout
new file mode 100644
index 0000000000..0bb004c24a
--- /dev/null
+++ b/testsuite/tests/ghci/should_run/T15369.stdout
@@ -0,0 +1,8 @@
+Collecting type info for 1 module(s) ...
+T15369.hs:(3,1)-(3,2): GHC.Types.Int
+T15369.hs:(3,5)-(3,6): GHC.Types.Int
+T15369.hs:(3,1)-(3,2): GHC.Types.Int
+T15369.hs:(3,5)-(3,6): GHC.Types.Int
+Collecting type info for 1 module(s) ...
+T15369.hs:(3,1)-(3,2): GHC.Types.Double
+T15369.hs:(3,5)-(3,6): GHC.Types.Double
diff --git a/testsuite/tests/ghci/should_run/all.T b/testsuite/tests/ghci/should_run/all.T
index aa6aab3622..ea734e74aa 100644
--- a/testsuite/tests/ghci/should_run/all.T
+++ b/testsuite/tests/ghci/should_run/all.T
@@ -37,6 +37,7 @@ test('T14963b', just_ghci, ghci_script, ['T14963b.script'])
test('T14963c', [extra_hc_opts("-fdefer-type-errors")], ghci_script, ['T14963c.script'])
test('T15007', just_ghci, ghci_script, ['T15007.script'])
test('T15806', just_ghci, ghci_script, ['T15806.script'])
+test('T15369', just_ghci, ghci_script, ['T15369.script'])
test('T15633a',
[extra_files(['tc-plugin-ghci/']),