summaryrefslogtreecommitdiff
path: root/testsuite/tests/ghci/prog001/prog001.script
blob: f08b8b0155e5e7123ec6fb227c83eb1925fca2fe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
:unset +s

:l shell.hs
:def shell (\s -> do shell s; return "")

-- first, tidy up:
:shell rm -f *.hi *.o *~
:shell cp C1.hs C.hs
:shell cp D1.hs D.hs

-- load the program (all interpreted)
:load A.hs

-- reloading should do nothing
:reload

-- make sure `main' works
main

-- change a module + recompile
:shell echo >> C.hs
:reload

-- make sure `main' still works
main

-- compile D & reload
:shell "$HC" $HC_OPTS $ghciWayFlags -fforce-recomp -c D.hs
:reload
main

-- change D, recompile & reload
:shell cp D2.hs D.hs
:shell "$HC" $HC_OPTS $ghciWayFlags -fforce-recomp -c D.hs
:reload
:load A.hs

-- make sure we're picking up the new D, via B
:module B
g 42