summaryrefslogtreecommitdiff
path: root/compiler/ilxGen/tests/test21.hs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/ilxGen/tests/test21.hs')
-rw-r--r--compiler/ilxGen/tests/test21.hs13
1 files changed, 13 insertions, 0 deletions
diff --git a/compiler/ilxGen/tests/test21.hs b/compiler/ilxGen/tests/test21.hs
new file mode 100644
index 0000000000..1870f22b97
--- /dev/null
+++ b/compiler/ilxGen/tests/test21.hs
@@ -0,0 +1,13 @@
+{-# OPTIONS -fno-implicit-prelude #-}
+
+import PrelIOBase
+import PrelIO
+import PrelBase
+import PrelAddr
+
+foreign import "libHS_cbits" "getErrStr__" unsafe ggetErrStr__ :: Int -> IO Addr
+
+main = putStr (uunsafePerformIO (ggetErrStr__ 4))
+
+uunsafePerformIO :: IO Addr -> [Char]
+uunsafePerformIO (IO m) = case m realWorld# of (# _, (A# r) #) -> (unpackCString# r)