diff options
author | nineonine <mail4chemik@gmail.com> | 2019-07-08 00:09:15 -0700 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2019-07-11 17:48:18 -0400 |
commit | 8449c5b699c3a1a0e363ce75b1f151b38411298f (patch) | |
tree | f2ae57a63098f022abc3465ff87a418cc3ee8746 /testsuite | |
parent | b507acebdc3dbec53c54ae07175b39da4066d4f8 (diff) | |
download | haskell-8449c5b699c3a1a0e363ce75b1f151b38411298f.tar.gz |
Allow reusing temporary object files generated by GHCi by writing to -odir in case -fwrite-interface was specified (#16670)
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/tests/ghci/T16670/Makefile | 24 | ||||
-rw-r--r-- | testsuite/tests/ghci/T16670/T16670_th.hs | 7 | ||||
-rw-r--r-- | testsuite/tests/ghci/T16670/T16670_th.stdout | 2 | ||||
-rw-r--r-- | testsuite/tests/ghci/T16670/T16670_unboxed.hs | 8 | ||||
-rw-r--r-- | testsuite/tests/ghci/T16670/T16670_unboxed.stdout | 2 | ||||
-rw-r--r-- | testsuite/tests/ghci/T16670/TH.hs | 3 | ||||
-rw-r--r-- | testsuite/tests/ghci/T16670/all.T | 7 |
7 files changed, 53 insertions, 0 deletions
diff --git a/testsuite/tests/ghci/T16670/Makefile b/testsuite/tests/ghci/T16670/Makefile new file mode 100644 index 0000000000..586f7e7fe7 --- /dev/null +++ b/testsuite/tests/ghci/T16670/Makefile @@ -0,0 +1,24 @@ +TOP=../../.. +include $(TOP)/mk/boilerplate.mk +include $(TOP)/mk/test.mk + +clean: + $(RM) -rf my-odir + +T16670_unboxed: + @echo "~~~~~~~~ testing T16670_unboxed" + $(MAKE) -s --no-print-directory clean + mkdir my-odir + echo ":load T16670_unboxed.hs" | "$(TEST_HC)" $(TEST_HC_OPTS_INTERACTIVE) \ + -v0 -fwrite-interface -odir my-odir + find . -name T16670_unboxed.o + test -f my-odir/T16670_unboxed.o + +T16670_th: + @echo "~~~~~~~~ testing T16670_th" + $(MAKE) -s --no-print-directory clean + mkdir my-odir + echo ":load T16670_th.hs" | "$(TEST_HC)" $(TEST_HC_OPTS_INTERACTIVE) \ + -v0 -fno-code -fwrite-interface -odir my-odir + find . -name T16670_th.o + test -f my-odir/T16670_th.o diff --git a/testsuite/tests/ghci/T16670/T16670_th.hs b/testsuite/tests/ghci/T16670/T16670_th.hs new file mode 100644 index 0000000000..f21c7991f1 --- /dev/null +++ b/testsuite/tests/ghci/T16670/T16670_th.hs @@ -0,0 +1,7 @@ +{-# LANGUAGE TemplateHaskell #-} + +module T16670_th where + +import TH + +x = $(th) diff --git a/testsuite/tests/ghci/T16670/T16670_th.stdout b/testsuite/tests/ghci/T16670/T16670_th.stdout new file mode 100644 index 0000000000..708b93a384 --- /dev/null +++ b/testsuite/tests/ghci/T16670/T16670_th.stdout @@ -0,0 +1,2 @@ +~~~~~~~~ testing T16670_th +./my-odir/T16670_th.o diff --git a/testsuite/tests/ghci/T16670/T16670_unboxed.hs b/testsuite/tests/ghci/T16670/T16670_unboxed.hs new file mode 100644 index 0000000000..2e903959bb --- /dev/null +++ b/testsuite/tests/ghci/T16670/T16670_unboxed.hs @@ -0,0 +1,8 @@ +{-# LANGUAGE UnboxedTuples #-} +{-# OPTIONS_GHC -fwrite-interface #-} +module T16670_unboxed where + +data UnboxedTupleData = MkUTD (# (),() #) + +doThings :: UnboxedTupleData -> () +doThings (MkUTD t) = () diff --git a/testsuite/tests/ghci/T16670/T16670_unboxed.stdout b/testsuite/tests/ghci/T16670/T16670_unboxed.stdout new file mode 100644 index 0000000000..61c74ca01d --- /dev/null +++ b/testsuite/tests/ghci/T16670/T16670_unboxed.stdout @@ -0,0 +1,2 @@ +~~~~~~~~ testing T16670_unboxed +./my-odir/T16670_unboxed.o diff --git a/testsuite/tests/ghci/T16670/TH.hs b/testsuite/tests/ghci/T16670/TH.hs new file mode 100644 index 0000000000..f288c784f0 --- /dev/null +++ b/testsuite/tests/ghci/T16670/TH.hs @@ -0,0 +1,3 @@ +{-# LANGUAGE TemplateHaskell #-} +module TH where +th = [|909|] diff --git a/testsuite/tests/ghci/T16670/all.T b/testsuite/tests/ghci/T16670/all.T new file mode 100644 index 0000000000..00a4f5311c --- /dev/null +++ b/testsuite/tests/ghci/T16670/all.T @@ -0,0 +1,7 @@ +test('T16670_unboxed', [extra_files(['T16670_unboxed.hs']), + req_interp, omit_ways(prof_ways), unless(have_dynamic(), skip)], + makefile_test, ['T16670_unboxed']) + +test('T16670_th', [extra_files(['T16670_th.hs', 'TH.hs']), + req_interp, omit_ways(prof_ways), unless(have_dynamic(), skip)], + makefile_test, ['T16670_th']) |