summaryrefslogtreecommitdiff
path: root/testsuite/tests
diff options
context:
space:
mode:
authorRoland Senn <rsx@bluewin.ch>2021-05-27 16:04:13 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-06-02 04:39:23 -0400
commitfcd124d5c7c1c4ea8488587f65112b7a66b7da83 (patch)
tree00d87b0161e2a8245d057ff98cbebc29dd6cc46f /testsuite/tests
parent6b6c4b9ab0f773011a04c19f3cd5131a1aab2a41 (diff)
downloadhaskell-fcd124d5c7c1c4ea8488587f65112b7a66b7da83.tar.gz
Allow primops in a :print (and friends) command. Fix #19394
* For primops from `GHC.Prim` lookup the HValues in `GHC.PrimopWrappers`. * Add short error messages if a user tries to use a *Non-Id* value or a `pseudoop` in a `:print`, `:sprint` or `force`command. * Add additional test cases for `Magic Ids`.
Diffstat (limited to 'testsuite/tests')
-rw-r--r--testsuite/tests/ghci.debugger/scripts/T19394.script4
-rw-r--r--testsuite/tests/ghci.debugger/scripts/T19394.stdout11
-rw-r--r--testsuite/tests/ghci.debugger/scripts/all.T1
3 files changed, 16 insertions, 0 deletions
diff --git a/testsuite/tests/ghci.debugger/scripts/T19394.script b/testsuite/tests/ghci.debugger/scripts/T19394.script
new file mode 100644
index 0000000000..de01bad9b4
--- /dev/null
+++ b/testsuite/tests/ghci.debugger/scripts/T19394.script
@@ -0,0 +1,4 @@
+:set -XMagicHash
+import Data.Coerce
+import GHC.Exts
+:print seq coerce error oneShot xor# seq# lazy realWorld# Word8# Int void#
diff --git a/testsuite/tests/ghci.debugger/scripts/T19394.stdout b/testsuite/tests/ghci.debugger/scripts/T19394.stdout
new file mode 100644
index 0000000000..0762c80e0e
--- /dev/null
+++ b/testsuite/tests/ghci.debugger/scripts/T19394.stdout
@@ -0,0 +1,11 @@
+Identifier ‘seq’ is not eligible for the :print, :sprint or :force commands.
+Identifier ‘coerce’ is not eligible for the :print, :sprint or :force commands.
+Identifier ‘realWorld#’ is not eligible for the :print, :sprint or :force commands.
+Type constructor ‘Word8#’ is not eligible for the :print, :sprint or :force commands.
+Type constructor ‘Int’ is not eligible for the :print, :sprint or :force commands.
+Identifier ‘void#’ is not eligible for the :print, :sprint or :force commands.
+error = (_t1::GHC.Stack.Types.HasCallStack => [Char] -> a)
+oneShot = (_t2::(a -> b) -> a -> b)
+xor# = (_t3::Word# -> Word# -> Word#)
+seq# = (_t4::a -> State# d -> (# State# d, a #))
+lazy = (_t5::a -> a)
diff --git a/testsuite/tests/ghci.debugger/scripts/all.T b/testsuite/tests/ghci.debugger/scripts/all.T
index 8e50e6b35f..42f7fa1c2c 100644
--- a/testsuite/tests/ghci.debugger/scripts/all.T
+++ b/testsuite/tests/ghci.debugger/scripts/all.T
@@ -128,3 +128,4 @@ test('T2215', normal, ghci_script, ['T2215.script'])
test('T17989', normal, ghci_script, ['T17989.script'])
test('T19157', normal, ghci_script, ['T19157.script'])
test('T19355', normal, ghci_script, ['T19355.script'])
+test('T19394', normal, ghci_script, ['T19394.script'])