diff options
author | Ian Lynagh <ian@well-typed.com> | 2013-06-20 22:15:38 +0100 |
---|---|---|
committer | Ian Lynagh <ian@well-typed.com> | 2013-06-20 22:15:38 +0100 |
commit | a26bf928d274f57c7c0c95df23c769244e90633e (patch) | |
tree | c6a1f810eb954792a4499813caf21e804c95d658 /testsuite/tests/driver/dynamicToo | |
parent | 7b78543b047b34a273f7afc928ed12feeeca17b8 (diff) | |
download | haskell-a26bf928d274f57c7c0c95df23c769244e90633e.tar.gz |
Just moving some tests aroudn to make it easier to see what's going on
Diffstat (limited to 'testsuite/tests/driver/dynamicToo')
16 files changed, 88 insertions, 75 deletions
diff --git a/testsuite/tests/driver/dynamicToo/C002.hs b/testsuite/tests/driver/dynamicToo/C002.hs deleted file mode 100644 index 472546f9b4..0000000000 --- a/testsuite/tests/driver/dynamicToo/C002.hs +++ /dev/null @@ -1,9 +0,0 @@ - -module C002 where - -import A002 -import B002 - -ab :: String -ab = [a, b] - diff --git a/testsuite/tests/driver/dynamicToo/Makefile b/testsuite/tests/driver/dynamicToo/Makefile index 3953b5f6be..b1eab7ef30 100644 --- a/testsuite/tests/driver/dynamicToo/Makefile +++ b/testsuite/tests/driver/dynamicToo/Makefile @@ -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: diff --git a/testsuite/tests/driver/dynamicToo/all.T b/testsuite/tests/driver/dynamicToo/all.T index 5f1d166da8..458747e86a 100644 --- a/testsuite/tests/driver/dynamicToo/all.T +++ b/testsuite/tests/driver/dynamicToo/all.T @@ -1,27 +1,7 @@ -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, diff --git a/testsuite/tests/driver/dynamicToo/A001.hs b/testsuite/tests/driver/dynamicToo/dynamicToo001/A.hs index 073c5fd5f6..f76166afab 100644 --- a/testsuite/tests/driver/dynamicToo/A001.hs +++ b/testsuite/tests/driver/dynamicToo/dynamicToo001/A.hs @@ -1,5 +1,5 @@ -module A001 where +module A where a :: Char a = 'a' diff --git a/testsuite/tests/driver/dynamicToo/B001_2.hs b/testsuite/tests/driver/dynamicToo/dynamicToo001/B.hs index bd06202abe..c5d50d64f1 100644 --- a/testsuite/tests/driver/dynamicToo/B001_2.hs +++ b/testsuite/tests/driver/dynamicToo/dynamicToo001/B.hs @@ -1,5 +1,5 @@ -module B001 where +module B where b :: Char b = 'c' diff --git a/testsuite/tests/driver/dynamicToo/B002.hs b/testsuite/tests/driver/dynamicToo/dynamicToo001/B1.hs index d62c8c200d..cf57282ec1 100644 --- a/testsuite/tests/driver/dynamicToo/B002.hs +++ b/testsuite/tests/driver/dynamicToo/dynamicToo001/B1.hs @@ -1,5 +1,5 @@ -module B002 where +module B where b :: Char b = 'b' diff --git a/testsuite/tests/driver/dynamicToo/B001.hs b/testsuite/tests/driver/dynamicToo/dynamicToo001/B2.hs index bd06202abe..c5d50d64f1 100644 --- a/testsuite/tests/driver/dynamicToo/B001.hs +++ b/testsuite/tests/driver/dynamicToo/dynamicToo001/B2.hs @@ -1,5 +1,5 @@ -module B001 where +module B where b :: Char b = 'c' diff --git a/testsuite/tests/driver/dynamicToo/C001.hs b/testsuite/tests/driver/dynamicToo/dynamicToo001/C.hs index 1adff5fc44..f4c7a5b609 100644 --- a/testsuite/tests/driver/dynamicToo/C001.hs +++ b/testsuite/tests/driver/dynamicToo/dynamicToo001/C.hs @@ -1,8 +1,8 @@ module Main where -import A001 -import B001 +import A +import B main = do print a print b diff --git a/testsuite/tests/driver/dynamicToo/dynamicToo001/Makefile b/testsuite/tests/driver/dynamicToo/dynamicToo001/Makefile new file mode 100644 index 0000000000..30971cf752 --- /dev/null +++ b/testsuite/tests/driver/dynamicToo/dynamicToo001/Makefile @@ -0,0 +1,23 @@ +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 + diff --git a/testsuite/tests/driver/dynamicToo/dynamicToo001.stdout b/testsuite/tests/driver/dynamicToo/dynamicToo001/dynamicToo001.stdout index e7aea0735f..e7aea0735f 100644 --- a/testsuite/tests/driver/dynamicToo/dynamicToo001.stdout +++ b/testsuite/tests/driver/dynamicToo/dynamicToo001/dynamicToo001.stdout diff --git a/testsuite/tests/driver/dynamicToo/dynamicToo001/test.T b/testsuite/tests/driver/dynamicToo/dynamicToo001/test.T new file mode 100644 index 0000000000..2ec58b5118 --- /dev/null +++ b/testsuite/tests/driver/dynamicToo/dynamicToo001/test.T @@ -0,0 +1,13 @@ + +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']) + diff --git a/testsuite/tests/driver/dynamicToo/A002.hs b/testsuite/tests/driver/dynamicToo/dynamicToo002/A.hs index 46db39b409..f76166afab 100644 --- a/testsuite/tests/driver/dynamicToo/A002.hs +++ b/testsuite/tests/driver/dynamicToo/dynamicToo002/A.hs @@ -1,5 +1,5 @@ -module A002 where +module A where a :: Char a = 'a' diff --git a/testsuite/tests/driver/dynamicToo/B001_1.hs b/testsuite/tests/driver/dynamicToo/dynamicToo002/B.hs index 9640f7b783..cf57282ec1 100644 --- a/testsuite/tests/driver/dynamicToo/B001_1.hs +++ b/testsuite/tests/driver/dynamicToo/dynamicToo002/B.hs @@ -1,5 +1,5 @@ -module B001 where +module B where b :: Char b = 'b' diff --git a/testsuite/tests/driver/dynamicToo/dynamicToo002/C.hs b/testsuite/tests/driver/dynamicToo/dynamicToo002/C.hs new file mode 100644 index 0000000000..af00e9d213 --- /dev/null +++ b/testsuite/tests/driver/dynamicToo/dynamicToo002/C.hs @@ -0,0 +1,9 @@ + +module C where + +import A +import B + +ab :: String +ab = [a, b] + diff --git a/testsuite/tests/driver/dynamicToo/dynamicToo002/Makefile b/testsuite/tests/driver/dynamicToo/dynamicToo002/Makefile new file mode 100644 index 0000000000..8705c8787e --- /dev/null +++ b/testsuite/tests/driver/dynamicToo/dynamicToo002/Makefile @@ -0,0 +1,23 @@ +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) + diff --git a/testsuite/tests/driver/dynamicToo/dynamicToo002/test.T b/testsuite/tests/driver/dynamicToo/dynamicToo002/test.T new file mode 100644 index 0000000000..5e2f2f8b2a --- /dev/null +++ b/testsuite/tests/driver/dynamicToo/dynamicToo002/test.T @@ -0,0 +1,11 @@ + +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']) + |