Commit 7f02e7f6 authored by Simon Marlow's avatar Simon Marlow

add test for a bug in 6.8.2's handling of orphan modules

parent b6c88428
module A where
f :: Int -> Int
f x = x + 1
module B where
g :: Int -> Int
g x = x * 2
{-# -XRankNTypes #-}
module C (f, g) where
import A
import B
{-# LANGUAGE RankNTypes #-}
module C (f, g) where
import A
import B
{-# RULES "f/g" forall x . f (g x) = x #-}
module D () where
import C () -- so we don't get a dependency on C's export list
module E where
import D -- get the RULE from C via D
import A
import B
z = f (g 3)
TOP=../../../..
include $(TOP)/mk/boilerplate.mk
include $(TOP)/mk/test.mk
clean:
@rm -f *.o*
@rm -f *.hi*
@rm -f C.hs
recomp005: clean
cp C1.hs C.hs
$(TEST_HC) --make E.hs -O
@sleep 1
cp C2.hs C.hs
# Should recompile E, because C is now an orphan
$(TEST_HC) --make E.hs -O
test('recomp005', skip_if_fast, run_command, ['$MAKE -s --no-print-directory recomp005'])
if default_testopts.cleanup != '':
runCmd('$MAKE -C ' + in_testdir('') + ' clean')
[1 of 5] Compiling B ( B.hs, B.o )
[2 of 5] Compiling A ( A.hs, A.o )
[3 of 5] Compiling C ( C.hs, C.o )
[4 of 5] Compiling D ( D.hs, D.o )
[5 of 5] Compiling E ( E.hs, E.o )
[3 of 5] Compiling C ( C.hs, C.o )
[4 of 5] Compiling D ( D.hs, D.o )
[5 of 5] Compiling E ( E.hs, E.o )
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment