[project @ 2001-03-01 15:36:20 by simonmar]
[ghc-hetmet.git] / ghc / tests / ghci / prog002 / prog002.script
diff --git a/ghc/tests/ghci/prog002/prog002.script b/ghc/tests/ghci/prog002/prog002.script
new file mode 100644 (file)
index 0000000..f81eea6
--- /dev/null
@@ -0,0 +1,39 @@
+-- first, clean up:
+:! rm -f *.hi *.o *~
+:unset +s
+:! cp A1.hs A.hs
+
+:load D
+
+-- compile A & reload
+:! $HC $HC_OPTS -no-recomp -c A.hs
+:reload
+
+B.g 42
+B.g 42
+B.g 42
+
+-- swap A2 for A, compile & reload
+:! cp A2.hs A.hs
+:! $HC $HC_OPTS -no-recomp -c A.hs
+:reload
+-- the system should ignore the compiled version and compile its own.
+
+B.g 42
+B.g 42
+B.g 42
+
+-- pick up newly compiled A
+:load D
+
+B.g 42
+B.g 42
+B.g 42
+
+-- remove A.o: system should recompile A
+:! rm A.o
+:reload
+
+B.g 42
+B.g 42
+B.g 42