Commit a26bf928 authored by ian@well-typed.com's avatar ian@well-typed.com

Just moving some tests aroudn to make it easier to see what's going on

parent 7b78543b
......@@ -2,45 +2,8 @@ TOP=../../..
include $(TOP)/mk/boilerplate.mk
include $(TOP)/mk/test.mk
TEST_HC_OPTS_DYN = -dynamic -hisuf dyn_hi -osuf dyn_o
.PHONY: dynamicToo001
# -dynamic-too should notice that the interface files for B don't match,
# and so compile the dyn way separately. This means that the right value
# of B.b should get inlined.
dynamicToo001:
"$(TEST_HC)" $(TEST_HC_OPTS) -O -c A001.hs
"$(TEST_HC)" $(TEST_HC_OPTS) $(TEST_HC_OPTS_DYN) -O -c A001.hs
cp B001_1.hs B001.hs
"$(TEST_HC)" $(TEST_HC_OPTS) -O -c B001.hs
cp B001_2.hs B001.hs
"$(TEST_HC)" $(TEST_HC_OPTS) $(TEST_HC_OPTS_DYN) -O -c B001.hs
"$(TEST_HC)" $(TEST_HC_OPTS) -O -c C001.hs -dynamic-too
"$(TEST_HC)" $(TEST_HC_OPTS) A001.o B001.o C001.o -o s001
"$(TEST_HC)" $(TEST_HC_OPTS) A001.dyn_o B001.dyn_o C001.dyn_o -o d001
./s001
./d001
checkExists = [ -f $1 ] || echo $1 missing
.PHONY: dynamicToo002
# Check that "--make -dynamic-too" works
dynamicToo002:
"$(TEST_HC)" $(TEST_HC_OPTS) -dynamic-too -v0 --make C002
$(call checkExists,A002.o)
$(call checkExists,B002.o)
$(call checkExists,C002.o)
$(call checkExists,A002.hi)
$(call checkExists,B002.hi)
$(call checkExists,C002.hi)
$(call checkExists,A002.dyn_o)
$(call checkExists,B002.dyn_o)
$(call checkExists,C002.dyn_o)
$(call checkExists,A002.dyn_hi)
$(call checkExists,B002.dyn_hi)
$(call checkExists,C002.dyn_hi)
.PHONY: dynamicToo003
# Check that "-c -dynamic-too" works
dynamicToo003:
......
setTestOpts(only_compiler_types(['ghc']))
test('dynamicToo001',
[extra_clean(['A001.o', 'A001.hi', 'A001.dyn_o', 'A001.dyn_hi',
'B001.o', 'B001.hi', 'B001.dyn_o', 'B001.dyn_hi',
'C001.o', 'C001.hi', 'C001.dyn_o', 'C001.dyn_hi',
's001', 'd001']),
when(opsys('mingw32'), expect_broken(7665)),
unless(have_vanilla(), skip),
unless(have_dynamic(), skip)],
run_command,
['$MAKE -s --no-print-directory dynamicToo001'])
test('dynamicToo002',
[extra_clean(['A002.o', 'A002.hi', 'A002.dyn_o', 'A002.dyn_hi',
'B002.o', 'B002.hi', 'B002.dyn_o', 'B002.dyn_hi',
'C002.o', 'C002.hi', 'C002.dyn_o', 'C002.dyn_hi']),
unless(have_vanilla(), skip),
unless(have_dynamic(), skip)],
run_command,
['$MAKE -s --no-print-directory dynamicToo002'])
test('dynamicToo003',
[extra_clean(['A003.o', 'A003.hi', 'A003.dyn_o', 'A003.dyn_hi']),
only_compiler_types(['ghc']),
unless(have_vanilla(), skip),
unless(have_dynamic(), skip)],
run_command,
......
module Main where
import A001
import B001
import A
import B
main = do print a
print b
......
TOP=../../../..
include $(TOP)/mk/boilerplate.mk
include $(TOP)/mk/test.mk
TEST_HC_OPTS_DYN = -dynamic -hisuf dyn_hi -osuf dyn_o
.PHONY: dynamicToo001
# -dynamic-too should notice that the interface files for B don't match,
# and so compile the dyn way separately. This means that the right value
# of B.b should get inlined.
dynamicToo001:
"$(TEST_HC)" $(TEST_HC_OPTS) -O -c A.hs
"$(TEST_HC)" $(TEST_HC_OPTS) $(TEST_HC_OPTS_DYN) -O -c A.hs
cp B1.hs B.hs
"$(TEST_HC)" $(TEST_HC_OPTS) -O -c B.hs
cp B2.hs B.hs
"$(TEST_HC)" $(TEST_HC_OPTS) $(TEST_HC_OPTS_DYN) -O -c B.hs
"$(TEST_HC)" $(TEST_HC_OPTS) -O -c C.hs -dynamic-too
"$(TEST_HC)" $(TEST_HC_OPTS) A.o B.o C.o -o s
"$(TEST_HC)" $(TEST_HC_OPTS) A.dyn_o B.dyn_o C.dyn_o -o d
./s
./d
test('dynamicToo001',
[extra_clean(['A.o', 'A.hi', 'A.dyn_o', 'A.dyn_hi',
'B.o', 'B.hi', 'B.dyn_o', 'B.dyn_hi',
'C.o', 'C.hi', 'C.dyn_o', 'C.dyn_hi',
's', 's.exe', 'd', 'd.exe']),
only_compiler_types(['ghc']),
when(opsys('mingw32'), expect_broken(7665)),
unless(have_vanilla(), skip),
unless(have_dynamic(), skip)],
run_command,
['$MAKE -s --no-print-directory dynamicToo001'])
module C002 where
module C where
import A002
import B002
import A
import B
ab :: String
ab = [a, b]
......
TOP=../../../..
include $(TOP)/mk/boilerplate.mk
include $(TOP)/mk/test.mk
checkExists = [ -f $1 ] || echo $1 missing
.PHONY: dynamicToo002
# Check that "--make -dynamic-too" works
dynamicToo002:
"$(TEST_HC)" $(TEST_HC_OPTS) -dynamic-too -v0 --make C
$(call checkExists,A.o)
$(call checkExists,B.o)
$(call checkExists,C.o)
$(call checkExists,A.hi)
$(call checkExists,B.hi)
$(call checkExists,C.hi)
$(call checkExists,A.dyn_o)
$(call checkExists,B.dyn_o)
$(call checkExists,C.dyn_o)
$(call checkExists,A.dyn_hi)
$(call checkExists,B.dyn_hi)
$(call checkExists,C.dyn_hi)
test('dynamicToo002',
[extra_clean(['A.o', 'A.hi', 'A.dyn_o', 'A.dyn_hi',
'B.o', 'B.hi', 'B.dyn_o', 'B.dyn_hi',
'C.o', 'C.hi', 'C.dyn_o', 'C.dyn_hi']),
only_compiler_types(['ghc']),
unless(have_vanilla(), skip),
unless(have_dynamic(), skip)],
run_command,
['$MAKE -s --no-print-directory dynamicToo002'])
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