9ef5845675ef6c36c71b3a50e060c84565697d0c
[ghc-hetmet.git] / ghc / tests / ghci / prog003 / prog003.script
1 :unset +s
2 :unset +t
3 -- A small multi-module program, with 4 modules, Main, B, C, D.  B & C
4 -- depend on D, and A depends on B & C.
5 -- 
6 -- This test will try various combinations of compiled and interpreted
7 -- versions of each module, and make sure each combination behaves
8 -- sensibly.
9
10 -- clean up
11 :! rm *.o *.hi
12 :! cp D1.hs D.hs
13
14 :load A
15 :type a
16 a 42
17
18 -- sigh; sleep 1, because the filesystem only stores times in seconds
19 :! sleep 1; cp D2.hs D.hs
20 :reload
21 :type (Main.a,B.b,C.c,D.d)
22 a 42
23
24 -- compile D, check that :reload doesn't pick it up
25 :! $HC $HC_OPTS -c D.hs
26 :reload
27 :type (Main.a,B.b,C.c,D.d)
28 a 42
29
30 -- pick up the compiled D now, with :load
31 :load A
32 :type (Main.a,B.b,C.c,D.d)
33 a 42
34
35 -- D,C compiled
36 :! $HC $HC_OPTS -c C.hs
37 :load A
38 :type (Main.a,B.b,C.c,D.d)
39 a 42
40
41 -- D,C,B compiled
42 :! $HC $HC_OPTS -c B.hs
43 :load A
44 :type (Main.a,B.b,C.c,D.d)
45 a 42
46
47 -- D,C,B,A compiled
48 :! $HC $HC_OPTS -c A.hs
49 :load A
50 :type (Main.a,B.b,C.c,D.d)
51 a 42
52
53 -- D,C,A compiled  (better not use A.o)
54 :! rm B.o
55 :load A
56 :type (Main.a,B.b,C.c,D.d)
57 a 42
58
59 -- D,A compiled  (better not use A.o)
60 :! rm C.o
61 :load A
62 :type (Main.a,B.b,C.c,D.d)
63 a 42
64
65 -- A compiled  (better not use A.o)
66 :! rm D.o
67 :load A
68 :type (Main.a,B.b,C.c,D.d)
69 a 42
70
71 -- A,B,C compiled (better not use A.o, B.o, C.o)
72 :! $HC $HC_OPTS --make A
73 :! rm D.o
74 :load A
75 :type (Main.a,B.b,C.c,D.d)
76 a 42