diff options
author | Alexander Vershilov <alexander.vershilov@tweag.io> | 2015-01-14 17:58:30 -0600 |
---|---|---|
committer | Austin Seipp <austin@well-typed.com> | 2015-01-16 10:15:45 -0600 |
commit | fffbf0627c2c2ee4bc49f9d26a226b39a066945e (patch) | |
tree | a3f74945126cef5faa1c28f524097a20ac5d4cd5 /testsuite/tests/ghci | |
parent | 6392df07e89304a4daeb1af379c051b03a39cda7 (diff) | |
download | haskell-fffbf0627c2c2ee4bc49f9d26a226b39a066945e.tar.gz |
Trac #9878: Make the static form illegal in interpreted mode.
Summary:
The entries of the static pointers table are expected to exist as
object code. Thus we have ghci complain with an intelligible error
message if the static form is used in interpreted mode.
It also includes a fix to keysHashTable in Hash.c which could cause a
crash. The iteration of the hashtable internals was incorrect. This
patch has the function keysHashTable imitate the iteration in
freeHashTable.
Finally, we submit here some minor edits to comments and
GHC.StaticPtr.StaticPtrInfo field names.
Authored-by: Alexander Vershilov <alexander.vershilov@tweag.
Authored-by: Facundo DomÃnguez <facundo.dominguez@tweag.io>
Test Plan: ./validate
Reviewers: simonpj, hvr, austin
Reviewed By: austin
Subscribers: carter, thomie, qnikst, mboes
Differential Revision: https://phabricator.haskell.org/D586
GHC Trac Issues: #9878
Diffstat (limited to 'testsuite/tests/ghci')
-rw-r--r-- | testsuite/tests/ghci/scripts/T9878.hs | 6 | ||||
-rw-r--r-- | testsuite/tests/ghci/scripts/T9878.script | 1 | ||||
-rw-r--r-- | testsuite/tests/ghci/scripts/T9878.stderr | 4 | ||||
-rw-r--r-- | testsuite/tests/ghci/scripts/T9878b.script | 2 | ||||
-rw-r--r-- | testsuite/tests/ghci/scripts/T9878b.stdout | 1 | ||||
-rwxr-xr-x | testsuite/tests/ghci/scripts/all.T | 7 |
6 files changed, 21 insertions, 0 deletions
diff --git a/testsuite/tests/ghci/scripts/T9878.hs b/testsuite/tests/ghci/scripts/T9878.hs new file mode 100644 index 0000000000..fcecedab20 --- /dev/null +++ b/testsuite/tests/ghci/scripts/T9878.hs @@ -0,0 +1,6 @@ +{-# LANGUAGE StaticPointers #-} +module T9878 where + +import GHC.StaticPtr + +f = deRefStaticPtr (static True) diff --git a/testsuite/tests/ghci/scripts/T9878.script b/testsuite/tests/ghci/scripts/T9878.script new file mode 100644 index 0000000000..498183fa60 --- /dev/null +++ b/testsuite/tests/ghci/scripts/T9878.script @@ -0,0 +1 @@ +:l T9878.hs diff --git a/testsuite/tests/ghci/scripts/T9878.stderr b/testsuite/tests/ghci/scripts/T9878.stderr new file mode 100644 index 0000000000..98a8edfe25 --- /dev/null +++ b/testsuite/tests/ghci/scripts/T9878.stderr @@ -0,0 +1,4 @@ + +T9878.hs:6:21: + The static form is not supported in interpreted mode. + Please use -fobject-code. diff --git a/testsuite/tests/ghci/scripts/T9878b.script b/testsuite/tests/ghci/scripts/T9878b.script new file mode 100644 index 0000000000..a855858bd6 --- /dev/null +++ b/testsuite/tests/ghci/scripts/T9878b.script @@ -0,0 +1,2 @@ +:l T9878.hs +f diff --git a/testsuite/tests/ghci/scripts/T9878b.stdout b/testsuite/tests/ghci/scripts/T9878b.stdout new file mode 100644 index 0000000000..0ca95142bb --- /dev/null +++ b/testsuite/tests/ghci/scripts/T9878b.stdout @@ -0,0 +1 @@ +True diff --git a/testsuite/tests/ghci/scripts/all.T b/testsuite/tests/ghci/scripts/all.T index 3e2ea77d61..fbcdb259e0 100755 --- a/testsuite/tests/ghci/scripts/all.T +++ b/testsuite/tests/ghci/scripts/all.T @@ -199,3 +199,10 @@ test('T9762', ], ghci_script, ['T9762.script']) test('T9881', normal, ghci_script, ['T9881.script']) +test('T9878', + [extra_clean(['T9878.hi','T9878.o'])], + ghci_script, ['T9878.script']) +test('T9878b', + [ extra_run_opts('-fobject-code'), + extra_clean(['T9878.hi','T9878.o'])], + ghci_script, ['T9878b.script']) |